rust/compiler/rustc_codegen_llvm/src
Matthias Krüger 57cbd078f2
Rollup merge of #134497 - Zalathar:spans, r=jieyouxu
coverage: Store coverage source regions as `Span` until codegen (take 2)

This is an attempt to re-land #133418:

> Historically, coverage spans were converted into line/column coordinates during the MIR instrumentation pass.

> This PR moves that conversion step into codegen, so that coverage spans spend most of their time stored as Span instead.

> In addition to being conceptually nicer, this also reduces the size of coverage mappings in MIR, because Span is smaller than 4x u32.

That PR was reverted by #133608, because in some circumstances not covered by our test suite we were emitting coverage metadata that was causing `llvm-cov` to exit with an error (#133606).

---

The implementation here is *mostly* the same, but adapted for subsequent changes in the relevant code (e.g. #134163).

I believe that the changes in #134163 should be sufficient to prevent the problem that required the original PR to be reverted. But I haven't been able to reproduce the original breakage in a regression test, and the `llvm-cov` error message is extremely unhelpful, so I can't completely rule out the possibility of this breaking again.

r? jieyouxu (reviewer of the original PR)
2024-12-19 15:26:16 +01:00
..
back Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
coverageinfo coverage: Add a synthetic test for when all spans are discarded 2024-12-19 22:03:43 +11:00
debuginfo fix outdated comment 2024-12-18 11:01:54 +01:00
llvm Fix our llvm::Bool typedef to be signed, to match LLVMBool 2024-12-12 20:54:33 +11:00
abi.rs compiler: Directly use rustc_abi in codegen 2024-11-03 12:30:32 -08:00
allocator.rs Clean up FFI calls for operand bundles 2024-10-30 13:26:24 +11:00
asm.rs Auto merge of #129181 - beetrees:asm-spans, r=pnkfelix,compiler-errors 2024-12-12 02:34:06 +00:00
attributes.rs rename rustc_attr to rustc_attr_parsing and create rustc_attr_data_structures 2024-12-16 19:08:19 +01:00
base.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
builder.rs use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
callee.rs rename rustc_attr to rustc_attr_parsing and create rustc_attr_data_structures 2024-12-16 19:08:19 +01:00
common.rs Remove polymorphization 2024-12-06 16:42:09 -05:00
consts.rs Rollup merge of #127483 - BertalanD:no_sanitize-global-var, r=rcvalle 2024-11-23 20:19:51 +08:00
context.rs wasm(32|64): update alignment string 2024-12-11 05:52:59 -05:00
declare.rs Use a type-safe helper to cast &str and &[u8] to *const c_char 2024-10-28 21:31:32 +11:00
errors.rs mark some target features as 'forbidden' so they cannot be (un)set 2024-11-04 22:56:47 +01:00
intrinsic.rs Remove unnecessary int_type_width_signed function 2024-12-07 19:01:00 -08:00
lib.rs coverage: Store coverage source regions as Span until codegen 2024-12-19 18:09:09 +11:00
llvm_util.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
mono_item.rs use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
type_.rs compiler: Directly use rustc_abi in codegen 2024-11-03 12:30:32 -08:00
type_of.rs make no-variant types a dedicated Variants variant 2024-12-18 11:01:54 +01:00
va_arg.rs Teach rust core about Xtensa VaListImpl and add a custom lowering of vaarg for xtensa. 2024-12-03 10:54:08 +00:00
value.rs Add warn(unreachable_pub) to rustc_codegen_llvm. 2024-08-16 08:46:57 +10:00