diff --git a/Compiler/src/Compiler.jl b/Compiler/src/Compiler.jl index cdc3be1b4f5f9..376721da46783 100644 --- a/Compiler/src/Compiler.jl +++ b/Compiler/src/Compiler.jl @@ -180,12 +180,12 @@ include("optimize.jl") include("bootstrap.jl") include("reflection_interface.jl") -if isdefined(Base, :end_base_include) - @eval module IRShow - using ..Compiler: Compiler - # During bootstrap, Base will later include this into its own "IRShow module" - Compiler.include(IRShow, "ssair/show.jl") - end +module IRShow end +if !isdefined(Base, :end_base_include) + # During bootstrap, skip including this file and defer it to base/show.jl to include later +else + # When this module is loaded as the standard library, include this file as usual + include(IRShow, "ssair/show.jl") end end # baremodule Compiler diff --git a/Compiler/src/ssair/show.jl b/Compiler/src/ssair/show.jl index 22394c84eb2f7..b9ed220d59453 100644 --- a/Compiler/src/ssair/show.jl +++ b/Compiler/src/ssair/show.jl @@ -1,7 +1,8 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license -# This file is not loaded into `Core.Compiler` but rather loaded into the context of -# `Base.IRShow` and thus does not participate in bootstrapping. +# This file does not participate in bootstrapping, but is included in the system image by +# being loaded from `base/show.jl`. Compiler.jl as the standard library will simply include +# this file in the context of `Compiler.IRShow`. using Base, Core.IR diff --git a/base/show.jl b/base/show.jl index 6fa3f0cf8c454..e6c2367e438b3 100644 --- a/base/show.jl +++ b/base/show.jl @@ -2821,10 +2821,8 @@ function show(io::IO, vm::Core.TypeofVararg) end end -module IRShow - using ..Compiler: Compiler - Base.include(IRShow, Base.strcat(Base.BUILDROOT, "../usr/share/julia/Compiler/src/ssair/show.jl")) -end +Compiler.include(Compiler.IRShow, "ssair/show.jl") # define `show` for the compiler types +const IRShow = Compiler.IRShow # an alias for compatibility function show(io::IO, src::CodeInfo; debuginfo::Symbol=:source) # Fix slot names and types in function body