Repository navigation
Add multi-value debug location infrastructure - #1083
Merged
nihalpasham merged 1 commit intoAug 20, 2026
Merged
Conversation
Signed-off-by: Raul Estrada <[email protected]>
Collaborator
|
nihalpasham
approved these changes
Aug 20, 2026
This was referenced Sep 16, 2026
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.
Closes #1082
Part of #226
Summary
Add generic multi-value debug-location support to the MIR-to-LLVM debug pipeline.
This provides the infrastructure needed for source-variable locations that depend on more than one runtime SSA value, such as a future runtime-indexed projection:
Changes
add
mir.dbg_value_listfor ordered multi-value debug operandslower it to a new
llvm.dbg_value_listmarkeradd a typed
DebugValueExpressionrepresentationpreserve debug expressions through MIR-to-LLVM lowering
export multi-value locations through
llvm.dbg.valueusingDIArgListsupport:
DW_OP_LLVM_argDW_OP_constuDW_OP_plusDW_OP_plus_uconstDW_OP_mulDW_OP_derefDW_OP_stack_valuevalidate
DW_OP_LLVM_argoperand indices during exportadd lowering coverage for operand ordering and expression preservation
add LLVM-export coverage for
DIArgListparse the emitted debug module with
llvm-asFor example, the expression:
is represented as:
with the base and index values carried in the corresponding
DIArgList.Why
Existing projected debug locations use static byte offsets. That is sufficient for fields and constant indices, but not for runtime-dependent projections.
A dynamic array index requires both the base address and the runtime index to remain available to the debugger. LLVM's
DIArgListplusDW_OP_LLVM_argmodel provides the required representation without materializing a synthetic address computation in executable IR.Non-goals
This PR only introduces the generic multi-value location machinery.
It does not yet translate
ProjectionElem::Indexfrom rustc MIR. That will be implemented as a follow-up using this infrastructure.It also does not change existing single-value
dbg.valuebehavior or migrate the exporter to LLVM debug records.Validation
Validated locally with:
The new multi-value debug test also passes the generated LLVM module through an available
llvm-as-22,llvm-as-21, orllvm-asparser.All validation passed.