diff options
| author | bors <bors@rust-lang.org> | 2025-08-08 05:59:00 +0000 | 
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-08-08 05:59:00 +0000 | 
| commit | 2886b36df4a646dd8d82fb65bf0c9d8d96c1f71a (patch) | |
| tree | 1609159274b26a3f4a74193ec76c62dfe5046b00 /compiler/rustc_llvm/llvm-wrapper | |
| parent | 67d45f49e09cb8f355df2ffae22cfc3d7ee6c278 (diff) | |
| parent | f6283aebcb84c61888c7955a6760e928ecfd2209 (diff) | |
| download | rust-2886b36df4a646dd8d82fb65bf0c9d8d96c1f71a.tar.gz rust-2886b36df4a646dd8d82fb65bf0c9d8d96c1f71a.zip | |
Auto merge of #145077 - Zalathar:rollup-0k4194x, r=Zalathar
Rollup of 19 pull requests Successful merges: - rust-lang/rust#144400 (`tests/ui/issues/`: The Issues Strike Back [3/N]) - rust-lang/rust#144764 ([codegen] assume the tag, not the relative discriminant) - rust-lang/rust#144807 (Streamline config in bootstrap) - rust-lang/rust#144899 (Print CGU reuse statistics in `-Zprint-mono-items`) - rust-lang/rust#144909 (Add new `test::print_merged_doctests_times` used by rustdoc to display more detailed time information) - rust-lang/rust#144912 (Resolver: introduce a conditionally mutable Resolver for (non-)speculative resolution.) - rust-lang/rust#144914 (Add support for `ty::Instance` path shortening in diagnostics) - rust-lang/rust#144931 ([win][arm64ec] Fix msvc-wholearchive for Arm64EC) - rust-lang/rust#144999 (coverage: Remove all unstable support for MC/DC instrumentation) - rust-lang/rust#145009 (A couple small changes for rust-analyzer next-solver work) - rust-lang/rust#145030 (GVN: Do not flatten derefs with ProjectionElem::Index. ) - rust-lang/rust#145042 (stdarch subtree update) - rust-lang/rust#145047 (move `type_check` out of `compute_regions`) - rust-lang/rust#145051 (Prevent name collisions with internal implementation details) - rust-lang/rust#145053 (Add a lot of NLL `known-bug` tests) - rust-lang/rust#145055 (Move metadata symbol export from exported_non_generic_symbols to exported_symbols) - rust-lang/rust#145057 (Clean up some resolved test regressions of const trait removals in std) - rust-lang/rust#145068 (Readd myself to review queue) - rust-lang/rust#145070 (Add minimal `armv7a-vex-v5` tier three target) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper')
| -rw-r--r-- | compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp | 65 | 
1 files changed, 3 insertions, 62 deletions
| diff --git a/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp index 4695de8ea09..22e7c7a160f 100644 --- a/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp @@ -37,28 +37,6 @@ static coverage::Counter fromRust(LLVMRustCounter Counter) { report_fatal_error("Bad LLVMRustCounterKind!"); } -struct LLVMRustMCDCDecisionParameters { - uint32_t BitmapIdx; - uint16_t NumConditions; -}; - -struct LLVMRustMCDCBranchParameters { - int16_t ConditionID; - int16_t ConditionIDs[2]; -}; - -static coverage::mcdc::BranchParameters -fromRust(LLVMRustMCDCBranchParameters Params) { - return coverage::mcdc::BranchParameters( - Params.ConditionID, {Params.ConditionIDs[0], Params.ConditionIDs[1]}); -} - -static coverage::mcdc::DecisionParameters -fromRust(LLVMRustMCDCDecisionParameters Params) { - return coverage::mcdc::DecisionParameters(Params.BitmapIdx, - Params.NumConditions); -} - // Must match the layout of // `rustc_codegen_llvm::coverageinfo::ffi::CoverageSpan`. struct LLVMRustCoverageSpan { @@ -90,22 +68,6 @@ struct LLVMRustCoverageBranchRegion { LLVMRustCounter FalseCount; }; -// Must match the layout of -// `rustc_codegen_llvm::coverageinfo::ffi::MCDCBranchRegion`. -struct LLVMRustCoverageMCDCBranchRegion { - LLVMRustCoverageSpan Span; - LLVMRustCounter TrueCount; - LLVMRustCounter FalseCount; - LLVMRustMCDCBranchParameters MCDCBranchParams; -}; - -// Must match the layout of -// `rustc_codegen_llvm::coverageinfo::ffi::MCDCDecisionRegion`. -struct LLVMRustCoverageMCDCDecisionRegion { - LLVMRustCoverageSpan Span; - LLVMRustMCDCDecisionParameters MCDCDecisionParams; -}; - // FFI equivalent of enum `llvm::coverage::CounterExpression::ExprKind` // https://github.com/rust-lang/llvm-project/blob/ea6fa9c2/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h#L154 enum class LLVMRustCounterExprKind { @@ -159,10 +121,7 @@ extern "C" void LLVMRustCoverageWriteFunctionMappingsToBuffer( const LLVMRustCoverageExpansionRegion *ExpansionRegions, size_t NumExpansionRegions, const LLVMRustCoverageBranchRegion *BranchRegions, size_t NumBranchRegions, - const LLVMRustCoverageMCDCBranchRegion *MCDCBranchRegions, - size_t NumMCDCBranchRegions, - const LLVMRustCoverageMCDCDecisionRegion *MCDCDecisionRegions, - size_t NumMCDCDecisionRegions, RustStringRef BufferOut) { + RustStringRef BufferOut) { // Convert from FFI representation to LLVM representation. // Expressions: @@ -176,8 +135,8 @@ extern "C" void LLVMRustCoverageWriteFunctionMappingsToBuffer( } std::vector<coverage::CounterMappingRegion> MappingRegions; - MappingRegions.reserve(NumCodeRegions + NumBranchRegions + - NumMCDCBranchRegions + NumMCDCDecisionRegions); + MappingRegions.reserve(NumCodeRegions + NumExpansionRegions + + NumBranchRegions); // Code regions: for (const auto &Region : ArrayRef(CodeRegions, NumCodeRegions)) { @@ -201,24 +160,6 @@ extern "C" void LLVMRustCoverageWriteFunctionMappingsToBuffer( Region.Span.LineEnd, Region.Span.ColumnEnd)); } - // MC/DC branch regions: - for (const auto &Region : ArrayRef(MCDCBranchRegions, NumMCDCBranchRegions)) { - MappingRegions.push_back(coverage::CounterMappingRegion::makeBranchRegion( - fromRust(Region.TrueCount), fromRust(Region.FalseCount), - Region.Span.FileID, Region.Span.LineStart, Region.Span.ColumnStart, - Region.Span.LineEnd, Region.Span.ColumnEnd, - fromRust(Region.MCDCBranchParams))); - } - - // MC/DC decision regions: - for (const auto &Region : - ArrayRef(MCDCDecisionRegions, NumMCDCDecisionRegions)) { - MappingRegions.push_back(coverage::CounterMappingRegion::makeDecisionRegion( - fromRust(Region.MCDCDecisionParams), Region.Span.FileID, - Region.Span.LineStart, Region.Span.ColumnStart, Region.Span.LineEnd, - Region.Span.ColumnEnd)); - } - // Write the converted expressions and mappings to a byte buffer. auto CoverageMappingWriter = coverage::CoverageMappingWriter( ArrayRef<unsigned>(VirtualFileMappingIDs, NumVirtualFileMappingIDs), | 
