class CoverageMapping
Declaration
class CoverageMapping { /* full declaration omitted */ };
Description
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.
Declared at: llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h:570
Member Variables
- private DenseMap<size_t, DenseSet<size_t>> RecordProvenance
- private std::vector<FunctionRecord> Functions
- private DenseMap<size_t, SmallVector<unsigned int, 0>> FilenameHash2RecordIndices
- private std::vector<std::pair<std::string, uint64_t>> FuncHashMismatches
Method Overview
- private CoverageMapping()
- public CoverageMapping(const llvm::coverage::CoverageMapping &)
- public llvm::coverage::CoverageData getCoverageForExpansion(const llvm::coverage::ExpansionRecord & Expansion) const
- public llvm::coverage::CoverageData getCoverageForFile(llvm::StringRef Filename) const
- public llvm::coverage::CoverageData getCoverageForFunction(const llvm::coverage::FunctionRecord & Function) const
- public iterator_range<llvm::coverage::FunctionRecordIterator> getCoveredFunctions() const
- public iterator_range<llvm::coverage::FunctionRecordIterator> getCoveredFunctions(llvm::StringRef Filename) const
- public ArrayRef<std::pair<std::string, uint64_t>> getHashMismatches() const
- private ArrayRef<unsigned int> getImpreciseRecordIndicesForFilename(llvm::StringRef Filename) const
- public std::vector<InstantiationGroup> getInstantiationGroups(llvm::StringRef Filename) const
- public unsigned int getMismatchedCount() const
- public std::vector<StringRef> getUniqueSourceFiles() const
- public static Expected<std::unique_ptr<CoverageMapping>> load(ArrayRef<std::unique_ptr<CoverageMappingReader>> CoverageReaders, llvm::IndexedInstrProfReader & ProfileReader)
- public static Expected<std::unique_ptr<CoverageMapping>> load(ArrayRef<llvm::StringRef> ObjectFilenames, llvm::StringRef ProfileFilename, ArrayRef<llvm::StringRef> Arches = None, llvm::StringRef CompilationDir = "")
- private static llvm::Error loadFromReaders(ArrayRef<std::unique_ptr<CoverageMappingReader>> CoverageReaders, llvm::IndexedInstrProfReader & ProfileReader, llvm::coverage::CoverageMapping & Coverage)
- private llvm::Error loadFunctionRecord(const llvm::coverage::CoverageMappingRecord & Record, llvm::IndexedInstrProfReader & ProfileReader)
Methods
¶CoverageMapping()
CoverageMapping()
Declared at: llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h:576
¶CoverageMapping(
const llvm::coverage::CoverageMapping&)
CoverageMapping(
const llvm::coverage::CoverageMapping&)
Declared at: llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h:595
Parameters
¶llvm::coverage::CoverageData
getCoverageForExpansion(
const llvm::coverage::ExpansionRecord&
Expansion) const
llvm::coverage::CoverageData
getCoverageForExpansion(
const llvm::coverage::ExpansionRecord&
Expansion) const
Description
Get the coverage for an expansion within a coverage set.
Declared at: llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h:639
Parameters
- const llvm::coverage::ExpansionRecord& Expansion
¶llvm::coverage::CoverageData getCoverageForFile(
llvm::StringRef Filename) const
llvm::coverage::CoverageData getCoverageForFile(
llvm::StringRef Filename) const
Description
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.
Declared at: llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h:633
Parameters
- llvm::StringRef Filename
¶llvm::coverage::CoverageData
getCoverageForFunction(
const llvm::coverage::FunctionRecord&
Function) const
llvm::coverage::CoverageData
getCoverageForFunction(
const llvm::coverage::FunctionRecord&
Function) const
Description
Get the coverage for a particular function.
Declared at: llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h:636
Parameters
- const llvm::coverage::FunctionRecord& Function
¶iterator_range<
llvm::coverage::FunctionRecordIterator>
getCoveredFunctions() const
iterator_range<
llvm::coverage::FunctionRecordIterator>
getCoveredFunctions() const
Description
Gets all of the functions covered by this profile.
Declared at: llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h:642
¶iterator_range<
llvm::coverage::FunctionRecordIterator>
getCoveredFunctions(
llvm::StringRef Filename) const
iterator_range<
llvm::coverage::FunctionRecordIterator>
getCoveredFunctions(
llvm::StringRef Filename) const
Description
Gets all of the functions in a particular file.
Declared at: llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h:649
Parameters
- llvm::StringRef Filename
¶ArrayRef<std::pair<std::string, uint64_t>>
getHashMismatches() const
ArrayRef<std::pair<std::string, uint64_t>>
getHashMismatches() const
Description
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.
Declared at: llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h:620
¶ArrayRef<unsigned int>
getImpreciseRecordIndicesForFilename(
llvm::StringRef Filename) const
ArrayRef<unsigned int>
getImpreciseRecordIndicesForFilename(
llvm::StringRef Filename) const
Description
Look up the indices for function records which are at least partially defined in the specified file. This is guaranteed to return a superset of such records: extra records not in the file may be included if there is a hash collision on the filename. Clients must be robust to collisions.
Declared at: llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h:592
Parameters
- llvm::StringRef Filename
¶std::vector<InstantiationGroup>
getInstantiationGroups(
llvm::StringRef Filename) const
std::vector<InstantiationGroup>
getInstantiationGroups(
llvm::StringRef Filename) const
Description
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.
Declared at: llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h:659
Parameters
- llvm::StringRef Filename
¶unsigned int getMismatchedCount() const
unsigned int getMismatchedCount() const
Description
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.
Declared at: llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h:614
¶std::vector<StringRef> getUniqueSourceFiles()
const
std::vector<StringRef> getUniqueSourceFiles()
const
Description
Returns a lexicographically sorted, unique list of files that are covered.
Declared at: llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h:626
¶static Expected<std::unique_ptr<CoverageMapping>>
load(ArrayRef<std::unique_ptr<
CoverageMappingReader>> CoverageReaders,
llvm::IndexedInstrProfReader& ProfileReader)
static Expected<std::unique_ptr<CoverageMapping>>
load(ArrayRef<std::unique_ptr<
CoverageMappingReader>> CoverageReaders,
llvm::IndexedInstrProfReader& ProfileReader)
Description
Load the coverage mapping using the given readers.
Declared at: llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h:600
Parameters
- ArrayRef<std::unique_ptr<CoverageMappingReader>> CoverageReaders
- llvm::IndexedInstrProfReader& ProfileReader
¶static Expected<std::unique_ptr<CoverageMapping>>
load(ArrayRef<llvm::StringRef> ObjectFilenames,
llvm::StringRef ProfileFilename,
ArrayRef<llvm::StringRef> Arches = None,
llvm::StringRef CompilationDir = "")
static Expected<std::unique_ptr<CoverageMapping>>
load(ArrayRef<llvm::StringRef> ObjectFilenames,
llvm::StringRef ProfileFilename,
ArrayRef<llvm::StringRef> Arches = None,
llvm::StringRef CompilationDir = "")
Description
Load the coverage mapping from the given object files and profile. If\p Arches is non-empty, it must specify an architecture for each object. Ignores non-instrumented object files unless all are not instrumented.
Declared at: llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h:607
Parameters
- ArrayRef<llvm::StringRef> ObjectFilenames
- llvm::StringRef ProfileFilename
- ArrayRef<llvm::StringRef> Arches = None
- llvm::StringRef CompilationDir = ""
¶static llvm::Error loadFromReaders(
ArrayRef<std::unique_ptr<
CoverageMappingReader>> CoverageReaders,
llvm::IndexedInstrProfReader& ProfileReader,
llvm::coverage::CoverageMapping& Coverage)
static llvm::Error loadFromReaders(
ArrayRef<std::unique_ptr<
CoverageMappingReader>> CoverageReaders,
llvm::IndexedInstrProfReader& ProfileReader,
llvm::coverage::CoverageMapping& Coverage)
Declared at: llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h:579
Parameters
- ArrayRef<std::unique_ptr<CoverageMappingReader>> CoverageReaders
- llvm::IndexedInstrProfReader& ProfileReader
- llvm::coverage::CoverageMapping& Coverage
¶llvm::Error loadFunctionRecord(
const llvm::coverage::CoverageMappingRecord&
Record,
llvm::IndexedInstrProfReader& ProfileReader)
llvm::Error loadFunctionRecord(
const llvm::coverage::CoverageMappingRecord&
Record,
llvm::IndexedInstrProfReader& ProfileReader)
Description
Add a function record corresponding to \p Record.
Declared at: llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h:584
Parameters
- const llvm::coverage::CoverageMappingRecord& Record
- llvm::IndexedInstrProfReader& ProfileReader