Permalink
Browse files

Fix jit with LLVM 8 (#2944)

  • Loading branch information...
thewilsonator committed Dec 18, 2018
1 parent d4858cf commit 3dc367db400d287f07c1adf7c4c9bd82b0b16e23
Showing with 9 additions and 1 deletion.
  1. +1 −1 runtime/jit-rt/cpp-so/jit_context.cpp
  2. +8 −0 runtime/jit-rt/cpp-so/jit_context.h
@@ -95,7 +95,7 @@ JITContext::JITContext()
execSession(stringPool), resolver(createResolver()),
objectLayer(execSession,
[this](llvm::orc::VModuleKey) {
return llvm::orc::RTDyldObjectLinkingLayer::Resources{
return ObjectLayerT::Resources{
std::make_shared<llvm::SectionMemoryManager>(),
resolver};
}),
@@ -67,11 +67,19 @@ class JITContext final {
llvm::llvm_shutdown_obj shutdownObj;
std::unique_ptr<llvm::TargetMachine> targetmachine;
const llvm::DataLayout dataLayout;
#if LDC_LLVM_VER >= 800
using ObjectLayerT = llvm::orc::LegacyRTDyldObjectLinkingLayer;
using ListenerLayerT =
llvm::orc::LegacyObjectTransformLayer<ObjectLayerT, ModuleListener>;
using CompileLayerT =
llvm::orc::LegacyIRCompileLayer<ListenerLayerT, llvm::orc::SimpleCompiler>;
#else
using ObjectLayerT = llvm::orc::RTDyldObjectLinkingLayer;
using ListenerLayerT =
llvm::orc::ObjectTransformLayer<ObjectLayerT, ModuleListener>;
using CompileLayerT =
llvm::orc::IRCompileLayer<ListenerLayerT, llvm::orc::SimpleCompiler>;
#endif
#if LDC_LLVM_VER >= 700
using ModuleHandleT = llvm::orc::VModuleKey;
std::shared_ptr<llvm::orc::SymbolStringPool> stringPool;

0 comments on commit 3dc367d

Please sign in to comment.