rust-lang / rust-lang/rust

Consider using AssignmentTracking / dbg_assign

Open
#139,623 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-debuginfo A-LLVM C-enhancement T-compiler
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.