Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion Compiler/src/Compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,26 @@ include("bootstrap.jl")
include("reflection_interface.jl")
include("opaque_closure.jl")

macro __SOURCE_FILE__()
__source__.file === nothing && return nothing
return __source__.file::Symbol
end

module IRShow end
function load_irshow!()
if isdefined(Base, :end_base_include)
# This code path is exclusively for Revise, which may want to re-run this
# after bootstrap.
include(IRShow, Base.joinpath(Base.dirname(Base.String(@__SOURCE_FILE__)), "ssair/show.jl"))
else
include(IRShow, "ssair/show.jl")
end
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")
load_irshow!()
end

end # baremodule Compiler
Expand Down
2 changes: 1 addition & 1 deletion base/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2821,7 +2821,7 @@ function show(io::IO, vm::Core.TypeofVararg)
end
end

Compiler.include(Compiler.IRShow, "ssair/show.jl") # define `show` for the compiler types
Compiler.load_irshow!()
const IRShow = Compiler.IRShow # an alias for compatibility

function show(io::IO, src::CodeInfo; debuginfo::Symbol=:source)
Expand Down
Loading