LLVM 22.0.0git
CoverageMapping.h File Reference
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/iterator.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Object/BuildID.h"
#include "llvm/ProfileData/Coverage/MCDCTypes.h"
#include "llvm/ProfileData/InstrProf.h"
#include "llvm/Support/Alignment.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <iterator>
#include <map>
#include <memory>
#include <optional>
#include <sstream>
#include <string>
#include <system_error>
#include <utility>
#include <vector>
#include "llvm/ProfileData/InstrProfData.inc"

Go to the source code of this file.

Classes

class  llvm::coverage::CoverageMapError
struct  llvm::coverage::Counter
 A Counter is an abstract value that describes how to compute the execution count for a region of code using the collected profile count data. More...
struct  llvm::coverage::CounterExpression
 A Counter expression is a value that represents an arithmetic operation with two counters. More...
class  llvm::coverage::CounterExpressionBuilder
 A Counter expression builder is used to construct the counter expressions. More...
struct  llvm::coverage::CounterMappingRegion
 A Counter mapping region associates a source range with a specific counter. More...
struct  llvm::coverage::CountedRegion
 Associates a source range with an execution count. More...
struct  llvm::coverage::MCDCRecord
 MCDC Record grouping all information together. More...
class  llvm::coverage::MCDCRecord::TestVector
 Emulate SmallVector<CondState> with a pair of BitVector. More...
class  llvm::coverage::mcdc::TVIdxBuilder
 Compute TestVector Indices "TVIdx" from the Conds graph. More...
struct  llvm::coverage::mcdc::TVIdxBuilder::MCDCNode
class  llvm::coverage::CounterMappingContext
 A Counter mapping context is used to connect the counters, expressions and the obtained counter values. More...
struct  llvm::coverage::FunctionRecord
 Code coverage information for a single function. More...
class  llvm::coverage::FunctionRecordIterator
 Iterator over Functions, optionally filtered to a single file. More...
struct  llvm::coverage::ExpansionRecord
 Coverage information for a macro expansion or #included file. More...
struct  llvm::coverage::CoverageSegment
 The execution count information starting at a point in a file. More...
class  llvm::coverage::InstantiationGroup
 An instantiation group contains a FunctionRecord list, such that each record corresponds to a distinct instantiation of the same function. More...
class  llvm::coverage::CoverageData
 Coverage information to be processed or displayed. More...
class  llvm::coverage::CoverageMapping
 The mapping of profile information to coverage data. More...
class  llvm::coverage::LineCoverageStats
 Coverage statistics for a single line. More...
class  llvm::coverage::LineCoverageIterator
 An iterator over the LineCoverageStats objects for lines described by a CoverageData instance. More...
struct  llvm::coverage::CovMapFunctionRecordV1< IntPtrT >
struct  llvm::coverage::CovMapFunctionRecordV2
struct  llvm::coverage::CovMapFunctionRecordV3
struct  llvm::coverage::CovMapHeader
struct  llvm::coverage::CovMapTraits< CovMapVersion, IntPtrT >
struct  llvm::coverage::CovMapTraits< CovMapVersion::Version3, IntPtrT >
struct  llvm::coverage::CovMapTraits< CovMapVersion::Version2, IntPtrT >
struct  llvm::coverage::CovMapTraits< CovMapVersion::Version1, IntPtrT >
struct  llvm::DenseMapInfo< coverage::CounterExpression >
 Provide DenseMapInfo for CounterExpression. More...

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
namespace  llvm::object
namespace  llvm::vfs
namespace  llvm::coverage
namespace  llvm::coverage::mcdc
namespace  llvm::coverage::accessors
 This namespace defines accessors shared by different versions of coverage mapping records.

Macros

#define COVMAP_V1
#define COVMAP_FUNC_RECORD(Type, LLVMType, Name, Init)
#define INSTR_PROF_VISIBILITY
#define INSTR_PROF_DATA(Type, LLVMType, Name, Initializer)
#define INSTR_PROF_VTABLE_DATA(Type, LLVMType, Name, Initializer)
#define INSTR_PROF_VALUE_NODE(Type, LLVMType, Name, Initializer)
#define INSTR_PROF_RAW_HEADER(Type, Name, Initializer)
#define VALUE_PROF_FUNC_PARAM(ArgType, ArgName, ArgLLVMType)
#define INSTR_PROF_COMMA
#define VALUE_PROF_KIND(Enumerator, Value, Descr)
#define INSTR_PROF_DATA_DEFINED
#define COVMAP_HEADER(Type, LLVMType, Name, Initializer)
#define COVINIT_FUNC(Type, LLVMType, Name, Initializer)
#define COVMAP_V2
#define COVMAP_FUNC_RECORD(Type, LLVMType, Name, Init)
#define INSTR_PROF_DATA(Type, LLVMType, Name, Initializer)
#define INSTR_PROF_VTABLE_DATA(Type, LLVMType, Name, Initializer)
#define INSTR_PROF_VALUE_NODE(Type, LLVMType, Name, Initializer)
#define INSTR_PROF_RAW_HEADER(Type, Name, Initializer)
#define VALUE_PROF_FUNC_PARAM(ArgType, ArgName, ArgLLVMType)
#define INSTR_PROF_COMMA
#define VALUE_PROF_KIND(Enumerator, Value, Descr)
#define COVMAP_V2_OR_V3
#define INSTR_PROF_DATA_DEFINED
#define COVMAP_HEADER(Type, LLVMType, Name, Initializer)
#define COVINIT_FUNC(Type, LLVMType, Name, Initializer)
#define COVMAP_V3
#define COVMAP_FUNC_RECORD(Type, LLVMType, Name, Init)
#define INSTR_PROF_DATA(Type, LLVMType, Name, Initializer)
#define INSTR_PROF_VTABLE_DATA(Type, LLVMType, Name, Initializer)
#define INSTR_PROF_VALUE_NODE(Type, LLVMType, Name, Initializer)
#define INSTR_PROF_RAW_HEADER(Type, Name, Initializer)
#define VALUE_PROF_FUNC_PARAM(ArgType, ArgName, ArgLLVMType)
#define INSTR_PROF_COMMA
#define VALUE_PROF_KIND(Enumerator, Value, Descr)
#define COVMAP_V2_OR_V3
#define INSTR_PROF_DATA_DEFINED
#define COVMAP_HEADER(Type, LLVMType, Name, Initializer)
#define COVINIT_FUNC(Type, LLVMType, Name, Initializer)
#define COVMAP_HEADER(Type, LLVMType, Name, Init)
#define INSTR_PROF_DATA(Type, LLVMType, Name, Initializer)
#define INSTR_PROF_VTABLE_DATA(Type, LLVMType, Name, Initializer)
#define INSTR_PROF_VALUE_NODE(Type, LLVMType, Name, Initializer)
#define INSTR_PROF_RAW_HEADER(Type, Name, Initializer)
#define VALUE_PROF_FUNC_PARAM(ArgType, ArgName, ArgLLVMType)
#define INSTR_PROF_COMMA
#define VALUE_PROF_KIND(Enumerator, Value, Descr)
#define COVMAP_FUNC_RECORD(Type, LLVMType, Name, Initializer)
#define INSTR_PROF_DATA_DEFINED
#define COVINIT_FUNC(Type, LLVMType, Name, Initializer)

Typedefs

using llvm::coverage::LineColPair = std::pair<unsigned, unsigned>

Enumerations

enum class  llvm::coverage::coveragemap_error {
  llvm::coverage::success = 0 , llvm::coverage::eof , llvm::coverage::no_data_found , llvm::coverage::unsupported_version ,
  llvm::coverage::truncated , llvm::coverage::malformed , llvm::coverage::decompression_failed , llvm::coverage::invalid_or_missing_arch_specifier
}
enum  llvm::coverage::CovMapVersion {
  llvm::coverage::Version1 = 0 , llvm::coverage::Version2 = 1 , llvm::coverage::Version3 = 2 , llvm::coverage::Version4 = 3 ,
  llvm::coverage::Version5 = 4 , llvm::coverage::Version6 = 5 , llvm::coverage::Version7 = 6 , llvm::coverage::CurrentVersion = INSTR_PROF_COVMAP_VERSION
}
enum class  llvm::coverage::TestingFormatVersion : uint64_t { llvm::coverage::Version1 = 0x6174616474736574 , llvm::coverage::Version2 = 1 , llvm::coverage::CurrentVersion = Version2 }

Functions

LLVM_ABI const std::error_category & llvm::coverage::coveragemap_category ()
std::error_code llvm::coverage::make_error_code (coveragemap_error E)
static iterator_range< LineCoverageIteratorllvm::coverage::getLineCoverageStats (const coverage::CoverageData &CD)
 Get a LineCoverageIterator range for the lines described by CD.
template<class FuncRecordTy, llvm::endianness Endian>
uint64_t llvm::coverage::accessors::getFuncHash (const FuncRecordTy *Record)
 Return the structural hash associated with the function.
template<class FuncRecordTy, llvm::endianness Endian>
uint64_t llvm::coverage::accessors::getDataSize (const FuncRecordTy *Record)
 Return the coverage map data size for the function.
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.
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.
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.
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.

Variables

constexpr uint64_t llvm::coverage::TestingFormatMagic = 0x6d766f636d766c6c

Macro Definition Documentation

◆ COVINIT_FUNC [1/4]

#define COVINIT_FUNC ( Type,
LLVMType,
Name,
Initializer )

◆ COVINIT_FUNC [2/4]

#define COVINIT_FUNC ( Type,
LLVMType,
Name,
Initializer )

◆ COVINIT_FUNC [3/4]

#define COVINIT_FUNC ( Type,
LLVMType,
Name,
Initializer )

◆ COVINIT_FUNC [4/4]

#define COVINIT_FUNC ( Type,
LLVMType,
Name,
Initializer )

◆ COVMAP_FUNC_RECORD [1/4]

#define COVMAP_FUNC_RECORD ( Type,
LLVMType,
Name,
Init )
Value:
Type Name;

Definition at line 1268 of file CoverageMapping.h.

◆ COVMAP_FUNC_RECORD [2/4]

#define COVMAP_FUNC_RECORD ( Type,
LLVMType,
Name,
Init )
Value:
Type Name;

Definition at line 1268 of file CoverageMapping.h.

◆ COVMAP_FUNC_RECORD [3/4]

#define COVMAP_FUNC_RECORD ( Type,
LLVMType,
Name,
Init )
Value:
Type Name;

Definition at line 1268 of file CoverageMapping.h.

◆ COVMAP_FUNC_RECORD [4/4]

#define COVMAP_FUNC_RECORD ( Type,
LLVMType,
Name,
Initializer )

Definition at line 1268 of file CoverageMapping.h.

◆ COVMAP_HEADER [1/4]

#define COVMAP_HEADER ( Type,
LLVMType,
Name,
Init )
Value:
Type Name;

Definition at line 1416 of file CoverageMapping.h.

◆ COVMAP_HEADER [2/4]

#define COVMAP_HEADER ( Type,
LLVMType,
Name,
Initializer )

Definition at line 1416 of file CoverageMapping.h.

◆ COVMAP_HEADER [3/4]

#define COVMAP_HEADER ( Type,
LLVMType,
Name,
Initializer )

Definition at line 1416 of file CoverageMapping.h.

◆ COVMAP_HEADER [4/4]

#define COVMAP_HEADER ( Type,
LLVMType,
Name,
Initializer )

Definition at line 1416 of file CoverageMapping.h.

◆ COVMAP_V1

#define COVMAP_V1

Definition at line 1267 of file CoverageMapping.h.

◆ COVMAP_V2

#define COVMAP_V2

Definition at line 1318 of file CoverageMapping.h.

◆ COVMAP_V2_OR_V3 [1/2]

#define COVMAP_V2_OR_V3

◆ COVMAP_V2_OR_V3 [2/2]

#define COVMAP_V2_OR_V3

◆ COVMAP_V3

#define COVMAP_V3

Definition at line 1362 of file CoverageMapping.h.

◆ INSTR_PROF_COMMA [1/4]

#define INSTR_PROF_COMMA

◆ INSTR_PROF_COMMA [2/4]

#define INSTR_PROF_COMMA

◆ INSTR_PROF_COMMA [3/4]

#define INSTR_PROF_COMMA

◆ INSTR_PROF_COMMA [4/4]

#define INSTR_PROF_COMMA

◆ INSTR_PROF_DATA [1/4]

#define INSTR_PROF_DATA ( Type,
LLVMType,
Name,
Initializer )

◆ INSTR_PROF_DATA [2/4]

#define INSTR_PROF_DATA ( Type,
LLVMType,
Name,
Initializer )

◆ INSTR_PROF_DATA [3/4]

#define INSTR_PROF_DATA ( Type,
LLVMType,
Name,
Initializer )

◆ INSTR_PROF_DATA [4/4]

#define INSTR_PROF_DATA ( Type,
LLVMType,
Name,
Initializer )

◆ INSTR_PROF_DATA_DEFINED [1/4]

#define INSTR_PROF_DATA_DEFINED

◆ INSTR_PROF_DATA_DEFINED [2/4]

#define INSTR_PROF_DATA_DEFINED

◆ INSTR_PROF_DATA_DEFINED [3/4]

#define INSTR_PROF_DATA_DEFINED

◆ INSTR_PROF_DATA_DEFINED [4/4]

#define INSTR_PROF_DATA_DEFINED

◆ INSTR_PROF_RAW_HEADER [1/4]

#define INSTR_PROF_RAW_HEADER ( Type,
Name,
Initializer )

◆ INSTR_PROF_RAW_HEADER [2/4]

#define INSTR_PROF_RAW_HEADER ( Type,
Name,
Initializer )

◆ INSTR_PROF_RAW_HEADER [3/4]

#define INSTR_PROF_RAW_HEADER ( Type,
Name,
Initializer )

◆ INSTR_PROF_RAW_HEADER [4/4]

#define INSTR_PROF_RAW_HEADER ( Type,
Name,
Initializer )

◆ INSTR_PROF_VALUE_NODE [1/4]

#define INSTR_PROF_VALUE_NODE ( Type,
LLVMType,
Name,
Initializer )

◆ INSTR_PROF_VALUE_NODE [2/4]

#define INSTR_PROF_VALUE_NODE ( Type,
LLVMType,
Name,
Initializer )

◆ INSTR_PROF_VALUE_NODE [3/4]

#define INSTR_PROF_VALUE_NODE ( Type,
LLVMType,
Name,
Initializer )

◆ INSTR_PROF_VALUE_NODE [4/4]

#define INSTR_PROF_VALUE_NODE ( Type,
LLVMType,
Name,
Initializer )

◆ INSTR_PROF_VISIBILITY

#define INSTR_PROF_VISIBILITY

◆ INSTR_PROF_VTABLE_DATA [1/4]

#define INSTR_PROF_VTABLE_DATA ( Type,
LLVMType,
Name,
Initializer )

◆ INSTR_PROF_VTABLE_DATA [2/4]

#define INSTR_PROF_VTABLE_DATA ( Type,
LLVMType,
Name,
Initializer )

◆ INSTR_PROF_VTABLE_DATA [3/4]

#define INSTR_PROF_VTABLE_DATA ( Type,
LLVMType,
Name,
Initializer )

◆ INSTR_PROF_VTABLE_DATA [4/4]

#define INSTR_PROF_VTABLE_DATA ( Type,
LLVMType,
Name,
Initializer )

◆ VALUE_PROF_FUNC_PARAM [1/4]

#define VALUE_PROF_FUNC_PARAM ( ArgType,
ArgName,
ArgLLVMType )

◆ VALUE_PROF_FUNC_PARAM [2/4]

#define VALUE_PROF_FUNC_PARAM ( ArgType,
ArgName,
ArgLLVMType )

◆ VALUE_PROF_FUNC_PARAM [3/4]

#define VALUE_PROF_FUNC_PARAM ( ArgType,
ArgName,
ArgLLVMType )

◆ VALUE_PROF_FUNC_PARAM [4/4]

#define VALUE_PROF_FUNC_PARAM ( ArgType,
ArgName,
ArgLLVMType )

◆ VALUE_PROF_KIND [1/4]

#define VALUE_PROF_KIND ( Enumerator,
Value,
Descr )

◆ VALUE_PROF_KIND [2/4]

#define VALUE_PROF_KIND ( Enumerator,
Value,
Descr )

◆ VALUE_PROF_KIND [3/4]

#define VALUE_PROF_KIND ( Enumerator,
Value,
Descr )

◆ VALUE_PROF_KIND [4/4]

#define VALUE_PROF_KIND ( Enumerator,
Value,
Descr )