Skip to content

Commit

Permalink
Merge pull request #128 from aviatesk/avi/EA
Browse files Browse the repository at this point in the history
make Infiltrator available within `Core.Compiler.EscapeAnalysis`
  • Loading branch information
pfitzseb authored Jan 7, 2025
2 parents db31af9 + 3f0f6bb commit f0ae6b9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Infiltrator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ macro infiltrate(cond = true)
# XXX Dict isn't available in Core.Compiler, so make it available now
Core.eval(Core.Compiler, :(using .Main: Dict))
Core.eval(Core.Compiler, :(setindex!(x::Dict, args...) = Main.setindex!(x, args...)))
elseif @static isdefined(Core.Compiler, :EscapeAnalysis) &&
__module__ === Core.Compiler.EscapeAnalysis && !isdefined(Core.Compiler.EscapeAnalysis, :Dict)
if !isdefined(Core.Compiler, :Dict)
Core.eval(Core.Compiler, :(using .Main: Dict))
Core.eval(Core.Compiler, :(setindex!(x::Dict, args...) = Main.setindex!(x, args...)))
end
Core.eval(Core.Compiler.EscapeAnalysis, :(using .Main: Dict))
Core.eval(Core.Compiler.EscapeAnalysis, :(setindex!(x::Dict, args...) = Main.setindex!(x, args...)))
end
quote
if $(esc(cond))
Expand Down

0 comments on commit f0ae6b9

Please sign in to comment.