mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-11 08:29:25 +00:00
llvm-cov: Sink some reporting logic into CoverageMapping
This teaches CoverageMapping::getCoveredFunctions to filter to a particular file and uses that to replace most of the logic found in llvm-cov report. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221962 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -170,6 +170,14 @@ ErrorOr<int64_t> CounterMappingContext::evaluate(const Counter &C) const {
|
||||
llvm_unreachable("Unhandled CounterKind");
|
||||
}
|
||||
|
||||
void FunctionRecordIterator::skipOtherFiles() {
|
||||
while (Current != Records.end() && !Filename.empty() &&
|
||||
Filename != Current->Filenames[0])
|
||||
++Current;
|
||||
if (Current == Records.end())
|
||||
*this = FunctionRecordIterator();
|
||||
}
|
||||
|
||||
ErrorOr<std::unique_ptr<CoverageMapping>>
|
||||
CoverageMapping::load(ObjectFileCoverageMappingReader &CoverageReader,
|
||||
IndexedInstrProfReader &ProfileReader) {
|
||||
@@ -320,7 +328,7 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
std::vector<StringRef> CoverageMapping::getUniqueSourceFiles() {
|
||||
std::vector<StringRef> CoverageMapping::getUniqueSourceFiles() const {
|
||||
std::vector<StringRef> Filenames;
|
||||
for (const auto &Function : getCoveredFunctions())
|
||||
for (const auto &Filename : Function.Filenames)
|
||||
|
Reference in New Issue
Block a user