Consider using AssignmentTracking / dbg_assign
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
LLVM 16 introduced a new dbg_assign mechanism for representing debug info, that promises more accurate results, see:
https://llvm.org/docs/AssignmentTracking.html
https://discourse.llvm.org/t/rfc-assignment-tracking-a-better-way-of-specifying-variable-locations-in-ir/62367
If I understand correctly, this can be enabled by scheduling an additional pass, without having to change the debug emission in the frontend: https://github.com/llvm/llvm-project/blob/7d32d72f10445657f598cbdf1bb5f3040373daf5/clang/lib/CodeGen/BackendUtil.cpp#L937-L947
We should consider whether we want to make use of this. Clang uses it for optimized, non-LTO builds by default.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with LLVM's AssignmentTracking documentation and the linked Clang BackendUtil.cpp section around pass scheduling. Compare how Clang enables dbg_assign for optimized non-LTO builds with Rust's compiler pipeline. Done means reaching and documenting a concrete decision on whether and how Rust should adopt the mechanism.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100