rust/compiler/rustc_codegen_llvm/src
Matthias Krüger b95232dabb
Rollup merge of #132675 - Zalathar:empty-spans, r=jieyouxu
coverage: Restrict empty-span expansion to only cover `{` and `}`

Coverage instrumentation has some tricky code for converting a coverage-relevant `Span` into a set of start/end line/byte-column coordinates that will be embedded in the CGU's coverage metadata.

A big part of this complexity is special code for handling empty spans, which are expanded into non-empty spans (if possible) because LLVM's coverage reporter does not handle empty spans well.

This PR simplifies that code by restricting it to only apply in two specific situations: when the character after the empty span is `{`, or the character before the empty span is `}`.

(As an added benefit, this means that the expanded spans no longer extend awkwardly beyond the end of a physical line, which was common under the previous implementation.)

Along the way, this PR also removes some unhelpful code for dealing with function source code spread across multiple files. Functions currently can't have coverage spans in multiple files, and if that ever changes (e.g. to properly support expansion regions) then this code will need to be completely overhauled anyway.
2024-11-10 17:43:07 +01:00
..
back Reduce dependence on the target name 2024-11-03 18:29:01 +00:00
coverageinfo Rollup merge of #132675 - Zalathar:empty-spans, r=jieyouxu 2024-11-10 17:43:07 +01:00
debuginfo Add discriminators to DILocations when multiple functions are inlined into a single point. 2024-11-09 08:01:31 -08:00
llvm Add discriminators to DILocations when multiple functions are inlined into a single point. 2024-11-09 08:01:31 -08: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 Basic inline assembly support for SPARC and SPARC64 2024-11-07 21:19:03 +09:00
attributes.rs Rollup merge of #132259 - mrkajetanp:branch-protection-pauth-lr, r=davidtwco 2024-11-05 20:10:49 +01:00
base.rs Consistently use safe wrapper function set_section 2024-10-30 11:38:20 +11:00
builder.rs compiler: Directly use rustc_abi in codegen 2024-11-03 12:30:32 -08:00
callee.rs Rollup merge of #130586 - dpaoliello:fixrawdylib, r=wesleywiser 2024-11-07 18:48:20 -08:00
common.rs Clean up FFI calls for operand bundles 2024-10-30 13:26:24 +11:00
consts.rs Rollup merge of #130586 - dpaoliello:fixrawdylib, r=wesleywiser 2024-11-07 18:48:20 -08:00
context.rs remove the extra specification for llvm versions < 20 2024-11-07 20:59:50 +01: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 compiler: Directly use rustc_abi in codegen 2024-11-03 12:30:32 -08:00
lib.rs Simplify FFI calls for -Ztime-llvm-passes and -Zprint-codegen-stats 2024-11-04 20:31:16 +11:00
llvm_util.rs Add v8plus target feature to sparc and use it in create_object_file 2024-11-09 03:22:09 +09:00
mono_item.rs Use safe wrappers get_visibility and set_visibility 2024-10-26 20:20:20 +11:00
type_.rs compiler: Directly use rustc_abi in codegen 2024-11-03 12:30:32 -08:00
type_of.rs compiler: rustc_abi::Abi => BackendRepr 2024-10-29 14:56:00 -07:00
va_arg.rs compiler: Directly use rustc_abi in codegen 2024-11-03 12:30:32 -08:00
value.rs Add warn(unreachable_pub) to rustc_codegen_llvm. 2024-08-16 08:46:57 +10:00