diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2024-11-10 11:53:04 +1100 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2024-11-10 11:58:44 +1100 |
| commit | 925dfc8608e1906e0fc51518f9b0cf40f22a5618 (patch) | |
| tree | 4f02e9e3552a803057b19ebc221f445cd3161d41 /compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs | |
| parent | 3c30fe3423b1e7d92584436493bd8fa6f17e13d0 (diff) | |
| download | rust-925dfc8608e1906e0fc51518f9b0cf40f22a5618.tar.gz rust-925dfc8608e1906e0fc51518f9b0cf40f22a5618.zip | |
coverage: Pass a `LocalFileId` to `CoverageSpan::from_source_region`
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs b/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs index 488ce620746..e008e2ad450 100644 --- a/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs +++ b/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs @@ -210,7 +210,7 @@ rustc_index::newtype_index! { /// An index into a function's list of global file IDs. That underlying list /// of local-to-global mappings will be embedded in the function's record in /// the `__llvm_covfun` linker section. - struct LocalFileId {} + pub(crate) struct LocalFileId {} } /// Holds a mapping from "local" (per-function) file IDs to "global" (per-CGU) @@ -280,7 +280,7 @@ fn encode_mappings_for_function( // form suitable for FFI. for (mapping_kind, region) in counter_regions { debug!("Adding counter {mapping_kind:?} to map for {region:?}"); - let span = ffi::CoverageSpan::from_source_region(local_file_id.as_u32(), region); + let span = ffi::CoverageSpan::from_source_region(local_file_id, region); match mapping_kind { MappingKind::Code(term) => { code_regions.push(ffi::CodeRegion { span, counter: ffi::Counter::from_term(term) }); |
