Skip to content

Commit 1b42f36

Browse files
committed
Adapt to upstream changes.
1 parent 09b4708 commit 1b42f36

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/jlgen.jl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,9 @@ end
412412
CC.may_optimize(interp::GPUInterpreter) = true
413413
CC.may_compress(interp::GPUInterpreter) = true
414414
CC.may_discard_trees(interp::GPUInterpreter) = true
415+
@static if VERSION <= v"1.12.0-DEV.1531"
415416
CC.verbose_stmt_info(interp::GPUInterpreter) = false
417+
end
416418
CC.method_table(interp::GPUInterpreter) = interp.method_table
417419

418420
# semi-concrete interepretation is broken with overlays (JuliaLang/julia#47349)
@@ -615,9 +617,11 @@ function compile_method_instance(@nospecialize(job::CompilerJob))
615617
prefer_specsig = true,
616618
gnu_pubnames = false,
617619
debug_info_kind = Cint(debug_info_kind),
618-
lookup = Base.unsafe_convert(Ptr{Nothing}, lookup_cb),
619620
safepoint_on_entry = can_safepoint(job),
620621
gcstack_arg = false)
622+
if VERSION < v"1.12.0-DEV.1667"
623+
cgparams = (; lookup = Base.unsafe_convert(Ptr{Nothing}, lookup_cb), cgparams... )
624+
end
621625
params = Base.CodegenParams(; cgparams...)
622626

623627
# generate IR
@@ -635,9 +639,15 @@ function compile_method_instance(@nospecialize(job::CompilerJob))
635639
Metadata(ConstantInt(DEBUG_METADATA_VERSION()))
636640
end
637641

638-
native_code = ccall(:jl_create_native, Ptr{Cvoid},
642+
native_code = if VERSION >= v"1.12.0-DEV.1667"
643+
ccall(:jl_create_native, Ptr{Cvoid},
644+
(Vector{MethodInstance}, LLVM.API.LLVMOrcThreadSafeModuleRef, Ptr{Base.CodegenParams}, Cint, Cint, Cint, Csize_t, Ptr{Cvoid}),
645+
[job.source], ts_mod, Ref(params), CompilationPolicyExtern, #=imaging mode=# 0, #=external linkage=# 0, job.world, Base.unsafe_convert(Ptr{Nothing}, lookup_cb))
646+
else
647+
ccall(:jl_create_native, Ptr{Cvoid},
639648
(Vector{MethodInstance}, LLVM.API.LLVMOrcThreadSafeModuleRef, Ptr{Base.CodegenParams}, Cint, Cint, Cint, Csize_t),
640649
[job.source], ts_mod, Ref(params), CompilationPolicyExtern, #=imaging mode=# 0, #=external linkage=# 0, job.world)
650+
end
641651
@assert native_code != C_NULL
642652

643653
llvm_mod_ref =

test/native_tests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ end
471471
Native.code_execution(mod.func, Tuple{})) do msg
472472
occursin("invalid LLVM IR", msg) &&
473473
occursin(GPUCompiler.DYNAMIC_CALL, msg) &&
474-
occursin("call to println", msg) &&
474+
occursin("call to print", msg) &&
475475
occursin("[2] func", msg)
476476
end
477477
end

0 commit comments

Comments
 (0)