@@ -86,7 +86,6 @@ mutable struct Frame
8686 edges:: Vector{Any}
8787 stmts:: Vector{Vector{Variable}}
8888 rettype:: AType
89- outer:: Bool
9089end
9190
9291getblock (fr:: Frame , b, follow) =
@@ -96,7 +95,7 @@ getblock(fr::Frame, b, follow) =
9695# TODO clear up inlined edges
9796uninline! (fr:: Frame , b, follow) = deleteat! (fr. inlined[b], follow+ 1 : length (fr. inlined[b]))
9897
99- Frame (ir:: IR ; outer = false ) = Frame (ir, [IR[] for _ = 1 : length (blocks (ir))], [], keys .(blocks (ir)), Union{}, outer )
98+ Frame (ir:: IR ) = Frame (ir, [IR[] for _ = 1 : length (blocks (ir))], [], keys .(blocks (ir)), Union{})
10099
101100function frame (ir:: IR , args... )
102101 prepare_ir! (ir)
@@ -201,7 +200,7 @@ function step!(inf::Inference)
201200 error (" Unrecognised expression $(st. expr) " )
202201 end
203202 elseif (brs = openbranches (block); length (brs) == 1 && ! isreturn (brs[1 ])
204- && ! (frame . outer && brs[1 ]. block == length (frame. ir. blocks)))
203+ && ! (brs[1 ]. block == length (frame. ir. blocks)))
205204 inferbranch! (inf, frame, b, f, brs[1 ])
206205 else
207206 for br in brs
@@ -250,19 +249,3 @@ function return_type(ir::IR, args...)
250249 infer! (inf)
251250 return fr. rettype
252251end
253-
254- function inlineable (ir:: IR , inf:: Inference )
255- for (v, st) in ir
256- Ts = exprtype .((ir,), st. expr. args)
257- haskey (inf. frames, Ts) && return (v, Ts)
258- end
259- end
260-
261- function inlineall (ir:: IR , inf:: Inference )
262- while (next = inlineable (ir, inf)) != nothing
263- v, Ts = next
264- subir = inf. frames[Ts]. ir
265- ir = inline (ir, v, subir)
266- end
267- return ir
268- end
0 commit comments