Skip to content

Commit 9f90e9d

Browse files
authored
Merge pull request #568 from JuliaGPU/tb/fixes
Fixes for 1.12
2 parents 46edf96 + e1f8247 commit 9f90e9d

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

src/driver.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,12 @@ const __llvm_initialized = Ref(false)
275275
for call in worklist[dyn_job]
276276
@dispose builder=IRBuilder() begin
277277
position!(builder, call)
278-
fptr = ptrtoint!(builder, dyn_entry, T_ptr)
278+
fptr = if VERSION >= v"1.12.0-DEV.225"
279+
T_ptr = LLVM.PointerType(LLVM.Int8Type())
280+
bitcast!(builder, dyn_entry, T_ptr)
281+
else
282+
ptrtoint!(builder, dyn_entry, T_ptr)
283+
end
279284
replace_uses!(call, fptr)
280285
end
281286
unsafe_delete!(LLVM.parent(call), call)

src/jlgen.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,10 @@ macro in_world(world, ex)
587587
end
588588

589589
function compile_method_instance(@nospecialize(job::CompilerJob))
590+
if job.source.def.primary_world > job.world || job.world > job.source.def.deleted_world
591+
error("Cannot compile $(job.source) for world $(job.world); method is only valid in worlds $(job.source.def.primary_world) to $(job.source.def.deleted_world)")
592+
end
593+
590594
# populate the cache
591595
interp = get_interpreter(job)
592596
cache = CC.code_cache(interp)

src/utils.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,17 @@ for level in [:debug, :info, :warn, :error]
7272
end
7373
end
7474

75+
macro safe_show(exs...)
76+
blk = Expr(:block)
77+
for ex in exs
78+
push!(blk.args,
79+
:(println(Core.stdout, $(sprint(Base.show_unquoted,ex)*" = "),
80+
repr(begin local value = $(esc(ex)) end))))
81+
end
82+
isempty(exs) || push!(blk.args, :value)
83+
return blk
84+
end
85+
7586

7687

7788
## codegen locking

0 commit comments

Comments
 (0)