Skip to content

Commit

Permalink
Do not yet mandate opaque pointers for LLVM 15
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed May 10, 2023
1 parent 286b371 commit b2273d3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
11 changes: 11 additions & 0 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9083,6 +9083,17 @@ extern "C" void jl_init_llvm(void)
if (clopt && clopt->getNumOccurrences() == 0)
cl::ProvidePositionalOption(clopt, "4", 1);

#if JL_LLVM_VERSION >= 150000
clopt = llvmopts.lookup("opaque-pointers");
if (clopt && clopt->getNumOccurrences() == 0) {
#ifdef JL_LLVM_OPAQUE_POINTERS
cl::ProvidePositionalOption(clopt, "true", 1);
#else
cl::ProvidePositionalOption(clopt, "false", 1);
#endif
}
#endif

jl_ExecutionEngine = new JuliaOJIT();

bool jl_using_gdb_jitevents = false;
Expand Down
3 changes: 0 additions & 3 deletions src/jitlayers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1306,9 +1306,6 @@ JuliaOJIT::JuliaOJIT()
JD(ES.createBareJITDylib("JuliaOJIT")),
ContextPool([](){
auto ctx = std::make_unique<LLVMContext>();
#ifdef JL_LLVM_OPAQUE_POINTERS
ctx->setOpaquePointers(true);
#endif
return orc::ThreadSafeContext(std::move(ctx));
}),
#ifdef JL_USE_JITLINK
Expand Down
2 changes: 1 addition & 1 deletion src/llvm-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#error Only LLVM versions >= 12.0.0 are supported by Julia
#endif

#if JL_LLVM_VERSION >= 150000
#if JL_LLVM_VERSION >= 160000
#define JL_LLVM_OPAQUE_POINTERS 1
#endif

Expand Down

0 comments on commit b2273d3

Please sign in to comment.