rust/compiler
Kyle Huey 7ed9f945a2 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).
2024-09-06 23:12:18 +00:00
..
rustc disable size asserts in the compiler when randomizing layouts 2024-08-31 23:56:45 +02:00
rustc_abi inhibit layout randomization for Box 2024-08-31 23:56:45 +02:00
rustc_arena
rustc_ast Create opaque definitions in resolver. 2024-08-31 20:14:43 +00:00
rustc_ast_ir
rustc_ast_lowering chore: Fix typos in 'compiler' (batch 1) 2024-09-02 07:42:38 +02:00
rustc_ast_passes Create opaque definitions in resolver. 2024-08-31 20:14:43 +00:00
rustc_ast_pretty
rustc_attr
rustc_baked_icu_data
rustc_borrowck Rollup merge of #129969 - GrigorenkoPV:boxed-ty, r=compiler-errors 2024-09-06 07:33:58 +02:00
rustc_builtin_macros
rustc_codegen_cranelift
rustc_codegen_gcc Don't leave debug locations for constants sitting on the builder indefinitely. 2024-09-06 23:12:18 +00:00
rustc_codegen_llvm Don't leave debug locations for constants sitting on the builder indefinitely. 2024-09-06 23:12:18 +00:00
rustc_codegen_ssa Don't leave debug locations for constants sitting on the builder indefinitely. 2024-09-06 23:12:18 +00:00
rustc_const_eval Make Ty::boxed_ty return an Option 2024-09-06 00:30:36 +03:00
rustc_data_structures Add an internal lint that warns when accessing untracked data 2024-09-03 19:14:19 +02:00
rustc_driver
rustc_driver_impl Rollup merge of #101339 - the8472:ci-randomize-debug, r=Mark-Simulacrum 2024-09-05 03:47:39 +02:00
rustc_error_codes chore: Fix typos in 'compiler' (batch 1) 2024-09-02 07:42:38 +02:00
rustc_error_messages
rustc_errors Rollup merge of #129875 - Sajjon:sajjon_fix_typos_batch_1, r=compiler-errors,jieyouxu 2024-09-02 22:35:20 +02:00
rustc_expand
rustc_feature Rollup merge of #128919 - Nadrieril:lint-query-leaks, r=cjgillot 2024-09-05 19:43:46 +02:00
rustc_fluent_macro
rustc_fs_util
rustc_graphviz
rustc_hir Revert "Auto merge of #127537 - veluca93:struct_tf, r=BoxyUwU" 2024-09-01 16:35:53 +02:00
rustc_hir_analysis Rollup merge of #129664 - adetaylor:arbitrary-self-types-pointers-feature-gate, r=wesleywiser 2024-09-05 03:47:42 +02:00
rustc_hir_pretty
rustc_hir_typeck Rollup merge of #129969 - GrigorenkoPV:boxed-ty, r=compiler-errors 2024-09-06 07:33:58 +02:00
rustc_incremental
rustc_index disable size asserts in the compiler when randomizing layouts 2024-08-31 23:56:45 +02:00
rustc_index_macros
rustc_infer chore: Fix typos in 'compiler' (batch 1) 2024-09-02 07:42:38 +02:00
rustc_interface chore: Fix typos in 'compiler' (batch 1) 2024-09-02 07:42:38 +02:00
rustc_lexer
rustc_lint Rollup merge of #129969 - GrigorenkoPV:boxed-ty, r=compiler-errors 2024-09-06 07:33:58 +02:00
rustc_lint_defs update docs of missing_abi lint 2024-09-04 14:30:56 +02:00
rustc_llvm Rollup merge of #129749 - krasimirgg:llvm-20-lto, r=nikic 2024-08-31 14:46:09 +02:00
rustc_log
rustc_macros
rustc_metadata Make supertrait and implied predicates queries defaulted 2024-09-04 06:28:59 -04:00
rustc_middle Rollup merge of #129969 - GrigorenkoPV:boxed-ty, r=compiler-errors 2024-09-06 07:33:58 +02:00
rustc_mir_build Revert "Auto merge of #127537 - veluca93:struct_tf, r=BoxyUwU" 2024-09-01 16:35:53 +02:00
rustc_mir_dataflow Adjust SanityCheck. 2024-09-03 15:18:30 +10:00
rustc_mir_transform Rollup merge of #130013 - jonathan-conder:await_coverage, r=Zalathar 2024-09-06 07:33:59 +02:00
rustc_monomorphize Make Ty::boxed_ty return an Option 2024-09-06 00:30:36 +03:00
rustc_next_trait_solver do not attempt to prove unknowable goals 2024-09-03 08:35:23 +02:00
rustc_parse chore: Fix typos in 'compiler' (batch 2) 2024-09-02 07:50:22 +02:00
rustc_parse_format
rustc_passes Rollup merge of #128919 - Nadrieril:lint-query-leaks, r=cjgillot 2024-09-05 19:43:46 +02:00
rustc_pattern_analysis Rollup merge of #128934 - Nadrieril:fix-empty-non-exhaustive, r=compiler-errors 2024-09-03 19:13:24 +02:00
rustc_privacy
rustc_query_impl
rustc_query_system chore: Fix typos in 'compiler' (batch 2) 2024-09-02 07:50:22 +02:00
rustc_resolve Rollup merge of #129877 - Sajjon:sajjon_fix_typos_batch_2, r=fee1-dead 2024-09-02 22:35:21 +02:00
rustc_sanitizers Auto merge of #129777 - nnethercote:unreachable_pub-4, r=Urgau 2024-09-03 01:27:20 +00:00
rustc_serialize Auto merge of #129777 - nnethercote:unreachable_pub-4, r=Urgau 2024-09-03 01:27:20 +00:00
rustc_session Auto merge of #129777 - nnethercote:unreachable_pub-4, r=Urgau 2024-09-03 01:27:20 +00:00
rustc_smir Auto merge of #129777 - nnethercote:unreachable_pub-4, r=Urgau 2024-09-03 01:27:20 +00:00
rustc_span Rollup merge of #128919 - Nadrieril:lint-query-leaks, r=cjgillot 2024-09-05 19:43:46 +02:00
rustc_symbol_mangling Auto merge of #129777 - nnethercote:unreachable_pub-4, r=Urgau 2024-09-03 01:27:20 +00:00
rustc_target Rollup merge of #127021 - thesummer:1-add-target-support-for-rtems-arm-xilinx-zedboard, r=tgross35 2024-09-05 03:47:40 +02:00
rustc_trait_selection Rollup merge of #129969 - GrigorenkoPV:boxed-ty, r=compiler-errors 2024-09-06 07:33:58 +02:00
rustc_traits Add warn(unreachable_pub) to rustc_traits. 2024-09-03 08:49:54 +10:00
rustc_transmute Auto merge of #129777 - nnethercote:unreachable_pub-4, r=Urgau 2024-09-03 01:27:20 +00:00
rustc_ty_utils Add warn(unreachable_pub) to rustc_ty_utils. 2024-09-03 08:50:33 +10:00
rustc_type_ir do not attempt to prove unknowable goals 2024-09-03 08:35:23 +02:00
rustc_type_ir_macros
stable_mir chore: Fix typos in 'compiler' (batch 3) 2024-09-02 07:33:41 +02:00