Skip to content

Commit

Permalink
add :import/:using/:export heads to VALID_EXPR_HEADS (#52906)
Browse files Browse the repository at this point in the history
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

2 comments on commit b058146

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package evaluation job you requested has completed - possible new issues were detected.
The full report is available.

Please sign in to comment.