LLVM
8.0.1
|
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. More... | |
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. More... | |
std::vector< StringRef > | getUniqueSourceFiles () const |
Returns a lexicographically sorted, unique list of files that are covered. More... | |
CoverageData | getCoverageForFile (StringRef Filename) const |
Get the coverage for a particular file. More... | |
CoverageData | getCoverageForFunction (const FunctionRecord &Function) const |
Get the coverage for a particular function. More... | |
CoverageData | getCoverageForExpansion (const ExpansionRecord &Expansion) const |
Get the coverage for an expansion within a coverage set. 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< InstantiationGroup > | getInstantiationGroups (StringRef Filename) const |
Get the list of function instantiation groups in a particular file. More... | |
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. More... | |
static Expected< std::unique_ptr< CoverageMapping > > | load (ArrayRef< StringRef > ObjectFilenames, StringRef ProfileFilename, ArrayRef< StringRef > Arches=None) |
Load the coverage mapping from the given object files and profile. 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 509 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 667 of file CoverageMapping.cpp.
References llvm::coverage::FunctionRecord::CountedRegions, llvm::dbgs(), llvm::coverage::ExpansionRecord::FileID, llvm::coverage::FunctionRecord::Filenames, llvm::coverage::ExpansionRecord::Function, 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 604 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 646 of file CoverageMapping.cpp.
References llvm::coverage::FunctionRecord::CountedRegions, llvm::dbgs(), llvm::coverage::FunctionRecord::Filenames, findMainViewFileID(), isExpansion(), LLVM_DEBUG, and llvm::coverage::FunctionRecord::Name.
|
inline |
Gets all of the functions covered by this profile.
Definition at line 567 of file CoverageMapping.h.
References llvm::make_range().
|
inline |
Gets all of the functions in a particular file.
Definition at line 574 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 545 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 626 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 539 of file CoverageMapping.h.
std::vector< StringRef > CoverageMapping::getUniqueSourceFiles | ( | ) | const |
Returns a lexicographically sorted, unique list of files that are covered.
Definition at line 558 of file CoverageMapping.cpp.
References llvm::Function::begin(), llvm::Function::end(), and llvm::sort().
|
static |
Load the coverage mapping using the given readers.
Definition at line 256 of file CoverageMapping.cpp.
References E.
|
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.
Definition at line 275 of file CoverageMapping.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T >::back(), llvm::sys::path::const_iterator::begin, llvm::sys::path::begin(), llvm::SmallVectorTemplateCommon< T >::begin(), llvm::MutableArrayRef< T >::begin(), llvm::coverage::CounterMappingRegion::CodeRegion, llvm::coverage::FunctionRecord::CountedRegions, llvm::coverage::BinaryCoverageReader::create(), llvm::IndexedInstrProfReader::create(), llvm::dbgs(), E, llvm::SmallVectorBase::empty(), llvm::ArrayRef< T >::empty(), llvm::sys::path::const_iterator::end, llvm::sys::path::end(), llvm::SmallVectorTemplateCommon< T >::end(), llvm::coverage::CounterMappingRegion::endLoc(), llvm::enumerate(), llvm::SmallVectorImpl< T >::erase(), llvm::errorCodeToError(), llvm::coverage::CountedRegion::ExecutionCount, llvm::coverage::CounterMappingRegion::ExpansionRegion, llvm::ARMBuildAttrs::File, llvm::coverage::CounterMappingRegion::GapRegion, llvm::MemoryBuffer::getFileOrSTDIN(), I, llvm::coverage::CounterMappingRegion::Kind, LLVM_DEBUG, llvm::None, llvm::SmallVectorTemplateBase< T >::push_back(), llvm::SmallVectorBase::size(), llvm::ArrayRef< T >::size(), llvm::coverage::CounterMappingRegion::SkippedRegion, llvm::sort(), and llvm::coverage::CounterMappingRegion::startLoc().
|
delete |