Skip to content

Commit e302fc5

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. llvm-svn: 339193
1 parent ffa9d2e commit e302fc5

File tree

3 files changed

+1
-23
lines changed

3 files changed

+1
-23
lines changed

llvm/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;

llvm/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();

llvm/tools/llvm-cov/CodeCoverage.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -368,12 +368,6 @@ std::unique_ptr<CoverageMapping> CodeCoverageTool::load() {
368368
<< "No profile record found for '" << HashMismatch.first << "'"
369369
<< " with hash = 0x" << Twine::utohexstr(HashMismatch.second)
370370
<< '\n';
371-
372-
for (const auto &CounterMismatch : Coverage->getCounterMismatches())
373-
errs() << "counter-mismatch: "
374-
<< "Coverage mapping for " << CounterMismatch.first
375-
<< " only has " << CounterMismatch.second
376-
<< " valid counter expressions\n";
377371
}
378372
}
379373

0 commit comments

Comments
 (0)