1
Fork 0
rust/compiler/rustc_codegen_ssa/src
Matthias Krüger ab505298ea
Rollup merge of #105482 - wesleywiser:fix_debuginfo_ub, r=tmiasko
Fix invalid codegen during debuginfo lowering

In order for LLVM to correctly generate debuginfo for msvc, we sometimes need to spill arguments to the stack and perform some direct & indirect offsets into the value. Previously, this code always performed those actions, even when not required as LLVM would clean it up during optimization.

However, when MIR inlining is enabled, this can cause problems as the operations occur prior to the spilled value being initialized. To solve this, we first calculate the necessary offsets using just the type which is side-effect free and does not alter the LLVM IR. Then, if we are in a situation which requires us to generate the LLVM IR (and this situation only occurs for arguments, not local variables) then we perform the same calculation again, this time generating the appropriate LLVM IR as we go.

r? `@tmiasko` but feel free to reassign if you want 🙂

Fixes #105386
2022-12-10 15:01:45 +01:00
..
back Rollup merge of #105423 - oli-obk:symbols, r=jackh726 2022-12-08 12:57:32 +01:00
coverageinfo Remove in_band_lifetimes from rustc_codegen_ssa 2021-12-15 00:41:41 -05:00
debuginfo Prefer doc comments over //-comments in compiler 2022-11-27 11:19:04 +00:00
mir Rollup merge of #105482 - wesleywiser:fix_debuginfo_ub, r=tmiasko 2022-12-10 15:01:45 +01:00
traits Add LLVM KCFI support to the Rust compiler 2022-12-08 17:24:39 -08:00
base.rs linker: Simplify linking of compiler_builtins and profiler_builtins 2022-11-12 23:02:33 +03:00
common.rs Simplify cast_shift_expr_rhs. 2022-10-25 14:39:20 +11:00
errors.rs Rewrite LLVM's archive writer in Rust 2022-11-26 19:35:32 +00:00
glue.rs add is_sized method on Abi and Layout, and use it 2022-11-13 12:23:53 +01:00
lib.rs Stabilize native library modifier verbatim 2022-11-27 22:36:32 +03:00
meth.rs Call destructors when dyn* object goes out of scope 2022-09-12 16:55:57 -07:00
mono_item.rs Store a LocalDefId in hir::AnonConst. 2022-11-13 14:06:11 +00:00
target_features.rs Allow power10-vector feature in PowerPC 2022-11-22 14:45:56 +08:00