Skip to content

Commit 1a519c7

Browse files
authored
EA: remove _TOP_MOD and just use Base (JuliaLang#56581)
The reason we originally used `_TOP_MOD` was to make it possible to load `EscapeAnalysis.jl` from the `Main` context while developing EA. However, now that the Compiler stdlib allows the same thing to be done for the entire `Compiler` module including `EscapeAnalysis`, the trick on the EA side is no longer necessary.
1 parent 79b9393 commit 1a519c7

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

src/ssair/EscapeAnalysis.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,32 @@ export
1010
has_thrown_escape,
1111
has_all_escape
1212

13-
const _TOP_MOD = ccall(:jl_base_relative_to, Any, (Any,), EscapeAnalysis)::Module
13+
using Base: Base
1414

1515
# imports
16-
import ._TOP_MOD: ==, getindex, setindex!
16+
import Base: ==, getindex, setindex!
1717
# usings
1818
using Core: MethodMatch, SimpleVector, ifelse, sizeof
1919
using Core.IR
20-
using ._TOP_MOD: # Base definitions
21-
@__MODULE__, @assert, @eval, @goto, @inbounds, @inline, @label, @noinline, @show,
20+
using Base: # Base definitions
21+
@__MODULE__, @assert, @eval, @goto, @inbounds, @inline, @label, @noinline,
2222
@nospecialize, @specialize, BitSet, Callable, Csize_t, IdDict, IdSet, UnitRange, Vector,
2323
copy, delete!, empty!, enumerate, error, first, get, get!, haskey, in, isassigned,
2424
isempty, ismutabletype, keys, last, length, max, min, missing, pop!, push!, pushfirst!,
2525
unwrap_unionall, !, !=, !==, &, *, +, -, :, <, <<, =>, >, |, , , , , , , , ,
2626
hasintersect
27-
using ..Compiler: # Core.Compiler specific definitions
27+
using ..Compiler: # Compiler specific definitions
2828
AbstractLattice, Bottom, IRCode, IR_FLAG_NOTHROW, InferenceResult, SimpleInferenceLattice,
2929
argextype, fieldcount_noerror, hasintersect, has_flag, intrinsic_nothrow,
3030
is_meta_expr_head, is_identity_free_argtype, isexpr, println, setfield!_nothrow,
3131
singleton_type, try_compute_field, try_compute_fieldidx, widenconst, , Compiler
3232

33-
function include(x)
34-
if !isdefined(_TOP_MOD.Base, :end_base_include)
33+
function include(x::String)
34+
if !isdefined(Base, :end_base_include)
3535
# During bootstrap, all includes are relative to `base/`
3636
x = ccall(:jl_prepend_string, Ref{String}, (Any, Any), "ssair/", x)
3737
end
38-
_TOP_MOD.include(@__MODULE__, x)
38+
Compiler.include(@__MODULE__, x)
3939
end
4040

4141
include("disjoint_set.jl")

src/ssair/disjoint_set.jl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,9 @@
33
# under the MIT license: https://github.com/JuliaCollections/DataStructures.jl/blob/master/License.md
44

55
# imports
6-
import ._TOP_MOD:
7-
length,
8-
eltype,
9-
union!,
10-
push!
6+
import Base: length, eltype, union!, push!
117
# usings
12-
import ._TOP_MOD:
13-
OneTo, collect, zero, zeros, one, typemax
8+
import Base: OneTo, collect, zero, zeros, one, typemax
149

1510
# Disjoint-Set
1611

@@ -27,7 +22,8 @@ import ._TOP_MOD:
2722
#
2823
############################################################
2924

30-
_intdisjointset_bounds_err_msg(T) = "the maximum number of elements in IntDisjointSet{$T} is $(typemax(T))"
25+
_intdisjointset_bounds_err_msg(@nospecialize T) =
26+
"the maximum number of elements in IntDisjointSet{$T} is $(typemax(T))"
3127

3228
"""
3329
IntDisjointSet{T<:Integer}(n::Integer)

0 commit comments

Comments
 (0)