Skip to content

Commit 5b3a846

Browse files
authored
Merge pull request #107 from JuliaDiff/use-VarState
updates to work on Julia master
2 parents 0a121ea + 7c79ff6 commit 5b3a846

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/stage1/recurse.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,16 @@ Base.getindex(urs::Core.Compiler.UseRef, args...) = Core.Compiler.getindex(urs,
246246
Base.getindex(c::Core.Compiler.IncrementalCompact, args...) = Core.Compiler.getindex(c, args...)
247247
Base.setindex!(c::Core.Compiler.IncrementalCompact, args...) = Core.Compiler.setindex!(c, args...)
248248
Base.setindex!(urs::Core.Compiler.UseRef, args...) = Core.Compiler.setindex!(urs, args...)
249+
250+
VERSION >= v"1.10.0-DEV.552" && import Core.Compiler: VarState
251+
function sptypes(sparams)
252+
return if VERSION>=v"1.10.0-DEV.552"
253+
VarState[Core.Compiler.VarState.(sparams, false)...]
254+
else
255+
Any[sparams...]
256+
end
257+
end
258+
249259
function transform!(ci, meth, nargs, sparams, N)
250260
code = ci.code
251261
cfg = compute_basic_blocks(code)
@@ -257,7 +267,7 @@ function transform!(ci, meth, nargs, sparams, N)
257267
ir = IRCode(Core.Compiler.InstructionStream(code, Any[],
258268
Any[nothing for i = 1:length(code)],
259269
ci.codelocs, UInt8[0 for i = 1:length(code)]), cfg, Core.LineInfoNode[ci.linetable...],
260-
Any[Any for i = 1:2], meta, Any[sparams...])
270+
Any[Any for i = 1:2], meta, sptypes(sparams))
261271

262272
# SSA conversion
263273
domtree = construct_domtree(ir.cfg.blocks)

0 commit comments

Comments
 (0)