Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

At least I got it to compile with g++ 10.2 and LLVM 10. #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 3rdparty/lexertl/parser/tokeniser/re_tokeniser_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct basic_re_tokeniser_state
assign (rhs_);
}

void assign (const basic_re_tokeniser_state &rhs_)
auto assign (const basic_re_tokeniser_state &rhs_)
{
_start = rhs_._start;
_end = rhs_._end;
Expand Down
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ MESSAGE( STATUS "CMAKE_SYSTEM_PROCESSOR: " ${CMAKE_SYSTEM_PROCESSOR} )

Find_Package(Boost REQUIRED)

IF( Boost_VERSION LESS ${BOOST_MIN_VERSION} )
MESSAGE(FATAL_ERROR "Boost version ${Boost_VERSION} too old, please install ${BOOST_MIN_VERSION_TEXT} or greater!")
ENDIF( Boost_VERSION LESS ${BOOST_MIN_VERSION} )
#IF( Boost_VERSION LESS ${BOOST_MIN_VERSION} )
# MESSAGE(FATAL_ERROR "Boost version ${Boost_VERSION} too old, please install ${BOOST_MIN_VERSION_TEXT} or greater!")
#ENDIF( Boost_VERSION LESS ${BOOST_MIN_VERSION} )

set(NEEDED_Boost_VERSION 1.69.0)
find_package(Boost ${NEEDED_Boost_VERSION} REQUIRED COMPONENTS mpi serialization system filesystem)
set(Boost_LIBS ${Boost_LIBRARIES})

Find_Package(LLVM REQUIRED)
Find_Package(Sqlite3 REQUIRED)
Expand Down
9 changes: 4 additions & 5 deletions corvus/pConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

#include <iostream>

#include <llvm/ADT/OwningPtr.h>

#if (LLVM_VERSION >= 3003000)
#include <llvm/IR/Value.h> // isa
#else
Expand All @@ -23,18 +21,19 @@
#include <llvm/Support/SourceMgr.h>
#include <llvm/Support/YAMLParser.h>
#include <llvm/Support/MemoryBuffer.h>
#include <llvm/Support/system_error.h>
#include <llvm/ADT/APInt.h>

#include <system_error> // for error_code

namespace corvus {

bool pConfigMgr::read(const llvm::Twine &file, pConfig &c) {

llvm::SmallString<128> path_storage;
llvm::StringRef fName = file.toStringRef(path_storage);

llvm::OwningPtr<llvm::MemoryBuffer> contents;
if (llvm::MemoryBuffer::getFile(fName, contents)) {
std::unique_ptr<llvm::MemoryBuffer> contents;
if (llvm::MemoryBuffer::getFile(fName)) {
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions corvus/pParseContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ class pParseContext {
void *allocate(size_t size, size_t align = 8) {
return allocator_.Allocate(size, align);
}
void deallocate(void* Ptr) {
void deallocate(void* Ptr, size_t Size = 4096) {
// note this is a NOOP for bumpptr
allocator_.Deallocate(Ptr);
allocator_.Deallocate(Ptr, Size);
}

llvm::StringPool& idPool(void) { return idPool_; }
Expand Down
2 changes: 1 addition & 1 deletion corvus/pParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ void parseSourceFile(pSourceModule* pMod, bool debug=false) {
countNewlines(context, match, lastNL);
break;
}
case ~0: // npos
case std::numeric_limits<int>::max(): // npos
{
// if state is HTML, collect characters for INLINE HTML token
if (match.state == 0) {
Expand Down
5 changes: 2 additions & 3 deletions corvus/pSourceFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@
#include "corvus/pParseError.h"
#include "corvus/pSourceLoc.h"

#include <llvm/Support/system_error.h>

#include <system_error> // for error_code

namespace corvus {

pSourceFile::pSourceFile(pStringRef file):
file_(file)
{

if (llvm::MemoryBuffer::getFile(file, contents_)) {
if (llvm::MemoryBuffer::getFile(file)) {
throw pParseError("couldn't open file [" + file_ + "]", pSourceLoc(file, 0, 0));
}

Expand Down
8 changes: 5 additions & 3 deletions corvus/pSourceFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,18 @@
#include "corvus/pTypes.h"

#include <string>
#include <llvm/ADT/OwningPtr.h>
#include <llvm/Support/ErrorOr.h>
#include <llvm/Support/MemoryBuffer.h>

using llvm::MemoryBuffer;

namespace corvus {

class pSourceFile {

private:
std::string file_;
llvm::OwningPtr<llvm::MemoryBuffer> contents_;
std::unique_ptr<MemoryBuffer> contents_;

public:

Expand All @@ -32,7 +34,7 @@ class pSourceFile {
const std::string& fileName(void) const {
return file_;
}
const llvm::MemoryBuffer* contents(void) const { return contents_.get(); }
const MemoryBuffer* contents(void) const { return contents_.get(); }

};

Expand Down
8 changes: 4 additions & 4 deletions corvus/pSourceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
#include "corvus/passes/ModelChecker.h"
#include "corvus/passes/TypeAnalysis.h"

#include <llvm/Support/PathV2.h>
#include <llvm/Support/Path.h>
#include <llvm/Support/FileSystem.h>
#include <llvm/Support/system_error.h>
#include <llvm/ADT/SmallVector.h>

#include <sqlite3.h>

#include <stdlib.h>
#include <assert.h>
#include <system_error> // for error_code

namespace corvus {

Expand Down Expand Up @@ -219,7 +219,7 @@ void pSourceManager::addSourceDir(pStringRef name, pStringRef exts) {
llvm::SmallVector<pStringRef, 8> extList;
exts.split(extList, ",");

llvm::error_code ec;
std::error_code ec;
for (llvm::sys::fs::recursive_directory_iterator dir(name, ec), dirEnd;
dir != dirEnd && !ec; dir.increment(ec)) {

Expand Down Expand Up @@ -326,7 +326,7 @@ void pSourceManager::addIncludeDir(pStringRef name, pStringRef exts) {
llvm::SmallVector<pStringRef, 8> extList;
exts.split(extList, ",", 8);

llvm::error_code ec;
std::error_code ec;
for (llvm::sys::fs::recursive_directory_iterator dir(name, ec), dirEnd;
dir != dirEnd && !ec; dir.increment(ec)) {

Expand Down