Skip to content

Commit

Permalink
Merge pull request #1636 from lkeegan/support_llvm_10
Browse files Browse the repository at this point in the history
add support for LLVM 10
  • Loading branch information
certik committed Jan 28, 2020
2 parents fc05f8d + 8354d14 commit fff19f5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Expand Up @@ -34,8 +34,13 @@ endif()

# Enable C++11 support in all compilers. SymEngine will not compile unless
# the C++11 support is enabled.
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|Intel")
set(CXX11_OPTIONS "-std=c++11")
set(WITH_CPP14 no CACHE BOOL "Build with C++14 support")
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|Intel")
if(WITH_CPP14)
set(CXX11_OPTIONS "-std=c++14")
else()
set(CXX11_OPTIONS "-std=c++11")
endif()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "PGI")
# pgcpp
set(CXX11_OPTIONS "--gnu --c++11 -D__GXX_EXPERIMENTAL_CXX0X__")
Expand Down
10 changes: 8 additions & 2 deletions symengine/llvm_double.cpp
Expand Up @@ -54,6 +54,12 @@
namespace SymEngine
{

#if (LLVM_VERSION_MAJOR >= 10)
using std::make_unique;
#else
using llvm::make_unique;
#endif

class IRBuilder : public llvm::IRBuilder<>
{
};
Expand Down Expand Up @@ -191,7 +197,7 @@ void LLVMVisitor::init(const vec_basic &inputs, const vec_basic &outputs,

// Create some module to put our function into it.
std::unique_ptr<llvm::Module> module
= llvm::make_unique<llvm::Module>("SymEngine", *context.get());
= make_unique<llvm::Module>("SymEngine", *context.get());
module->setDataLayout("");
mod = module.get();

Expand Down Expand Up @@ -957,7 +963,7 @@ void LLVMVisitor::loads(const std::string &s)

// Create some module to put our function into it.
std::unique_ptr<llvm::Module> module
= llvm::make_unique<llvm::Module>("SymEngine", *context);
= make_unique<llvm::Module>("SymEngine", *context);
module->setDataLayout("");
mod = module.get();

Expand Down

0 comments on commit fff19f5

Please sign in to comment.