[llvm] r339193 - [Coverage] Delete getCounterMismatches, it's dead code (NFC)
Vedant Kumar via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 7 15:25:22 PDT 2018
Author: vedantk
Date: Tue Aug 7 15:25:22 2018
New Revision: 339193
URL: http://llvm.org/viewvc/llvm-project?rev=339193&view=rev
Log:
[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.
Modified:
llvm/trunk/include/llvm/ProfileData/Coverage/CoverageMapping.h
llvm/trunk/lib/ProfileData/Coverage/CoverageMapping.cpp
llvm/trunk/tools/llvm-cov/CodeCoverage.cpp
Modified: llvm/trunk/include/llvm/ProfileData/Coverage/CoverageMapping.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/Coverage/CoverageMapping.h?rev=339193&r1=339192&r2=339193&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ProfileData/Coverage/CoverageMapping.h (original)
+++ llvm/trunk/include/llvm/ProfileData/Coverage/CoverageMapping.h Tue Aug 7 15:25:22 2018
@@ -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 @@ public:
///
/// 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 @@ public:
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;
Modified: llvm/trunk/lib/ProfileData/Coverage/CoverageMapping.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/Coverage/CoverageMapping.cpp?rev=339193&r1=339192&r2=339193&view=diff
==============================================================================
--- llvm/trunk/lib/ProfileData/Coverage/CoverageMapping.cpp (original)
+++ llvm/trunk/lib/ProfileData/Coverage/CoverageMapping.cpp Tue Aug 7 15:25:22 2018
@@ -239,11 +239,6 @@ Error CoverageMapping::loadFunctionRecor
}
Function.pushRegion(Region, *ExecutionCount);
}
- if (Function.CountedRegions.size() != Record.MappingRegions.size()) {
- FuncCounterMismatches.emplace_back(Record.FunctionName,
- Function.CountedRegions.size());
- return Error::success();
- }
Functions.push_back(std::move(Function));
return Error::success();
Modified: llvm/trunk/tools/llvm-cov/CodeCoverage.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cov/CodeCoverage.cpp?rev=339193&r1=339192&r2=339193&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-cov/CodeCoverage.cpp (original)
+++ llvm/trunk/tools/llvm-cov/CodeCoverage.cpp Tue Aug 7 15:25:22 2018
@@ -368,12 +368,6 @@ std::unique_ptr<CoverageMapping> CodeCov
<< "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";
}
}
More information about the llvm-commits
mailing list