|
LLVM
3.7.0
|
The mapping of profile information to coverage data. More...
#include <CoverageMapping.h>
Public Member Functions | |
| unsigned | getMismatchedCount () |
| The number of functions that couldn't have their profiles mapped. More... | |
| std::vector< StringRef > | getUniqueSourceFiles () const |
| Returns the list of files that are covered. More... | |
| CoverageData | getCoverageForFile (StringRef Filename) |
| Get the coverage for a particular file. More... | |
| iterator_range < FunctionRecordIterator > | getCoveredFunctions () const |
| Gets all of the functions covered by this profile. More... | |
| iterator_range < FunctionRecordIterator > | getCoveredFunctions (StringRef Filename) const |
| Gets all of the functions in a particular file. More... | |
| std::vector< const FunctionRecord * > | getInstantiations (StringRef Filename) |
| Get the list of function instantiations in the file. More... | |
| CoverageData | getCoverageForFunction (const FunctionRecord &Function) |
| Get the coverage for a particular function. More... | |
| CoverageData | getCoverageForExpansion (const ExpansionRecord &Expansion) |
| Get the coverage for an expansion within a coverage set. More... | |
Static Public Member Functions | |
| static ErrorOr < std::unique_ptr < CoverageMapping > > | load (CoverageMappingReader &CoverageReader, IndexedInstrProfReader &ProfileReader) |
| Load the coverage mapping using the given readers. More... | |
| static ErrorOr < std::unique_ptr < CoverageMapping > > | load (StringRef ObjectFilename, StringRef ProfileFilename, StringRef Arch=StringRef()) |
| Load the coverage mapping from the given files. More... | |
The mapping of profile information to coverage data.
This is the main interface to get coverage information, using a profile to fill out execution counts.
Definition at line 398 of file CoverageMapping.h.
| CoverageData CoverageMapping::getCoverageForExpansion | ( | const ExpansionRecord & | Expansion | ) |
Get the coverage for an expansion within a coverage set.
Definition at line 483 of file CoverageMapping.cpp.
References llvm::coverage::FunctionRecord::CountedRegions, llvm::dbgs(), DEBUG, llvm::coverage::ExpansionRecord::FileID, llvm::coverage::FunctionRecord::Filenames, llvm::coverage::ExpansionRecord::Function, isExpansion(), and sortNestedRegions().
| CoverageData CoverageMapping::getCoverageForFile | ( | StringRef | Filename | ) |
Get the coverage for a particular file.
The given filename must be the name as recorded in the coverage information. That is, only names returned from getUniqueSourceFiles will yield a result.
Definition at line 416 of file CoverageMapping.cpp.
References llvm::coverage::FunctionRecord::CountedRegions, llvm::dbgs(), DEBUG, findMainViewFileID(), gatherFileIDs(), isExpansion(), and sortNestedRegions().
| CoverageData CoverageMapping::getCoverageForFunction | ( | const FunctionRecord & | Function | ) |
Get the coverage for a particular function.
Definition at line 461 of file CoverageMapping.cpp.
References llvm::coverage::FunctionRecord::CountedRegions, llvm::dbgs(), DEBUG, llvm::coverage::FunctionRecord::Filenames, findMainViewFileID(), isExpansion(), llvm::coverage::FunctionRecord::Name, and sortNestedRegions().
|
inline |
Gets all of the functions covered by this profile.
Definition at line 432 of file CoverageMapping.h.
References llvm::make_range().
Referenced by getUniqueSourceFiles().
|
inline |
Gets all of the functions in a particular file.
Definition at line 439 of file CoverageMapping.h.
References llvm::make_range().
| std::vector< const FunctionRecord * > CoverageMapping::getInstantiations | ( | StringRef | Filename | ) |
Get the list of function instantiations in the file.
Fucntions that are instantiated more than once, such as C++ template specializations, have distinct coverage records for each instantiation.
Definition at line 441 of file CoverageMapping.cpp.
References findMainViewFileID().
|
inline |
The number of functions that couldn't have their profiles mapped.
This is a count of functions whose profile is out of date or otherwise can't be associated with any coverage information.
Definition at line 419 of file CoverageMapping.h.
| std::vector< StringRef > CoverageMapping::getUniqueSourceFiles | ( | ) | const |
Returns the list of files that are covered.
Definition at line 355 of file CoverageMapping.cpp.
References llvm::coverage::FunctionRecord::Filenames, and getCoveredFunctions().
|
static |
Load the coverage mapping using the given readers.
Definition at line 197 of file CoverageMapping.cpp.
References llvm::coverage::CounterMappingContext::evaluate(), getFuncNameWithoutPrefix(), llvm::IndexedInstrProfReader::getFunctionCounts(), llvm::hash_mismatch, llvm::coverage::CounterMappingContext::setCounts(), and llvm::unknown_function.
Referenced by load().
|
static |
Load the coverage mapping from the given files.
Definition at line 238 of file CoverageMapping.cpp.
References llvm::coverage::BinaryCoverageReader::create(), llvm::IndexedInstrProfReader::create(), llvm::MemoryBuffer::getFileOrSTDIN(), and load().
1.8.6