Skip to content

Commit

Permalink
add :import/:using/:export heads to VALID_EXPR_HEADS (JuliaLa…
Browse files Browse the repository at this point in the history
…ng#52906)

Typically, top-level thunks that include these exprs aren't compiled.
However, in certain `AbstractInterpreter`s such as JET, there's a need
to perform inference on arbitrary top-level thunks for analysis
purposes. So this commit updates the IR validator so that it does not
raise errors on these exprs.
  • Loading branch information
aviatesk authored Jan 16, 2024
1 parent d479660 commit b058146
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion base/compiler/validation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ const VALID_EXPR_HEADS = IdDict{Symbol,UnitRange{Int}}(
:throw_undef_if_not => 2:2,
:aliasscope => 0:0,
:popaliasscope => 0:0,
:new_opaque_closure => 4:typemax(Int)
:new_opaque_closure => 4:typemax(Int),
:import => 1:typemax(Int),
:using => 1:typemax(Int),
:export => 1:typemax(Int),
)

# @enum isn't defined yet, otherwise I'd use it for this
Expand Down

0 comments on commit b058146

Please sign in to comment.