14#ifndef LLVM_PROFILEDATA_COVERAGE_COVERAGEMAPPING_H
15#define LLVM_PROFILEDATA_COVERAGE_COVERAGEMAPPING_H
40#include <system_error>
46class IndexedInstrProfReader;
81 : Err(Err), Msg(ErrStr.str()) {
85 std::string
message()
const override;
142 return std::tie(
LHS.Kind,
LHS.ID) < std::tie(
RHS.Kind,
RHS.ID);
175 std::vector<CounterExpression> Expressions;
192 Term(
unsigned CounterID,
int Factor)
193 : CounterID(CounterID), Factor(Factor) {}
262 return mcdc::getParams<const mcdc::DecisionParameters>(
MCDCParams);
266 return mcdc::getParams<const mcdc::BranchParameters>(
MCDCParams);
430 const auto &
A = *
this;
459 IndependencePairs(
std::
move(IndependencePairs)),
465 return Region.getDecisionParams().NumConditions;
468 bool isCondFolded(
unsigned Condition)
const {
return Folded[Condition]; }
477 return TV[TestVectorIndex].first[PosToID[Condition]];
483 return TV[TestVectorIndex].second;
492 auto It = PosToID.
find(Condition);
493 if (It != PosToID.
end())
494 return IndependencePairs.
contains(It->second);
505 return IndependencePairs[PosToID[Condition]];
510 unsigned Covered = 0;
521 return (
static_cast<double>(Covered) /
static_cast<double>(
Total)) * 100.0;
525 std::ostringstream
OS;
526 OS <<
"Condition C" << Condition + 1 <<
" --> (";
527 OS << CondLoc[Condition].first <<
":" << CondLoc[Condition].second;
533 std::ostringstream
OS;
539 for (
unsigned I = 0;
I < NumConditions;
I++) {
541 if (
I != NumConditions - 1)
550 "TestVector index out of bounds!");
551 std::ostringstream
OS;
554 OS <<
" " << TestVectorIndex + 1 <<
" { ";
555 for (
unsigned Condition = 0; Condition < NumConditions; Condition++) {
571 if (Condition != NumConditions - 1)
588 "Condition index is out of bounds!");
589 std::ostringstream
OS;
591 OS <<
" C" << Condition + 1 <<
"-Pair: ";
593 OS <<
"constant folded\n";
596 OS <<
"covered: (" << rows.first <<
",";
597 OS << rows.second <<
")\n";
599 OS <<
"not covered\n";
664 : Expressions(Expressions), CounterValues(CounterValues) {}
717 uint64_t FalseCount,
bool HasSingleByteCoverage) {
721 HasSingleByteCoverage);
724 if (
Region.Count.isZero() &&
Region.FalseCount.isZero())
731 HasSingleByteCoverage);
738 std::forward_iterator_tag, FunctionRecord> {
744 void skipOtherFiles();
749 : Records(Records_), Current(Records.begin()), Filename(Filename) {
756 return Current ==
RHS.Current && Filename ==
RHS.Filename;
762 assert(Current != Records.end() &&
"incremented past end");
811 bool IsBranchRegion =
false)
816 return std::tie(L.Line, L.Col, L.Count, L.HasCount, L.IsRegionEntry,
817 L.IsGapRegion) == std::tie(R.Line, R.Col, R.Count,
818 R.HasCount, R.IsRegionEntry,
833 std::vector<const FunctionRecord *> Instantiations;
836 std::vector<const FunctionRecord *> Instantiations)
837 : Line(Line), Col(Col), Instantiations(
std::
move(Instantiations)) {}
844 size_t size()
const {
return Instantiations.size(); }
854 for (
unsigned I = 1,
E = Instantiations.size();
I <
E; ++
I)
855 if (Instantiations[
I]->
Name != Instantiations[0]->
Name)
862 assert(
hasName() &&
"Instantiations don't have a shared name");
863 return Instantiations[0]->Name;
870 Count +=
F->ExecutionCount;
876 return Instantiations;
888 std::string Filename;
889 std::vector<CoverageSegment> Segments;
890 std::vector<ExpansionRecord> Expansions;
891 std::vector<CountedRegion> BranchRegions;
892 std::vector<MCDCRecord> MCDCRecords;
904 std::vector<CoverageSegment>::const_iterator
begin()
const {
905 return Segments.begin();
908 std::vector<CoverageSegment>::const_iterator
end()
const {
909 return Segments.end();
912 bool empty()
const {
return Segments.empty(); }
930 std::vector<FunctionRecord> Functions;
932 std::vector<std::pair<std::string, uint64_t>> FuncHashMismatches;
937 static Error loadFromReaders(
938 ArrayRef<std::unique_ptr<CoverageMappingReader>> CoverageReaders,
957 getImpreciseRecordIndicesForFilename(
StringRef Filename)
const;
965 load(
ArrayRef<std::unique_ptr<CoverageMappingReader>> CoverageReaders,
976 bool CheckBinaryIDs =
false);
989 return FuncHashMismatches;
1026 std::vector<InstantiationGroup>
1033 bool HasMultipleRegions;
1055 return LineSegments;
1065 std::forward_iterator_tag,
1066 const LineCoverageStats> {
1072 : CD(CD), WrappedSegment(nullptr), Next(CD.begin()), Ended(
false),
1078 return &CD == &R.CD && Next == R.Next && Ended == R.Ended;
1087 EndIt.Next = CD.
end();
1095 std::vector<CoverageSegment>::const_iterator Next;
1106 auto End = Begin.getEnd();
1137namespace accessors {
1140template <
class FuncRecordTy, llvm::endianness Endian>
1142 return support::endian::byte_swap<uint64_t, Endian>(
Record->FuncHash);
1146template <
class FuncRecordTy, llvm::endianness Endian>
1148 return support::endian::byte_swap<uint32_t, Endian>(
Record->DataSize);
1152template <
class FuncRecordTy, llvm::endianness Endian>
1154 return support::endian::byte_swap<uint64_t, Endian>(
Record->NameRef);
1159template <
class FuncRecordTy, llvm::endianness Endian>
1170template <
class FuncRecordTy, llvm::endianness Endian>
1172 const char *MappingBuf) {
1173 return {MappingBuf, size_t(getDataSize<FuncRecordTy, Endian>(
Record))};
1178template <
class FuncRecordTy, llvm::endianness Endian>
1179std::pair<const char *, const FuncRecordTy *>
1181 return {MappingBuf + getDataSize<FuncRecordTy, Endian>(
Record),
Record + 1};
1187template <
class IntPtrT>
1192#define COVMAP_FUNC_RECORD(Type, LLVMType, Name, Init) Type Name;
1198 return accessors::getFuncHash<ThisT, Endian>(
this);
1202 return accessors::getDataSize<ThisT, Endian>(
this);
1207 return support::endian::byte_swap<IntPtrT, Endian>(NamePtr);
1211 template <llvm::endianness Endian>
1213 IntPtrT NameRef = getFuncNameRef<Endian>();
1215 FuncName = ProfileNames.
getFuncName(NameRef, NameS);
1216 if (NameS && FuncName.
empty())
1218 "function name is empty");
1222 template <llvm::endianness Endian>
1223 std::pair<const char *, const ThisT *>
1225 return accessors::advanceByOneOutOfLine<ThisT, Endian>(
this, MappingBuf);
1232 template <llvm::endianness Endian>
1234 return accessors::getCoverageMappingOutOfLine<ThisT, Endian>(
this,
1243#define COVMAP_FUNC_RECORD(Type, LLVMType, Name, Init) Type Name;
1249 return accessors::getFuncHash<ThisT, Endian>(
this);
1253 return accessors::getDataSize<ThisT, Endian>(
this);
1257 return accessors::getFuncNameRef<ThisT, Endian>(
this);
1260 template <llvm::endianness Endian>
1262 return accessors::getFuncNameViaRef<ThisT, Endian>(
this, ProfileNames,
1266 template <llvm::endianness Endian>
1267 std::pair<const char *, const ThisT *>
1269 return accessors::advanceByOneOutOfLine<ThisT, Endian>(
this, MappingBuf);
1276 template <llvm::endianness Endian>
1278 return accessors::getCoverageMappingOutOfLine<ThisT, Endian>(
this,
1287#define COVMAP_FUNC_RECORD(Type, LLVMType, Name, Init) Type Name;
1293 return accessors::getFuncHash<ThisT, Endian>(
this);
1297 return accessors::getDataSize<ThisT, Endian>(
this);
1301 return accessors::getFuncNameRef<ThisT, Endian>(
this);
1304 template <llvm::endianness Endian>
1306 return accessors::getFuncNameViaRef<ThisT, Endian>(
this, ProfileNames,
1312 return support::endian::byte_swap<uint64_t, Endian>(FilenamesRef);
1317 template <llvm::endianness Endian>
1324 template <llvm::endianness Endian>
1325 std::pair<const char *, const CovMapFunctionRecordV3 *>
1329 sizeof(
char) + getDataSize<Endian>();
1340#define COVMAP_HEADER(Type, LLVMType, Name, Init) Type Name;
1343 return support::endian::byte_swap<uint32_t, Endian>(NRecords);
1347 return support::endian::byte_swap<uint32_t, Endian>(FilenamesSize);
1351 return support::endian::byte_swap<uint32_t, Endian>(CoverageSize);
1355 return support::endian::byte_swap<uint32_t, Endian>(
Version);
1422 using namespace coverage;
1424 return CounterExpression(CounterExpression::ExprKind::Subtract,
1425 Counter::getCounter(~0U),
1426 Counter::getCounter(~0U));
1430 using namespace coverage;
1432 return CounterExpression(CounterExpression::ExprKind::Add,
1433 Counter::getCounter(~0U),
1434 Counter::getCounter(~0U));
1438 return static_cast<unsigned>(
1439 hash_combine(V.Kind, V.LHS.getKind(), V.LHS.getCounterID(),
1440 V.RHS.getKind(), V.RHS.getCounterID()));
AMDGPU Mark last scratch load
This file implements the BitVector class.
This file declares a library for handling Build IDs and using them to find debug info.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
#define LLVM_PACKED_START
This file defines the DenseMap class.
This file defines the DenseSet and SmallDenseSet classes.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
ArrayRef< BitWord > getData() const
size_type size() const
size - Returns the number of bits in this bitvector.
iterator find(const_arg_type_t< KeyT > Val)
bool contains(const_arg_type_t< KeyT > Val) const
Return true if the specified key is in the map, false otherwise.
Base class for user error types.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
Class representing an expression and its matching format.
Reader for the indexed binary instrprof format.
A symbol table used for function [IR]PGO name look-up with keys (such as pointers,...
StringRef getFuncOrVarName(uint64_t ValMD5Hash)
Return name of functions or global variables from the name's md5 hash value.
StringRef getFuncName(uint64_t FuncNameAddress, size_t NameSize)
Return function's PGO name from the function name's symbol address in the object file.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
StringRef - Represent a constant reference to a string, i.e.
constexpr bool empty() const
empty - Check if the string is empty.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
A Counter expression builder is used to construct the counter expressions.
ArrayRef< CounterExpression > getExpressions() const
Counter subtract(Counter LHS, Counter RHS, bool Simplify=true)
Return a counter that represents the expression that subtracts RHS from LHS.
Counter add(Counter LHS, Counter RHS, bool Simplify=true)
Return a counter that represents the expression that adds LHS and RHS.
A Counter mapping context is used to connect the counters, expressions and the obtained counter value...
CounterMappingContext(ArrayRef< CounterExpression > Expressions, ArrayRef< uint64_t > CounterValues=std::nullopt)
Expected< MCDCRecord > evaluateMCDCRegion(const CounterMappingRegion &Region, ArrayRef< const CounterMappingRegion * > Branches, bool IsVersion11)
Return an MCDC record that indicates executed test vectors and condition pairs.
void setCounts(ArrayRef< uint64_t > Counts)
void dump(const Counter &C) const
Expected< int64_t > evaluate(const Counter &C) const
Return the number of times that a region of code associated with this counter was executed.
void setBitmap(BitVector &&Bitmap_)
unsigned getMaxCounterID(const Counter &C) const
void dump(const Counter &C, raw_ostream &OS) const
Coverage information to be processed or displayed.
ArrayRef< ExpansionRecord > getExpansions() const
Expansions that can be further processed.
ArrayRef< CountedRegion > getBranches() const
Branches that can be further processed.
std::vector< CoverageSegment >::const_iterator begin() const
Get an iterator over the coverage segments for this object.
std::vector< CoverageSegment >::const_iterator end() const
StringRef getFilename() const
Get the name of the file this data covers.
ArrayRef< MCDCRecord > getMCDCRecords() const
MCDC Records that can be further processed.
CoverageData(StringRef Filename)
std::string message() const override
Return the error message as a string.
CoverageMapError(coveragemap_error Err, const Twine &ErrStr=Twine())
void log(raw_ostream &OS) const override
Print an error message to an output stream.
coveragemap_error get() const
std::error_code convertToErrorCode() const override
Convert this error to a std::error_code.
const std::string & getMessage() const
The mapping of profile information to coverage data.
unsigned getMismatchedCount() const
The number of functions that couldn't have their profiles mapped.
std::vector< StringRef > getUniqueSourceFiles() const
Returns a lexicographically sorted, unique list of files that are covered.
CoverageData getCoverageForExpansion(const ExpansionRecord &Expansion) const
Get the coverage for an expansion within a coverage set.
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 m...
iterator_range< FunctionRecordIterator > getCoveredFunctions(StringRef Filename) const
Gets all of the functions in a particular file.
iterator_range< FunctionRecordIterator > getCoveredFunctions() const
Gets all of the functions covered by this profile.
CoverageData getCoverageForFunction(const FunctionRecord &Function) const
Get the coverage for a particular function.
CoverageMapping(const CoverageMapping &)=delete
std::vector< InstantiationGroup > getInstantiationGroups(StringRef Filename) const
Get the list of function instantiation groups in a particular file.
CoverageData getCoverageForFile(StringRef Filename) const
Get the coverage for a particular file.
CoverageMapping & operator=(const CoverageMapping &)=delete
Iterator over Functions, optionally filtered to a single file.
FunctionRecordIterator & operator++()
bool operator==(const FunctionRecordIterator &RHS) const
const FunctionRecord & operator*() const
FunctionRecordIterator(ArrayRef< FunctionRecord > Records_, StringRef Filename="")
An instantiation group contains a FunctionRecord list, such that each record corresponds to a distinc...
InstantiationGroup(const InstantiationGroup &)=delete
unsigned getLine() const
Get the line where the common function was defined.
unsigned getColumn() const
Get the column where the common function was defined.
bool hasName() const
Check if the instantiations in this group have a common mangled name.
size_t size() const
Get the number of instantiations in this group.
ArrayRef< const FunctionRecord * > getInstantiations() const
Get the instantiations in this group.
uint64_t getTotalExecutionCount() const
Get the total execution count of all instantiations in this group.
InstantiationGroup(InstantiationGroup &&)=default
StringRef getName() const
Get the common mangled name for instantiations in this group.
An iterator over the LineCoverageStats objects for lines described by a CoverageData instance.
LineCoverageIterator(const CoverageData &CD)
const LineCoverageStats & operator*() const
bool operator==(const LineCoverageIterator &R) const
LineCoverageIterator getEnd() const
LineCoverageIterator & operator++()
LineCoverageIterator(const CoverageData &CD, unsigned Line)
Coverage statistics for a single line.
bool hasMultipleRegions() const
const CoverageSegment * getWrappedSegment() const
uint64_t getExecutionCount() const
ArrayRef< const CoverageSegment * > getLineSegments() const
Emulate SmallVector<CondState> with a pair of BitVector.
auto getIndex() const
Equivalent to buildTestVector's Index.
CondState operator[](int I) const
Emulate RHS SmallVector::operator[].
TestVector(unsigned N)
~DontCare
void set(int I, CondState Val)
Set the condition Val at position I.
auto getDifferences(const TestVector &B) const
For each element:
void push_back(CondState Val)
Emulate SmallVector::push_back.
Compute TestVector Indices "TVIdx" from the Conds graph.
static constexpr auto HardMaxTVs
Hard limit of test vectors.
SmallVector< std::array< int, 2 > > Indices
Output: Index for TestVectors bitmap (These are not CondIDs)
int NumTestVectors
Output: The number of test vectors.
SmallVector< MCDCNode > SavedNodes
This is no longer needed after the assignment.
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
A range adaptor for a pair of iterators.
BuildIDFetcher searches local cache directories for debug info.
This class implements an extremely fast bulk output stream that can only output to a stream.
The virtual file system interface.
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ C
The default llvm calling convention, compatible with C.
constexpr size_t NameSize
uint64_t getFuncNameRef(const FuncRecordTy *Record)
Return the function lookup key. The value is considered opaque.
StringRef getCoverageMappingOutOfLine(const FuncRecordTy *Record, const char *MappingBuf)
Read coverage mapping out-of-line, from MappingBuf.
uint64_t getDataSize(const FuncRecordTy *Record)
Return the coverage map data size for the function.
Error getFuncNameViaRef(const FuncRecordTy *Record, InstrProfSymtab &ProfileNames, StringRef &FuncName)
Return the PGO name of the function.
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.
uint64_t getFuncHash(const FuncRecordTy *Record)
Return the structural hash associated with the function.
std::variant< std::monostate, DecisionParameters, BranchParameters > Parameters
The type of MC/DC-specific parameters.
std::array< ConditionID, 2 > ConditionIDs
const std::error_category & coveragemap_category()
std::error_code make_error_code(coveragemap_error E)
static iterator_range< LineCoverageIterator > getLineCoverageStats(const coverage::CoverageData &CD)
Get a LineCoverageIterator range for the lines described by CD.
@ invalid_or_missing_arch_specifier
constexpr uint64_t TestingFormatMagic
std::pair< unsigned, unsigned > LineColPair
This is an optimization pass for GlobalISel generic memory operations.
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
uint64_t offsetToAlignedAddr(const void *Addr, Align Alignment)
Returns the necessary adjustment for aligning Addr to Alignment bytes, rounding up.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
hash_code hash_combine(const Ts &...args)
Combine values into a single hash_code.
bool isAddrAligned(Align Lhs, const void *Addr)
Checks that Addr is a multiple of the alignment.
Implement std::hash so that hash_code can be used in STL containers.
This struct is a compact representation of a valid (non-zero power of two) alignment.
static coverage::CounterExpression getTombstoneKey()
static bool isEqual(const coverage::CounterExpression &LHS, const coverage::CounterExpression &RHS)
static unsigned getHashValue(const coverage::CounterExpression &V)
static coverage::CounterExpression getEmptyKey()
An information struct used to provide DenseMap with the various necessary components for a given valu...
Associates a source range with an execution count.
bool HasSingleByteCoverage
CountedRegion(const CounterMappingRegion &R, uint64_t ExecutionCount, uint64_t FalseExecutionCount, bool HasSingleByteCoverage)
CountedRegion(const CounterMappingRegion &R, uint64_t ExecutionCount, bool HasSingleByteCoverage)
uint64_t FalseExecutionCount
A Counter expression is a value that represents an arithmetic operation with two counters.
CounterExpression(ExprKind Kind, Counter LHS, Counter RHS)
A Counter mapping region associates a source range with a specific counter.
LineColPair endLoc() const
const auto & getDecisionParams() const
CounterMappingRegion(const mcdc::DecisionParameters &MCDCParams, unsigned FileID, unsigned LineStart, unsigned ColumnStart, unsigned LineEnd, unsigned ColumnEnd, RegionKind Kind)
static CounterMappingRegion makeExpansion(unsigned FileID, unsigned ExpandedFileID, unsigned LineStart, unsigned ColumnStart, unsigned LineEnd, unsigned ColumnEnd)
static CounterMappingRegion makeGapRegion(Counter Count, unsigned FileID, unsigned LineStart, unsigned ColumnStart, unsigned LineEnd, unsigned ColumnEnd)
CounterMappingRegion(Counter Count, unsigned FileID, unsigned ExpandedFileID, unsigned LineStart, unsigned ColumnStart, unsigned LineEnd, unsigned ColumnEnd, RegionKind Kind)
CounterMappingRegion(Counter Count, Counter FalseCount, unsigned FileID, unsigned ExpandedFileID, unsigned LineStart, unsigned ColumnStart, unsigned LineEnd, unsigned ColumnEnd, RegionKind Kind, const mcdc::Parameters &MCDCParams=std::monostate())
static CounterMappingRegion makeRegion(Counter Count, unsigned FileID, unsigned LineStart, unsigned ColumnStart, unsigned LineEnd, unsigned ColumnEnd)
static CounterMappingRegion makeDecisionRegion(const mcdc::DecisionParameters &MCDCParams, unsigned FileID, unsigned LineStart, unsigned ColumnStart, unsigned LineEnd, unsigned ColumnEnd)
Counter FalseCount
Secondary Counter used for Branch Regions (FalseCount).
static CounterMappingRegion makeSkipped(unsigned FileID, unsigned LineStart, unsigned ColumnStart, unsigned LineEnd, unsigned ColumnEnd)
Counter Count
Primary Counter that is also used for Branch Regions (TrueCount).
LineColPair startLoc() const
const auto & getBranchParams() const
static CounterMappingRegion makeBranchRegion(Counter Count, Counter FalseCount, unsigned FileID, unsigned LineStart, unsigned ColumnStart, unsigned LineEnd, unsigned ColumnEnd, const mcdc::Parameters &MCDCParams=std::monostate())
mcdc::Parameters MCDCParams
Parameters used for Modified Condition/Decision Coverage.
@ ExpansionRegion
An ExpansionRegion represents a file expansion region that associates a source range with the expansi...
@ MCDCDecisionRegion
A DecisionRegion represents a top-level boolean expression and is associated with a variable length b...
@ MCDCBranchRegion
A Branch Region can be extended to include IDs to facilitate MC/DC.
@ SkippedRegion
A SkippedRegion represents a source range with code that was skipped by a preprocessor or similar mea...
@ GapRegion
A GapRegion is like a CodeRegion, but its count is only set as the line execution count when its the ...
@ BranchRegion
A BranchRegion represents leaf-level boolean expressions and is associated with two counters,...
@ CodeRegion
A CodeRegion associates some code with a counter.
A Counter is an abstract value that describes how to compute the execution count for a region of code...
static const unsigned EncodingTagBits
static Counter getZero()
Return the counter that represents the number zero.
static Counter getCounter(unsigned CounterId)
Return the counter that corresponds to a specific profile counter.
friend bool operator==(const Counter &LHS, const Counter &RHS)
unsigned getCounterID() const
CounterKind
The CounterExpression kind (Add or Subtract) is encoded in bit 0 next to the CounterKind.
unsigned getExpressionID() const
static const unsigned EncodingCounterTagAndExpansionRegionTagBits
CounterKind getKind() const
bool isExpression() const
friend bool operator!=(const Counter &LHS, const Counter &RHS)
friend bool operator<(const Counter &LHS, const Counter &RHS)
static const unsigned EncodingTagMask
static Counter getExpression(unsigned ExpressionId)
Return the counter that corresponds to a specific addition counter expression.
CovMapFunctionRecordV1()=delete
std::pair< const char *, const ThisT * > advanceByOne(const char *MappingBuf) const
StringRef getCoverageMapping(const char *MappingBuf) const
uint64_t getFuncHash() const
uint64_t getFilenamesRef() const
Error getFuncName(InstrProfSymtab &ProfileNames, StringRef &FuncName) const
Return the PGO name of the function.
IntPtrT getFuncNameRef() const
Return function lookup key. The value is consider opaque.
uint64_t getDataSize() const
uint64_t getFilenamesRef() const
Error getFuncName(InstrProfSymtab &ProfileNames, StringRef &FuncName) const
CovMapFunctionRecordV2()=delete
uint64_t getDataSize() const
std::pair< const char *, const ThisT * > advanceByOne(const char *MappingBuf) const
StringRef getCoverageMapping(const char *MappingBuf) const
uint64_t getFuncHash() const
uint64_t getFuncNameRef() const
uint64_t getFuncHash() const
std::pair< const char *, const CovMapFunctionRecordV3 * > advanceByOne(const char *) const
uint64_t getFuncNameRef() const
StringRef getCoverageMapping(const char *) const
Read the inline coverage mapping.
uint64_t getFilenamesRef() const
Get the filename set reference.
Error getFuncName(InstrProfSymtab &ProfileNames, StringRef &FuncName) const
uint64_t getDataSize() const
CovMapFunctionRecordV3()=delete
Coverage mapping information for a single function.
The execution count information starting at a point in a file.
CoverageSegment(unsigned Line, unsigned Col, bool IsRegionEntry)
bool HasCount
When false, the segment was uninstrumented or skipped.
unsigned Col
The column where this segment begins.
friend bool operator==(const CoverageSegment &L, const CoverageSegment &R)
bool IsRegionEntry
Whether this enters a new region or returns to a previous count.
uint64_t Count
The execution count, or zero if no count was recorded.
unsigned Line
The line where this segment begins.
CoverageSegment(unsigned Line, unsigned Col, uint64_t Count, bool IsRegionEntry, bool IsGapRegion=false, bool IsBranchRegion=false)
bool IsGapRegion
Whether this enters a gap region.
Coverage information for a macro expansion or #included file.
const CountedRegion & Region
The region that expands to this record.
unsigned FileID
The abstract file this expansion covers.
ExpansionRecord(const CountedRegion &Region, const FunctionRecord &Function)
const FunctionRecord & Function
Coverage for the expansion.
Code coverage information for a single function.
std::vector< CountedRegion > CountedBranchRegions
Branch Regions in the function along with their counts.
std::string Name
Raw function name.
std::vector< CountedRegion > CountedRegions
Regions in the function along with their counts.
FunctionRecord & operator=(FunctionRecord &&)=default
void pushMCDCRecord(MCDCRecord &&Record)
std::vector< MCDCRecord > MCDCRecords
MCDC Records record a DecisionRegion and associated BranchRegions.
std::vector< std::string > Filenames
Mapping from FileID (i.e.
FunctionRecord(FunctionRecord &&FR)=default
FunctionRecord(StringRef Name, ArrayRef< StringRef > Filenames)
uint64_t ExecutionCount
The number of times this function was executed.
void pushRegion(CounterMappingRegion Region, uint64_t Count, uint64_t FalseCount, bool HasSingleByteCoverage)
MCDC Record grouping all information together.
MCDCRecord(const CounterMappingRegion &Region, TestVectors &&TV, TVPairMap &&IndependencePairs, BoolVector &&Folded, CondIDMap &&PosToID, LineColPairMap &&CondLoc)
std::pair< unsigned, unsigned > TVRowPair
float getPercentCovered() const
std::string getConditionCoverageString(unsigned Condition)
std::string getConditionHeaderString(unsigned Condition)
unsigned getNumTestVectors() const
std::string getTestVectorString(unsigned TestVectorIndex)
CounterMappingRegion getDecisionRegion() const
TVRowPair getConditionIndependencePair(unsigned Condition)
Return the Independence Pair that covers the given condition.
bool isConditionIndependencePairCovered(unsigned Condition) const
Determine whether a given condition (indicated by Condition) is covered by an Independence Pair.
CondState
CondState represents the evaluation of a condition in an executed test vector, which can be True or F...
std::string getTestVectorHeaderString() const
CondState getTVCondition(unsigned TestVectorIndex, unsigned Condition)
Return the evaluation of a condition (indicated by Condition) in an executed test vector (indicated b...
unsigned getNumConditions() const
CondState getTVResult(unsigned TestVectorIndex)
Return the Result evaluation for an executed test vector.
bool isCondFolded(unsigned Condition) const
ConditionIDs NextIDs
Number of accumulated paths (>= 1)
int Width
Reference count; temporary use.