Skip to content

Commit 4ea33db

Browse files
mlechuaviatesk
authored andcommitted
Globals are no longer is_valid_ir_argument
JuliaLang/julia#56746. Also call :slot and :static_parameter valid (for now)
1 parent 7f0aa0e commit 4ea33db

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/linear_ir.jl

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,15 @@
33

44
function is_valid_ir_argument(ctx, ex)
55
k = kind(ex)
6-
if is_simple_atom(ctx, ex) || k == K"inert" || k == K"top" || k == K"core"
6+
if is_simple_atom(ctx, ex) || k in KSet"inert top core quote"
77
true
88
elseif k == K"BindingId"
99
binfo = lookup_binding(ctx, ex)
1010
bk = binfo.kind
1111
# TODO: Can we allow bk == :local || bk == :argument || bk == :static_parameter ???
1212
# Why does flisp seem to allow (slot) and (static_parameter), but these
1313
# aren't yet converted to by existing lowering??
14-
if bk == :global
15-
# Globals are nothrow when they are defined - we assume a previously
16-
# defined global can never be set to undefined. (TODO: This could be
17-
# broken when precompiling a module `B` in the presence of a badly
18-
# behaved module `A`, which inconsistently defines globals during
19-
# `A.__init__()`??)
20-
is_defined_nothrow_global(binfo.mod, Symbol(binfo.name))
21-
else
22-
false
23-
end
14+
(bk == :slot || bk == :static_parameter)
2415
else
2516
false
2617
end

0 commit comments

Comments
 (0)