LLVM 20.0.0git
|
The mapping of profile information to coverage data. More...
#include "llvm/ProfileData/Coverage/CoverageMapping.h"
Public Member Functions | |
CoverageMapping (const CoverageMapping &)=delete | |
CoverageMapping & | operator= (const CoverageMapping &)=delete |
unsigned | getMismatchedCount () const |
The number of functions that couldn't have their profiles mapped. | |
ArrayRef< std::pair< std::string, uint64_t > > | getHashMismatches () const |
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. | |
std::vector< StringRef > | getUniqueSourceFiles () const |
Returns a lexicographically sorted, unique list of files that are covered. | |
CoverageData | getCoverageForFile (StringRef Filename) const |
Get the coverage for a particular file. | |
CoverageData | getCoverageForFunction (const FunctionRecord &Function) const |
Get the coverage for a particular function. | |
CoverageData | getCoverageForExpansion (const ExpansionRecord &Expansion) const |
Get the coverage for an expansion within a coverage set. | |
iterator_range< FunctionRecordIterator > | getCoveredFunctions () const |
Gets all of the functions covered by this profile. | |
iterator_range< FunctionRecordIterator > | getCoveredFunctions (StringRef Filename) const |
Gets all of the functions in a particular file. | |
std::vector< InstantiationGroup > | getInstantiationGroups (StringRef Filename) const |
Get the list of function instantiation groups in a particular file. | |
Static Public Member Functions | |
static Expected< std::unique_ptr< CoverageMapping > > | load (ArrayRef< std::unique_ptr< CoverageMappingReader > > CoverageReaders, IndexedInstrProfReader &ProfileReader) |
Load the coverage mapping using the given readers. | |
static Expected< std::unique_ptr< CoverageMapping > > | load (ArrayRef< StringRef > ObjectFilenames, StringRef ProfileFilename, vfs::FileSystem &FS, ArrayRef< StringRef > Arches={}, StringRef CompilationDir="", const object::BuildIDFetcher *BIDFetcher=nullptr, bool CheckBinaryIDs=false) |
Load the coverage mapping from the given object files and profile. | |
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 932 of file CoverageMapping.h.
|
delete |
CoverageData CoverageMapping::getCoverageForExpansion | ( | const ExpansionRecord & | Expansion | ) | const |
Get the coverage for an expansion within a coverage set.
Definition at line 1485 of file CoverageMapping.cpp.
References llvm::dbgs(), Expansion, isExpansion(), and LLVM_DEBUG.
CoverageData CoverageMapping::getCoverageForFile | ( | StringRef | Filename | ) | const |
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 1395 of file CoverageMapping.cpp.
References llvm::dbgs(), findMainViewFileID(), gatherFileIDs(), isExpansion(), and LLVM_DEBUG.
CoverageData CoverageMapping::getCoverageForFunction | ( | const FunctionRecord & | Function | ) | const |
Get the coverage for a particular function.
Definition at line 1455 of file CoverageMapping.cpp.
References llvm::dbgs(), findMainViewFileID(), isExpansion(), and LLVM_DEBUG.
|
inline |
Gets all of the functions covered by this profile.
Definition at line 1014 of file CoverageMapping.h.
References llvm::make_range().
|
inline |
Gets all of the functions in a particular file.
Definition at line 1021 of file CoverageMapping.h.
References llvm::make_range().
|
inline |
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 returns a list of hash mismatches, where each mismatch is a pair of the symbol name and its coverage mapping hash.
Definition at line 992 of file CoverageMapping.h.
std::vector< InstantiationGroup > CoverageMapping::getInstantiationGroups | ( | StringRef | Filename | ) | const |
Get the list of function instantiation groups in a particular file.
Every instantiation group in a program is attributed to exactly one file: the file in which the definition for the common function begins.
Definition at line 1430 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 986 of file CoverageMapping.h.
std::vector< StringRef > CoverageMapping::getUniqueSourceFiles | ( | ) | const |
Returns a lexicographically sorted, unique list of files that are covered.
Definition at line 1348 of file CoverageMapping.cpp.
References llvm::append_range(), llvm::Last, llvm::sort(), and llvm::unique().
|
static |
Load the coverage mapping using the given readers.
Definition at line 948 of file CoverageMapping.cpp.
|
static |
Load the coverage mapping from the given object files and profile.
If Arches
is non-empty, it must specify an architecture for each object. Ignores non-instrumented object files unless all are not instrumented.
Definition at line 1005 of file CoverageMapping.cpp.
References A, B, llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::ArrayRef< T >::begin(), llvm::IndexedInstrProfReader::create(), llvm::createFileError(), llvm::createStringError(), llvm::ArrayRef< T >::empty(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::ArrayRef< T >::end(), llvm::enumerate(), llvm::object::BuildIDFetcher::fetch(), llvm::ArrayRef< T >::front(), Idx, llvm::coverage::no_data_found, llvm::no_such_file_or_directory, llvm::IndexedInstrProfReader::readBinaryIds(), llvm::ArrayRef< T >::size(), and llvm::sort().
|
delete |