You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support debuginfo context option in IRShow for IRCode/IncrementalCompact (#58642)
This allows us to get complete source information during printing for
`IRCode` and `IncrementalCompact`, same as we do by default with
`CodeInfo`.
The user previously had to do:
```julia
Compiler.IRShow.show_ir(stdout, ir, Compiler.IRShow.default_config(ir; verbose_linetable=true))
```
and now, they only need to do:
```julia
show(IOContext(stdout, :debuginfo => :source), ir)
```
src.debuginfo = Core.DebugInfo(src.debuginfo.def) # IRCode printing defaults to incomplete line info printing, so turn it off completely for CodeInfo too
2221
2225
let source_slotnames = String["my_fun28173", "x"],
@@ -2245,18 +2249,16 @@ let src = code_typed(my_fun28173, (Int,), debuginfo=:source)[1][1]
2245
2249
@testpop!(lines2) =="18 │ \$(QuoteNode(3))"
2246
2250
@test lines1 == lines2
2247
2251
2248
-
# verbose linetable
2249
-
io =IOBuffer()
2250
-
Base.IRShow.show_ir(io, ir, Base.IRShow.default_config(ir; verbose_linetable=true))
2251
-
seekstart(io)
2252
-
@testcount(contains(r"@ a{80}:\d+ within `my_fun28173"), eachline(io)) ==10
2252
+
# debuginfo = :source
2253
+
output =sprint(Base.IRShow.show_ir, ir, Base.IRShow.default_config(ir; debuginfo=:source))
2254
+
@testcount(contains(r"@ a{80}:\d+ within `my_fun28173"), split(output, '\n')) ==10
0 commit comments