[DebugInfo] Use debug reconstruction block return as variable type#89470
Merged
Conversation
Similarly to the getCompleteVarInfo function in DebugValueInst, this function returns a debug variable with location, scope and type.
Rather than defaulting to the SSA operand type, use getCompleteVarInfo which does this already. Also removes the optional from the VarInfo.
When the vartype isn't allocated in the debug_value instruction, and a debug reconstruction block is added to the instruction, the variable type should default to the debug reconstruction's returned value's type, rather than the SSA's operand's type.
Member
Author
|
@swift-ci smoke test |
Member
Author
|
@swift-ci test windows platform |
adrian-prantl
approved these changes
May 28, 2026
Member
Author
|
@swift-ci test windows platform |
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.
If a debug reconstruction block is added to an existing debug_value which doesn't store the vartype, the vartype would incorrectly change as the operand of the debug_value changes.
The vartype fallback should be the debug reconstruction return instruction value type when it exists, rather than the SSA operand's type.
Should mostly be NFC as no emitted debug reconstruction block currently change the operand type.