diff --git a/runtime/jit-rt/cpp-so/jit_context.cpp b/runtime/jit-rt/cpp-so/jit_context.cpp index 5aa6986970..f3311c14e0 100644 --- a/runtime/jit-rt/cpp-so/jit_context.cpp +++ b/runtime/jit-rt/cpp-so/jit_context.cpp @@ -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(), resolver}; }), diff --git a/runtime/jit-rt/cpp-so/jit_context.h b/runtime/jit-rt/cpp-so/jit_context.h index 260ba49e26..be1f0d3808 100644 --- a/runtime/jit-rt/cpp-so/jit_context.h +++ b/runtime/jit-rt/cpp-so/jit_context.h @@ -67,11 +67,19 @@ private: llvm::llvm_shutdown_obj shutdownObj; std::unique_ptr targetmachine; const llvm::DataLayout dataLayout; +#if LDC_LLVM_VER >= 800 + using ObjectLayerT = llvm::orc::LegacyRTDyldObjectLinkingLayer; + using ListenerLayerT = + llvm::orc::LegacyObjectTransformLayer; + using CompileLayerT = + llvm::orc::LegacyIRCompileLayer; +#else using ObjectLayerT = llvm::orc::RTDyldObjectLinkingLayer; using ListenerLayerT = llvm::orc::ObjectTransformLayer; using CompileLayerT = llvm::orc::IRCompileLayer; +#endif #if LDC_LLVM_VER >= 700 using ModuleHandleT = llvm::orc::VModuleKey; std::shared_ptr stringPool;