Skip to content

Commit 5d6bcc1

Browse files
authored
Merge pull request #155 from maleadt/vc/finallowergc
Add wrapper for final_lower_gc pass
2 parents 1b7ca62 + 587bdb1 commit 5d6bcc1

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ os:
77
julia:
88
- 1.0
99
- 1.1
10+
- 1.2
11+
- 1.3
1012
- nightly
1113

1214
notifications:

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)