LLVM 22.0.0git
llvm::coverage::accessors Namespace Reference

This namespace defines accessors shared by different versions of coverage mapping records. More...

Functions

template<class FuncRecordTy, llvm::endianness Endian>
uint64_t getFuncHash (const FuncRecordTy *Record)
 Return the structural hash associated with the function.
template<class FuncRecordTy, llvm::endianness Endian>
uint64_t getDataSize (const FuncRecordTy *Record)
 Return the coverage map data size for the function.
template<class FuncRecordTy, llvm::endianness Endian>
uint64_t getFuncNameRef (const FuncRecordTy *Record)
 Return the function lookup key. The value is considered opaque.
template<class FuncRecordTy, llvm::endianness Endian>
Error getFuncNameViaRef (const FuncRecordTy *Record, InstrProfSymtab &ProfileNames, StringRef &FuncName)
 Return the PGO name of the function.
template<class FuncRecordTy, llvm::endianness Endian>
StringRef getCoverageMappingOutOfLine (const FuncRecordTy *Record, const char *MappingBuf)
 Read coverage mapping out-of-line, from MappingBuf.
template<class FuncRecordTy, llvm::endianness Endian>
std::pair< const char *, const FuncRecordTy * > advanceByOneOutOfLine (const FuncRecordTy *Record, const char *MappingBuf)
 Advance to the next out-of-line coverage mapping and its associated function record.

Detailed Description

This namespace defines accessors shared by different versions of coverage mapping records.

Function Documentation

◆ advanceByOneOutOfLine()

template<class FuncRecordTy, llvm::endianness Endian>
std::pair< const char *, const FuncRecordTy * > llvm::coverage::accessors::advanceByOneOutOfLine ( const FuncRecordTy * Record,
const char * MappingBuf )

Advance to the next out-of-line coverage mapping and its associated function record.

Definition at line 1256 of file CoverageMapping.h.

References getDataSize().

◆ getCoverageMappingOutOfLine()

template<class FuncRecordTy, llvm::endianness Endian>
StringRef llvm::coverage::accessors::getCoverageMappingOutOfLine ( const FuncRecordTy * Record,
const char * MappingBuf )

Read coverage mapping out-of-line, from MappingBuf.

This is used when the coverage mapping is attached to the file header, instead of to the function record.

Definition at line 1247 of file CoverageMapping.h.

References getDataSize().

◆ getDataSize()

template<class FuncRecordTy, llvm::endianness Endian>
uint64_t llvm::coverage::accessors::getDataSize ( const FuncRecordTy * Record)

Return the coverage map data size for the function.

Definition at line 1223 of file CoverageMapping.h.

References llvm::support::endian::byte_swap().

Referenced by advanceByOneOutOfLine(), and getCoverageMappingOutOfLine().

◆ getFuncHash()

template<class FuncRecordTy, llvm::endianness Endian>
uint64_t llvm::coverage::accessors::getFuncHash ( const FuncRecordTy * Record)

Return the structural hash associated with the function.

Definition at line 1217 of file CoverageMapping.h.

References llvm::support::endian::byte_swap().

◆ getFuncNameRef()

template<class FuncRecordTy, llvm::endianness Endian>
uint64_t llvm::coverage::accessors::getFuncNameRef ( const FuncRecordTy * Record)

Return the function lookup key. The value is considered opaque.

Definition at line 1229 of file CoverageMapping.h.

References llvm::support::endian::byte_swap().

Referenced by getFuncNameViaRef().

◆ getFuncNameViaRef()

template<class FuncRecordTy, llvm::endianness Endian>
Error llvm::coverage::accessors::getFuncNameViaRef ( const FuncRecordTy * Record,
InstrProfSymtab & ProfileNames,
StringRef & FuncName )

Return the PGO name of the function.

Used for formats in which the name is a hash.

Definition at line 1236 of file CoverageMapping.h.

References getFuncNameRef(), llvm::InstrProfSymtab::getFuncOrVarName(), and llvm::Error::success().