Skip to content

Commit 2ef8c52

Browse files
authored
Fix for Julia 1.8: pass codegen params by pointer. (#254)
1 parent d1f0080 commit 2ef8c52

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/jlgen.jl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,12 +355,18 @@ function compile_method_instance(@nospecialize(job::CompilerJob),
355355

356356
# generate IR
357357
GC.@preserve lookup_cb begin
358-
native_code = ccall(:jl_create_native, Ptr{Cvoid},
359-
(Vector{MethodInstance}, Base.CodegenParams, Cint),
360-
[method_instance], params, #=extern policy=# 1)
358+
native_code = if VERSION >= v"1.8.0-DEV.661"
359+
ccall(:jl_create_native, Ptr{Cvoid},
360+
(Vector{MethodInstance}, Ptr{Base.CodegenParams}, Cint),
361+
[method_instance], Ref(params), #=extern policy=# 1)
362+
else
363+
ccall(:jl_create_native, Ptr{Cvoid},
364+
(Vector{MethodInstance}, Base.CodegenParams, Cint),
365+
[method_instance], params, #=extern policy=# 1)
366+
end
361367
@assert native_code != C_NULL
362368
llvm_mod_ref = ccall(:jl_get_llvm_module, LLVM.API.LLVMModuleRef,
363-
(Ptr{Cvoid},), native_code)
369+
(Ptr{Cvoid},), native_code)
364370
@assert llvm_mod_ref != C_NULL
365371
llvm_mod = LLVM.Module(llvm_mod_ref)
366372
end

0 commit comments

Comments
 (0)