Skip to content

Commit 07806ed

Browse files
authored
Merge pull request #171 from maleadt/tb/codegen-norecursion
Deal with changed runtime function.
2 parents 306e09a + cfb28f3 commit 07806ed

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/interop/base.jl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ Return if a type would be boxed when instantiated in the code generator.
6060
"""
6161
function isboxed(typ::Type)
6262
isboxed_ref = Ref{Bool}()
63-
ccall(:julia_type_to_llvm, LLVM.API.LLVMTypeRef, (Any, Ptr{Bool}), typ, isboxed_ref)
63+
if VERSION >= v"1.5.0-DEV.393"
64+
ccall(:jl_type_to_llvm, LLVM.API.LLVMTypeRef, (Any, Ptr{Bool}), typ, isboxed_ref)
65+
else
66+
ccall(:julia_type_to_llvm, LLVM.API.LLVMTypeRef, (Any, Ptr{Bool}), typ, isboxed_ref)
67+
end
6468
return isboxed_ref[]
6569
end
6670

@@ -71,8 +75,13 @@ Convert a Julia type `typ` to its LLVM representation. Fails if the type would b
7175
"""
7276
function Base.convert(::Type{LLVMType}, typ::Type, allow_boxed::Bool=false)
7377
isboxed_ref = Ref{Bool}()
74-
llvmtyp = LLVMType(ccall(:julia_type_to_llvm, LLVM.API.LLVMTypeRef,
75-
(Any, Ptr{Bool}), typ, isboxed_ref))
78+
if VERSION >= v"1.5.0-DEV.393"
79+
llvmtyp = LLVMType(ccall(:jl_type_to_llvm, LLVM.API.LLVMTypeRef,
80+
(Any, Ptr{Bool}), typ, isboxed_ref))
81+
else
82+
llvmtyp = LLVMType(ccall(:julia_type_to_llvm, LLVM.API.LLVMTypeRef,
83+
(Any, Ptr{Bool}), typ, isboxed_ref))
84+
end
7685
if !allow_boxed && isboxed_ref[]
7786
error("Conversion of boxed type $typ is not allowed")
7887
end

test/core.jl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -444,13 +444,6 @@ LLVM.Module("SomeModule", ctx) do mod
444444
unsafe_delete!(mod, gv)
445445
@test isempty(gvars)
446446
end
447-
448-
# bug: PointerNull wasn't a constant, and couldn't be used as an initializer
449-
let ptrtyp = LLVM.PointerType(LLVM.VoidType(ctx))
450-
gv = GlobalVariable(mod, ptrtyp, "SomeOtherGlobal")
451-
init = PointerNull(ptrtyp)
452-
initializer!(gv, init)
453-
end
454447
end
455448
end
456449

0 commit comments

Comments
 (0)