Adapt to nightly linetable changes#122
Merged
CarloLucibello merged 2 commits intomasterfrom Apr 23, 2024
Merged
Conversation
Member
|
cc97588 to
4ddcd69
Compare
`Core.Compiler.LineInfoNode` was removed in JuliaLang/julia#52415 but kept in `Core` for serializer compatibility reasons (see https://github.com/JuliaLang/julia/blob/e07c0f1ddbfc89ad1ac4dda7246d8ed5d0d57c19/base/boot.jl#L491). Linetable representation in Julia IR has been changed to be more compact. This commit updates IRTools to decode and generate valid debug information according to these changes. Adaptation for IRTools is relatively straightforward in the sense that IRTools operates on untyped IR which does not contains inline statements. However, IRTools contains an inlining pass but it did not account for linetable information previously. In this change, I have made the choice to use the same line for all inlined statements. This can be further improved in the future.
4ddcd69 to
1f0968c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Core.Compiler.LineInfoNodewas removed in JuliaLang/julia#52415 but kept inCorefor serializer compatibility reasons (see https://github.com/JuliaLang/julia/blob/e07c0f1ddbfc89ad1ac4dda7246d8ed5d0d57c19/base/boot.jl#L491).Adaptation for IRTools is relatively straightforward in the sense that IRTools operates on untyped IR which does not contains inlined statements.
However, IRTools contains an inlining pass but it did not account for linetable information previously. In this change, I have made the choice to use the source line for all inlined statements. This can be further improved in the future by supporting stacked debuginfos.
Note
The second commit (cc97588) moves the definition of
LineInfoNodeinsideIRToolsto prevent future breaking changes. But this can create a breakage for people usingIR(lines::Vector{LineInfoNode})constructor so we may not want to include it yet or add conversions.Closes #121