diff --git a/src/codegen.cpp b/src/codegen.cpp index a9d2cb0c60333..2e3f7eb2bf7bb 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -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; diff --git a/src/jitlayers.cpp b/src/jitlayers.cpp index 643f0468457ae..ef7e98bb7852a 100644 --- a/src/jitlayers.cpp +++ b/src/jitlayers.cpp @@ -1306,9 +1306,6 @@ JuliaOJIT::JuliaOJIT() JD(ES.createBareJITDylib("JuliaOJIT")), ContextPool([](){ auto ctx = std::make_unique(); -#ifdef JL_LLVM_OPAQUE_POINTERS - ctx->setOpaquePointers(true); -#endif return orc::ThreadSafeContext(std::move(ctx)); }), #ifdef JL_USE_JITLINK diff --git a/src/llvm-version.h b/src/llvm-version.h index a3f3774b6dc15..819ec1c88976b 100644 --- a/src/llvm-version.h +++ b/src/llvm-version.h @@ -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