about summary refs log tree commit diff
path: root/src/librustc_codegen_utils/codegen_backend.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-02-03 13:06:44 +0000
committerbors <bors@rust-lang.org>2020-02-03 13:06:44 +0000
commitbdd946df3a7af6be0c075d5ab15f9845b3679364 (patch)
tree9d9f2aa1e2d3ffa53f1986753eee97e8823c7553 /src/librustc_codegen_utils/codegen_backend.rs
parentc58e09f138075ce6b3079f41f9c2f192a15b896c (diff)
parente35dfad5b8cfe12555c6b7459c75d4b78280bfb2 (diff)
downloadrust-bdd946df3a7af6be0c075d5ab15f9845b3679364.tar.gz
rust-bdd946df3a7af6be0c075d5ab15f9845b3679364.zip
Auto merge of #68665 - eddyb:debuginfo-early-create-var, r=nagisa
codegen: create DIVariables ahead of using them with llvm.dbg.declare.

Instead of having `rustc_codegen_llvm` bundle creation of a `DIVariable` and `llvm.dbg.declare` into a single operation, they are now two separate methods, and the `DIVariable` is created earlier, specifically when `mir::VarDebugInfo`s are being partitioned into locals.

While this isn't currently needed, it's a prerequisite for #48300, which adds fragmented debuginfo, where one `mir::VarDebugInfo` has multiple parts of itself mapped to different `mir::Place`s.
For debuggers to see one composite variable instead of several ones with the same name, we need to create a single `DIVariable` and share it between multiple `llvm.dbg.declare` calls, which are likely pointing to different MIR locals.
That makes the `per_local_var_debug_info` partitioning a good spot to do this in, as we can create *exactly* one `DIVariable` per `mir::VarDebugInfo`, and refer to it as many things as needed.

I'm opening this PR separately because I want to test its perf impact in isolation (see https://github.com/rust-lang/rust/pull/48300#issuecomment-580121438).

r? @nagisa or @oli-obk cc @michaelwoerister @nikomatsakis
Diffstat (limited to 'src/librustc_codegen_utils/codegen_backend.rs')
0 files changed, 0 insertions, 0 deletions