From 95461504c3f30d9ac620003fdfd899a62e0537a1 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Fri, 16 Feb 2018 11:33:10 +0100 Subject: [PATCH 1/2] Deal with changed runtime function. --- src/interop/base.jl | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/interop/base.jl b/src/interop/base.jl index 7cb39ff7..40ce2728 100644 --- a/src/interop/base.jl +++ b/src/interop/base.jl @@ -60,7 +60,11 @@ Return if a type would be boxed when instantiated in the code generator. """ function isboxed(typ::Type) isboxed_ref = Ref{Bool}() - ccall(:julia_type_to_llvm, LLVM.API.LLVMTypeRef, (Any, Ptr{Bool}), typ, isboxed_ref) + if VERSION >= v"1.5.0-DEV.393" + ccall(:jl_type_to_llvm, LLVM.API.LLVMTypeRef, (Any, Ptr{Bool}), typ, isboxed_ref) + else + ccall(:julia_type_to_llvm, LLVM.API.LLVMTypeRef, (Any, Ptr{Bool}), typ, isboxed_ref) + end return isboxed_ref[] end @@ -71,8 +75,13 @@ Convert a Julia type `typ` to its LLVM representation. Fails if the type would b """ function Base.convert(::Type{LLVMType}, typ::Type, allow_boxed::Bool=false) isboxed_ref = Ref{Bool}() - llvmtyp = LLVMType(ccall(:julia_type_to_llvm, LLVM.API.LLVMTypeRef, - (Any, Ptr{Bool}), typ, isboxed_ref)) + if VERSION >= v"1.5.0-DEV.393" + llvmtyp = LLVMType(ccall(:jl_type_to_llvm, LLVM.API.LLVMTypeRef, + (Any, Ptr{Bool}), typ, isboxed_ref)) + else + llvmtyp = LLVMType(ccall(:julia_type_to_llvm, LLVM.API.LLVMTypeRef, + (Any, Ptr{Bool}), typ, isboxed_ref)) + end if !allow_boxed && isboxed_ref[] error("Conversion of boxed type $typ is not allowed") end From cfb28f34923d9ce20181114c569f6026fa26893b Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Wed, 4 Mar 2020 09:10:27 +0100 Subject: [PATCH 2/2] Remove bad test. --- test/core.jl | 7 ------- 1 file changed, 7 deletions(-) diff --git a/test/core.jl b/test/core.jl index 9b340f7d..6f844619 100644 --- a/test/core.jl +++ b/test/core.jl @@ -444,13 +444,6 @@ LLVM.Module("SomeModule", ctx) do mod unsafe_delete!(mod, gv) @test isempty(gvars) end - - # bug: PointerNull wasn't a constant, and couldn't be used as an initializer - let ptrtyp = LLVM.PointerType(LLVM.VoidType(ctx)) - gv = GlobalVariable(mod, ptrtyp, "SomeOtherGlobal") - init = PointerNull(ptrtyp) - initializer!(gv, init) - end end end