Skip to content

Commit 3753780

Browse files
authored
Merge pull request #149 from maleadt/tb/llvmcontext
Adapt to JuliaLang/julia#32588
2 parents 84dbf46 + 965e489 commit 3753780

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/interop/base.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,16 @@ export JuliaContext, create_function, call_function, isboxed, isghosttype
55
66
Returns the (session-bound) LLVM context used by the Julia compiler.
77
"""
8-
JuliaContext() = LLVM.Context(convert(LLVM.API.LLVMContextRef, cglobal(:jl_LLVMContext)))
8+
function JuliaContext()
9+
ptr = cglobal(:jl_LLVMContext)
10+
ref = if VERSION >= v"1.3.0-DEV.550"
11+
ptr = convert(Ptr{LLVM.API.LLVMContextRef}, ptr)
12+
unsafe_load(ptr)
13+
else
14+
convert(LLVM.API.LLVMContextRef, ptr)
15+
end
16+
LLVM.Context(ref)
17+
end
918

1019
"""
1120
create_function(rettyp::LLVMType, argtyp::Vector{LLVMType}, [name::String])

0 commit comments

Comments
 (0)