Permalink
Browse files

[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)
  • Loading branch information...
vedantk committed Aug 7, 2018
1 parent 1918290 commit bfa6887bd5f0037a9ff5f7b2bf5bf195c42fc78a
@@ -510,7 +510,6 @@ class CoverageMapping {
DenseMap<size_t, DenseSet<size_t>> RecordProvenance;
std::vector<FunctionRecord> Functions;
std::vector<std::pair<std::string, uint64_t>> FuncHashMismatches;
std::vector<std::pair<std::string, uint64_t>> FuncCounterMismatches;
CoverageMapping() = default;
@@ -537,9 +536,7 @@ class CoverageMapping {
///
/// This is a count of functions whose profile is out of date or otherwise
/// can't be associated with any coverage information.
unsigned getMismatchedCount() const {
return FuncHashMismatches.size() + FuncCounterMismatches.size();
}
unsigned getMismatchedCount() const { return FuncHashMismatches.size(); }
/// A hash mismatch occurs when a profile record for a symbol does not have
/// the same hash as a coverage mapping record for the same symbol. This
@@ -549,14 +546,6 @@ class CoverageMapping {
return FuncHashMismatches;
}
/// A counter mismatch occurs when there is an error when evaluating the
/// counter expressions in a coverage mapping record. This returns a list of
/// counter mismatches, where each mismatch is a pair of the symbol name and
/// the number of valid evaluated counter expressions.
ArrayRef<std::pair<std::string, uint64_t>> getCounterMismatches() const {
return FuncCounterMismatches;
}
/// Returns a lexicographically sorted, unique list of files that are
/// covered.
std::vector<StringRef> getUniqueSourceFiles() const;
@@ -242,11 +242,6 @@ Error CoverageMapping::loadFunctionRecord(
}
Function.pushRegion(Region, *ExecutionCount);
}
if (Function.CountedRegions.size() != Record.MappingRegions.size()) {
FuncCounterMismatches.emplace_back(Record.FunctionName,
Function.CountedRegions.size());
return Error::success();
}
// Don't create records for (filenames, function) pairs we've already seen.
auto FilenamesHash = hash_combine_range(Record.Filenames.begin(),
@@ -368,12 +368,6 @@ std::unique_ptr<CoverageMapping> CodeCoverageTool::load() {
<< "No profile record found for '" << HashMismatch.first << "'"
<< " with hash = 0x" << Twine::utohexstr(HashMismatch.second)
<< '\n';
for (const auto &CounterMismatch : Coverage->getCounterMismatches())
errs() << "counter-mismatch: "
<< "Coverage mapping for " << CounterMismatch.first
<< " only has " << CounterMismatch.second
<< " valid counter expressions\n";
}
}

0 comments on commit bfa6887

Please sign in to comment.