Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split show_ir so line printer can be used elsewhere #35952

Merged
merged 1 commit into from
May 26, 2020
Merged

Conversation

timholy
Copy link
Member

@timholy timholy commented May 20, 2020

JuliaInterpreter & Debugger need to print just a subset of CodeInfo statements (those surrounding the current program counter). Currently they print the whole thing to an IOBuffer, split the lines, and keep just a subset. Unfortunately, because some statements print over multiple lines, it's easy to get misaligned.

This makes it possible to call the standard printer for a specified line.

Compared to the previous implementation, this does do a little bit of redundant work on each statement (recomputation of max_bb_idx_size and maxlength_idx), but that's <100ns of work so I don't think it's that big a deal. Alternatively I could add them as arguments.

Currently JuliaInterpreter & Debugger need to print just a subset
of CodeInfo statements (those surrounding the current program counter).
Currently they print the whole thing to an IOBuffer, split the lines,
and keep just a subset. Unfortunately, because some statements
print over multiple lines, it's easy to get misaligned.

This makes it possible to call the standard printer for a specified line.
@timholy
Copy link
Member Author

timholy commented May 22, 2020

You can see a preview of some of the kinds of display that are possible at https://juliadebug.github.io/LoweredCodeUtils.jl/previews/PR30/edges/.

Since this seems fairly noninvasive, and I've written it into the docs for an important Revise update (one that will improve experience for all of Julia 1.x, not just 1.6), I plan to merge this soon.

@timholy timholy merged commit c379364 into master May 26, 2020
@timholy timholy deleted the teh/show_ir_stmt branch May 26, 2020 09:09
simeonschaub pushed a commit to simeonschaub/julia that referenced this pull request Aug 11, 2020
Currently JuliaInterpreter & Debugger need to print just a subset
of CodeInfo statements (those surrounding the current program counter).
Currently they print the whole thing to an IOBuffer, split the lines,
and keep just a subset. Unfortunately, because some statements
print over multiple lines, it's easy to get misaligned.

This makes it possible to call the standard printer for a specified line.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant