Skip to content

Commit a99b50c

Browse files
committed
refine types
1 parent 00f2553 commit a99b50c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/tapedfunction.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,11 @@ end
267267

268268
## Translation: CodeInfo -> Tape
269269

270+
const IRVar = Union{Core.SSAValue, Core.SlotNumber}
271+
270272
struct TempBindings
271273
data::Bindings
272-
book::Dict{Any, Int}
274+
book::Dict{IRVar, Int}
273275
end
274276

275277
function bind_var!(var_literal, tbind::TempBindings, ir::Core.CodeInfo)
@@ -311,7 +313,7 @@ end
311313

312314
function translate!(tape::RawTape, ir::Core.CodeInfo)
313315
bindings = Bindings()
314-
bcache = Dict{Any, Int}()
316+
bcache = Dict{IRVar, Int}()
315317
tbind = TempBindings(bindings, bcache)
316318
slots = Dict{Int, Int}()
317319

@@ -327,8 +329,6 @@ function translate!(tape::RawTape, ir::Core.CodeInfo)
327329
return (bindings, slots, tape)
328330
end
329331

330-
const IRVar = Union{Core.SSAValue, Core.SlotNumber}
331-
332332
function _const_instruction(var::IRVar, v, tbind::TempBindings, ir)
333333
if isa(var, Core.SSAValue)
334334
box = bind_var!(var, tbind, ir)

0 commit comments

Comments
 (0)