Skip to content

[DebugInfo] Use debug reconstruction block return as variable type#89470

Merged
Snowy1803 merged 3 commits into
swiftlang:mainfrom
Snowy1803:debug-bb-default-vartype
May 29, 2026
Merged

[DebugInfo] Use debug reconstruction block return as variable type#89470
Snowy1803 merged 3 commits into
swiftlang:mainfrom
Snowy1803:debug-bb-default-vartype

Conversation

@Snowy1803
Copy link
Copy Markdown
Member

@Snowy1803 Snowy1803 commented May 27, 2026

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.

Snowy1803 added 3 commits May 27, 2026 16:30
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.
@Snowy1803
Copy link
Copy Markdown
Member Author

@swift-ci smoke test

@Snowy1803
Copy link
Copy Markdown
Member Author

@swift-ci test windows platform

@Snowy1803
Copy link
Copy Markdown
Member Author

@swift-ci test windows platform

@Snowy1803 Snowy1803 merged commit 1e5e75e into swiftlang:main May 29, 2026
2 of 3 checks passed
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.

2 participants