Skip to content

Commit 37423ab

Browse files
committed
add final_lower_gc! wrapper
1 parent 1b7ca62 commit 37423ab

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

lib/libLLVM_extra.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,14 @@ end
150150

151151
end
152152

153+
if VERSION >= v"1.3.0-DEV.95"
154+
155+
function LLVMAddFinalLowerGCPass(PM::LLVMPassManagerRef)
156+
@apicall(:LLVMExtraAddFinalLowerGCPass,Cvoid,(LLVMPassManagerRef,), PM)
157+
end
158+
159+
end # v"1.3.0-DEV.95"
160+
153161
function LLVMGetValueContext(V::LLVMValueRef)
154162
@apicall(:LLVMExtraGetValueContext,LLVMContextRef,(LLVMValueRef,),V)
155163
end

src/interop/passes.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export alloc_opt!, barrier_noop!, gc_invariant_verifier!, lower_exc_handlers!,
22
combine_mul_add!, multi_versioning!, propagate_julia_addrsp!, lower_ptls!,
3-
lower_simdloop!, late_lower_gc_frame!
3+
lower_simdloop!, late_lower_gc_frame!, final_lower_gc!
44

55
alloc_opt!(pm::PassManager) =
66
API.LLVMAddAllocOptPass(ref(pm))
@@ -31,3 +31,10 @@ lower_simdloop!(pm::PassManager) =
3131

3232
late_lower_gc_frame!(pm::PassManager) =
3333
API.LLVMAddLateLowerGCFramePass(ref(pm))
34+
35+
if VERSION >= v"1.3.0-DEV.95"
36+
final_lower_gc!(pm::PassManager) =
37+
API.LLVMAddFinalLowerGCPass(ref(pm))
38+
else
39+
final_lower_gc!(pm::PassManager) = nothing
40+
end

test/interop.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ lower_ptls!(pm)
111111
lower_ptls!(pm, true)
112112
lower_simdloop!(pm)
113113
late_lower_gc_frame!(pm)
114+
final_lower_gc!(pm)
114115

115116
end
116117
end

0 commit comments

Comments
 (0)