Skip to content

Commit 7d2efca

Browse files
committed
:global no longer valid_ir_argument; rm is_defined_nothrow_global
JuliaLang/julia#56746. Also call :slot and :static_parameter valid (for now)
1 parent b1c0b09 commit 7d2efca

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
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

src/runtime.jl

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -375,16 +375,6 @@ function is_defined_and_owned_global(mod, name)
375375
!isnothing(b) && isdefined(b, :owner) && b.owner === b
376376
end
377377

378-
# Return true if `name` is defined in `mod`, the sense that accessing it is nothrow.
379-
# Has no side effects, unlike isdefined()
380-
#
381-
# (This should do what fl_nothrow_julia_global does for flisp lowering)
382-
function is_defined_nothrow_global(mod, name)
383-
b = _get_module_binding(mod, name)
384-
!isnothing(b) && isdefined(b, :owner) || return false
385-
isdefined(b.owner, :value)
386-
end
387-
388378
# "Reserve" a binding: create the binding if it doesn't exist but do not assign
389379
# to it.
390380
function reserve_module_binding(mod, name)

0 commit comments

Comments
 (0)