Skip to content

Commit

Permalink
Enable OpaquePointers on LLVM 15
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy authored and vtjnash committed Oct 18, 2023
1 parent 3cc4fdc commit fca8300
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
11 changes: 0 additions & 11 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9362,17 +9362,6 @@ 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
4 changes: 4 additions & 0 deletions src/jitlayers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1629,6 +1629,10 @@ JuliaOJIT::JuliaOJIT()
DLSymOpt(std::make_unique<DLSymOptimizer>(false)),
ContextPool([](){
auto ctx = std::make_unique<LLVMContext>();
#ifndef JL_LLVM_OPAQUE_POINTERS
if (ctx.supportsTypedPointers())
ctx.setOpaquePointers(false);
#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 >= 14.0.0 are supported by Julia
#endif

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

Expand Down

0 comments on commit fca8300

Please sign in to comment.