Skip to content

Commit 5830a94

Browse files
authored
Adjust to upcoming julia#54341 (#292)
The feature check is done using julia#53849 (which is itself a bit of an experiment), so the idea is to merge/tag this before the base PR is merged to prevent breakage on julia master.
1 parent a8224dd commit 5830a94

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

src/codegen/reverse.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,17 @@ function diffract_ir!(ir, ci, meth, sparams::Core.SimpleVector, nargs::Int, N::I
111111
if nc % 2 == 1
112112
opaque_ci.slotnames = Symbol[Symbol("#self#"), ]
113113
opaque_ci.slotflags = UInt8[0, 0]
114+
if isdefined(Base, :__has_internal_change) && Base.__has_internal_change(v"1.12-alpha", :codeinfonargs)
115+
opaque_ci.nargs = 2
116+
opaque_ci.isva = false
117+
end
114118
else
115119
opaque_ci.slotnames = [Symbol("#oc#"), ci.slotnames...]
116120
opaque_ci.slotflags = UInt8[0, ci.slotflags...]
121+
if isdefined(Base, :__has_internal_change) && Base.__has_internal_change(v"1.12-alpha", :codeinfonargs)
122+
opaque_ci.nargs = 1 + ci.nargs
123+
opaque_ci.isva = ci.isva
124+
end
117125
end
118126
@static if VERSION v"1.12.0-DEV.173"
119127
opaque_ci.debuginfo = ci.debuginfo

src/stage1/recurse.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,5 +314,10 @@ function optic_transform!(ci::CodeInfo, mi::MethodInstance, nargs::Int, N::Int)
314314
ci.method_for_inference_limit_heuristics = meth
315315
ci.edges = MethodInstance[mi]
316316

317+
if isdefined(Base, :__has_internal_change) && Base.__has_internal_change(v"1.12-alpha", :codeinfonargs)
318+
ci.nargs = 2
319+
ci.isva = true
320+
end
321+
317322
return ci
318323
end

src/stage1/recurse_fwd.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,11 @@ function fwd_transform!(ci::CodeInfo, mi::MethodInstance, nargs::Int, N::Int, E)
210210
ci.method_for_inference_limit_heuristics = meth
211211
ci.edges = MethodInstance[mi]
212212

213+
if isdefined(Base, :__has_internal_change) && Base.__has_internal_change(v"1.12-alpha", :codeinfonargs)
214+
ci.nargs = 2
215+
ci.isva = true
216+
end
217+
213218
return ci
214219
end
215220

0 commit comments

Comments
 (0)