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:513

Method Overview

  • 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
  • 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)

Methods

CoverageMapping(
    const llvm::coverage::CoverageMapping&)

Declared at: llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h:533

Parameters

const llvm::coverage::CoverageMapping&

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:577

Parameters

const llvm::coverage::ExpansionRecord& Expansion

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:571

Parameters

llvm::StringRef Filename

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:574

Parameters

const llvm::coverage::FunctionRecord& Function

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:580

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:587

Parameters

llvm::StringRef Filename

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:558

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:597

Parameters

llvm::StringRef Filename

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:552

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:564

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:538

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)

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:545

Parameters

ArrayRef<llvm::StringRef> ObjectFilenames
llvm::StringRef ProfileFilename
ArrayRef<llvm::StringRef> Arches = None