Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit abac5d4

Browse files
committed
[Coverage] Delete getCounterMismatches, it's dead code (NFC)
Exactly one counted region is inserted into a function record for every region in a coverage mapping. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339193 91177308-0d34-0410-b5e6-96231b3b80d8 (cherry picked from commit 4d56d49)
1 parent 90e92d9 commit abac5d4

File tree

3 files changed

+1
-23
lines changed

3 files changed

+1
-23
lines changed

include/llvm/ProfileData/Coverage/CoverageMapping.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,6 @@ class CoverageMapping {
510510
DenseMap<size_t, DenseSet<size_t>> RecordProvenance;
511511
std::vector<FunctionRecord> Functions;
512512
std::vector<std::pair<std::string, uint64_t>> FuncHashMismatches;
513-
std::vector<std::pair<std::string, uint64_t>> FuncCounterMismatches;
514513

515514
CoverageMapping() = default;
516515

@@ -537,9 +536,7 @@ class CoverageMapping {
537536
///
538537
/// This is a count of functions whose profile is out of date or otherwise
539538
/// can't be associated with any coverage information.
540-
unsigned getMismatchedCount() const {
541-
return FuncHashMismatches.size() + FuncCounterMismatches.size();
542-
}
539+
unsigned getMismatchedCount() const { return FuncHashMismatches.size(); }
543540

544541
/// A hash mismatch occurs when a profile record for a symbol does not have
545542
/// the same hash as a coverage mapping record for the same symbol. This
@@ -549,14 +546,6 @@ class CoverageMapping {
549546
return FuncHashMismatches;
550547
}
551548

552-
/// A counter mismatch occurs when there is an error when evaluating the
553-
/// counter expressions in a coverage mapping record. This returns a list of
554-
/// counter mismatches, where each mismatch is a pair of the symbol name and
555-
/// the number of valid evaluated counter expressions.
556-
ArrayRef<std::pair<std::string, uint64_t>> getCounterMismatches() const {
557-
return FuncCounterMismatches;
558-
}
559-
560549
/// Returns a lexicographically sorted, unique list of files that are
561550
/// covered.
562551
std::vector<StringRef> getUniqueSourceFiles() const;

lib/ProfileData/Coverage/CoverageMapping.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,6 @@ Error CoverageMapping::loadFunctionRecord(
239239
}
240240
Function.pushRegion(Region, *ExecutionCount);
241241
}
242-
if (Function.CountedRegions.size() != Record.MappingRegions.size()) {
243-
FuncCounterMismatches.emplace_back(Record.FunctionName,
244-
Function.CountedRegions.size());
245-
return Error::success();
246-
}
247242

248243
Functions.push_back(std::move(Function));
249244
return Error::success();

tools/llvm-cov/CodeCoverage.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -362,12 +362,6 @@ std::unique_ptr<CoverageMapping> CodeCoverageTool::load() {
362362
<< "No profile record found for '" << HashMismatch.first << "'"
363363
<< " with hash = 0x" << Twine::utohexstr(HashMismatch.second)
364364
<< '\n';
365-
366-
for (const auto &CounterMismatch : Coverage->getCounterMismatches())
367-
errs() << "counter-mismatch: "
368-
<< "Coverage mapping for " << CounterMismatch.first
369-
<< " only has " << CounterMismatch.second
370-
<< " valid counter expressions\n";
371365
}
372366
}
373367

0 commit comments

Comments
 (0)