5e842953cc
Don't leave debug locations for constants sitting on the builder indefinitely Because constants are currently emitted *before* the prologue, leaving the debug location on the IRBuilder spills onto other instructions in the prologue and messes up both line numbers as well as the point LLVM chooses to be the prologue end. Example LLVM IR (irrelevant IR elided): Before: ``` define internal { i64, i64 } `@_ZN3tmp3Foo18var_return_opt_try17he02116165b0fc08cE(ptr` align 8 %self) !dbg !347 { start: %self.dbg.spill = alloca [8 x i8], align 8 %_0 = alloca [16 x i8], align 8 %residual.dbg.spill = alloca [0 x i8], align 1 #dbg_declare(ptr %residual.dbg.spill, !353, !DIExpression(), !357) store ptr %self, ptr %self.dbg.spill, align 8, !dbg !357 #dbg_declare(ptr %self.dbg.spill, !350, !DIExpression(), !358) ``` After: ``` define internal { i64, i64 } `@_ZN3tmp3Foo18var_return_opt_try17h00b17d08874ddd90E(ptr` align 8 %self) !dbg !347 { start: %self.dbg.spill = alloca [8 x i8], align 8 %_0 = alloca [16 x i8], align 8 %residual.dbg.spill = alloca [0 x i8], align 1 #dbg_declare(ptr %residual.dbg.spill, !353, !DIExpression(), !357) store ptr %self, ptr %self.dbg.spill, align 8 #dbg_declare(ptr %self.dbg.spill, !350, !DIExpression(), !358) ``` Note in particular how !357 from %residual.dbg.spill's dbg_declare no longer falls through onto the store to %self.dbg.spill. This fixes argument values at entry when the constant is a ZST (e.g. `<Option as Try>::Residual`). This fixes #130003 (but note that it does *not* fix issues with argument values and non-ZST constants, which emit their own stores that have debug info on them, like #128945). r? `@michaelwoerister` |
||
---|---|---|
.. | ||
auxiliary | ||
associated-types.rs | ||
basic-types-globals-metadata.rs | ||
basic-types-globals.rs | ||
basic-types-metadata.rs | ||
basic-types-mut-globals.rs | ||
basic-types.rs | ||
borrowed-basic.rs | ||
borrowed-c-style-enum.rs | ||
borrowed-enum.rs | ||
borrowed-struct.rs | ||
borrowed-tuple.rs | ||
borrowed-unique-basic.rs | ||
box.rs | ||
boxed-struct.rs | ||
by-value-non-immediate-argument.rs | ||
by-value-self-argument-in-trait-impl.rs | ||
c-style-enum-in-composite.rs | ||
c-style-enum.rs | ||
captured-fields-1.rs | ||
captured-fields-2.rs | ||
closure-in-generic-function.rs | ||
collapse-debuginfo-external-attr.rs | ||
collapse-debuginfo-external-flag-overriden-by-attr.rs | ||
collapse-debuginfo-external-flag.rs | ||
collapse-debuginfo-in-non-collapse-macro.rs | ||
collapse-debuginfo-no-attr.rs | ||
collapse-debuginfo-static-external.rs | ||
collapse-debuginfo-static.rs | ||
collapse-debuginfo-with-attr-flag.rs | ||
collapse-debuginfo-with-attr.rs | ||
collapse-debuginfo-with-yes-flag.rs | ||
constant-debug-locs.rs | ||
constant-in-match-pattern.rs | ||
coroutine-locals.rs | ||
coroutine-objects.rs | ||
cross-crate-spans.rs | ||
cross-crate-type-uniquing.rs | ||
destructured-fn-argument.rs | ||
destructured-for-loop-variable.rs | ||
destructured-local.rs | ||
drop-locations.rs | ||
dummy_span.rs | ||
duration-type.rs | ||
embedded-visualizer-point.natvis | ||
embedded-visualizer-point.py | ||
embedded-visualizer.natvis | ||
embedded-visualizer.py | ||
embedded-visualizer.rs | ||
empty-string.rs | ||
enum-thinlto.rs | ||
evec-in-struct.rs | ||
extern-c-fn.rs | ||
f16-natvis.rs | ||
fixed-sized-array.rs | ||
function-arg-initialization.rs | ||
function-arguments.rs | ||
function-call.rs | ||
function-names.rs | ||
function-prologue-stepping-regular.rs | ||
gdb-char.rs | ||
gdb-pretty-struct-and-enums.rs | ||
generic-enum-with-different-disr-sizes.rs | ||
generic-function.rs | ||
generic-functions-nested.rs | ||
generic-method-on-generic-struct.rs | ||
generic-static-method-on-struct-and-enum.rs | ||
generic-struct-style-enum.rs | ||
generic-struct.rs | ||
generic-tuple-style-enum.rs | ||
include_string.rs | ||
issue-7712.rs | ||
issue-12886.rs | ||
issue-13213.rs | ||
issue-14411.rs | ||
issue-22656.rs | ||
issue-57822.rs | ||
lexical-scope-in-for-loop.rs | ||
lexical-scope-in-if-let.rs | ||
lexical-scope-in-if.rs | ||
lexical-scope-in-match.rs | ||
lexical-scope-in-parameterless-closure.rs | ||
lexical-scope-in-stack-closure.rs | ||
lexical-scope-in-unconditional-loop.rs | ||
lexical-scope-in-unique-closure.rs | ||
lexical-scope-in-while.rs | ||
lexical-scope-with-macro.rs | ||
lexical-scopes-in-block-expression.rs | ||
limited-debuginfo.rs | ||
macro-stepping.inc | ||
macro-stepping.rs | ||
marker-types.rs | ||
method-on-enum.rs | ||
method-on-generic-struct.rs | ||
method-on-struct.rs | ||
method-on-trait.rs | ||
method-on-tuple-struct.rs | ||
msvc-pretty-enums.rs | ||
msvc-scalarpair-params.rs | ||
multi-byte-chars.rs | ||
multi-cgu.rs | ||
multiple-functions-equal-var-names.rs | ||
multiple-functions.rs | ||
mutable-locs.rs | ||
mutex.rs | ||
name-shadowing-and-scope-nesting.rs | ||
no_mangle-info.rs | ||
numeric-types.rs | ||
option-like-enum.rs | ||
packed-struct-with-destructor.rs | ||
packed-struct.rs | ||
path.rs | ||
pretty-huge-vec.rs | ||
pretty-slices.rs | ||
pretty-std-collections-hash.rs | ||
pretty-std-collections.rs | ||
pretty-std.rs | ||
pretty-uninitialized-vec.rs | ||
range-types.rs | ||
rc_arc.rs | ||
recursive-enum.rs | ||
recursive-struct.rs | ||
reference-debuginfo.rs | ||
regression-bad-location-list-67992.rs | ||
result-types.rs | ||
rwlock-read.rs | ||
rwlock-write.rs | ||
self-in-default-method.rs | ||
self-in-generic-default-method.rs | ||
shadowed-argument.rs | ||
shadowed-variable.rs | ||
should-fail.rs | ||
simd.rs | ||
simple-lexical-scope.rs | ||
simple-struct.rs | ||
simple-tuple.rs | ||
skip_second_statement_collapse.rs | ||
skip_second_statement.rs | ||
static-method-on-struct-and-enum.rs | ||
step-into-match.rs | ||
strings-and-strs.rs | ||
struct-in-enum.rs | ||
struct-in-struct.rs | ||
struct-namespace.rs | ||
struct-style-enum.rs | ||
struct-with-destructor.rs | ||
text-to-include-1.txt | ||
text-to-include-2.txt | ||
text-to-include-3.txt | ||
thread-names.rs | ||
thread.rs | ||
trait-pointers.rs | ||
tuple-in-struct.rs | ||
tuple-in-tuple.rs | ||
tuple-struct.rs | ||
tuple-style-enum.rs | ||
type-names.cdb.js | ||
type-names.rs | ||
union-smoke.rs | ||
unique-enum.rs | ||
unit-type.rs | ||
unreachable-locals.rs | ||
unsized.rs | ||
var-captured-in-nested-closure.rs | ||
var-captured-in-sendable-closure.rs | ||
var-captured-in-stack-closure.rs | ||
vec-slices.rs | ||
vec.rs | ||
zst-interferes-with-prologue.rs |