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);
435 const auto &
A = *
this;
464 IndependencePairs(
std::
move(IndependencePairs)),
470 return Region.getDecisionParams().NumConditions;
473 bool isCondFolded(
unsigned Condition)
const {
return Folded[Condition]; }
482 return TV[TestVectorIndex].first[PosToID[Condition]];
488 return TV[TestVectorIndex].second;
497 auto It = PosToID.
find(Condition);
498 if (It != PosToID.
end())
499 return IndependencePairs.
contains(It->second);
510 return IndependencePairs[PosToID[Condition]];
515 unsigned Covered = 0;
526 return (
static_cast<double>(Covered) /
static_cast<double>(
Total)) * 100.0;
530 std::ostringstream
OS;
531 OS <<
"Condition C" << Condition + 1 <<
" --> (";
532 OS << CondLoc[Condition].first <<
":" << CondLoc[Condition].second;
538 std::ostringstream
OS;
544 for (
unsigned I = 0;
I < NumConditions;
I++) {
546 if (
I != NumConditions - 1)
555 "TestVector index out of bounds!");
556 std::ostringstream
OS;
559 OS <<
" " << TestVectorIndex + 1 <<
" { ";
560 for (
unsigned Condition = 0; Condition < NumConditions; Condition++) {
576 if (Condition != NumConditions - 1)
593 "Condition index is out of bounds!");
594 std::ostringstream
OS;
596 OS <<
" C" << Condition + 1 <<
"-Pair: ";
598 OS <<
"constant folded\n";
601 OS <<
"covered: (" << rows.first <<
",";
602 OS << rows.second <<
")\n";
604 OS <<
"not covered\n";
669 : Expressions(Expressions), CounterValues(CounterValues) {}
722 uint64_t FalseCount,
bool HasSingleByteCoverage) {
725 HasSingleByteCoverage);
735 HasSingleByteCoverage);
742 std::forward_iterator_tag, FunctionRecord> {
748 void skipOtherFiles();
753 : Records(Records_), Current(Records.begin()), Filename(Filename) {
760 return Current ==
RHS.Current && Filename ==
RHS.Filename;
766 assert(Current != Records.end() &&
"incremented past end");
815 bool IsBranchRegion =
false)
820 return std::tie(L.Line, L.Col, L.Count, L.HasCount, L.IsRegionEntry,
821 L.IsGapRegion) == std::tie(R.Line, R.Col, R.Count,
822 R.HasCount, R.IsRegionEntry,
837 std::vector<const FunctionRecord *> Instantiations;
840 std::vector<const FunctionRecord *> Instantiations)
841 : Line(Line), Col(Col), Instantiations(
std::
move(Instantiations)) {}
848 size_t size()
const {
return Instantiations.size(); }
858 for (
unsigned I = 1,
E = Instantiations.size();
I <
E; ++
I)
859 if (Instantiations[
I]->
Name != Instantiations[0]->
Name)
866 assert(
hasName() &&
"Instantiations don't have a shared name");
867 return Instantiations[0]->Name;
874 Count +=
F->ExecutionCount;
880 return Instantiations;
892 std::string Filename;
893 std::vector<CoverageSegment> Segments;
894 std::vector<ExpansionRecord> Expansions;
895 std::vector<CountedRegion> BranchRegions;
896 std::vector<MCDCRecord> MCDCRecords;
908 std::vector<CoverageSegment>::const_iterator
begin()
const {
909 return Segments.begin();
912 std::vector<CoverageSegment>::const_iterator
end()
const {
913 return Segments.end();
916 bool empty()
const {
return Segments.empty(); }
934 std::vector<FunctionRecord> Functions;
936 std::vector<std::pair<std::string, uint64_t>> FuncHashMismatches;
941 static Error loadFromReaders(
942 ArrayRef<std::unique_ptr<CoverageMappingReader>> CoverageReaders,
961 getImpreciseRecordIndicesForFilename(
StringRef Filename)
const;
969 load(
ArrayRef<std::unique_ptr<CoverageMappingReader>> CoverageReaders,
980 bool CheckBinaryIDs =
false);
993 return FuncHashMismatches;
1030 std::vector<InstantiationGroup>
1037 bool HasMultipleRegions;
1059 return LineSegments;
1069 std::forward_iterator_tag,
1070 const LineCoverageStats> {
1076 : CD(CD), WrappedSegment(nullptr), Next(CD.begin()), Ended(
false),
1082 return &CD == &R.CD && Next == R.Next && Ended == R.Ended;
1091 EndIt.Next = CD.
end();
1099 std::vector<CoverageSegment>::const_iterator Next;
1110 auto End = Begin.getEnd();
1141namespace accessors {
1144template <
class FuncRecordTy, llvm::endianness Endian>
1146 return support::endian::byte_swap<uint64_t, Endian>(
Record->FuncHash);
1150template <
class FuncRecordTy, llvm::endianness Endian>
1152 return support::endian::byte_swap<uint32_t, Endian>(
Record->DataSize);
1156template <
class FuncRecordTy, llvm::endianness Endian>
1158 return support::endian::byte_swap<uint64_t, Endian>(
Record->NameRef);
1163template <
class FuncRecordTy, llvm::endianness Endian>
1174template <
class FuncRecordTy, llvm::endianness Endian>
1176 const char *MappingBuf) {
1177 return {MappingBuf, size_t(getDataSize<FuncRecordTy, Endian>(
Record))};
1182template <
class FuncRecordTy, llvm::endianness Endian>
1183std::pair<const char *, const FuncRecordTy *>
1185 return {MappingBuf + getDataSize<FuncRecordTy, Endian>(
Record),
Record + 1};
1191template <
class IntPtrT>
1196#define COVMAP_FUNC_RECORD(Type, LLVMType, Name, Init) Type Name;
1202 return accessors::getFuncHash<ThisT, Endian>(
this);
1206 return accessors::getDataSize<ThisT, Endian>(
this);
1211 return support::endian::byte_swap<IntPtrT, Endian>(NamePtr);
1215 template <llvm::endianness Endian>
1217 IntPtrT NameRef = getFuncNameRef<Endian>();
1219 FuncName = ProfileNames.
getFuncName(NameRef, NameS);
1220 if (NameS && FuncName.
empty())
1222 "function name is empty");
1226 template <llvm::endianness Endian>
1227 std::pair<const char *, const ThisT *>
1229 return accessors::advanceByOneOutOfLine<ThisT, Endian>(
this, MappingBuf);
1236 template <llvm::endianness Endian>
1238 return accessors::getCoverageMappingOutOfLine<ThisT, Endian>(
this,
1247#define COVMAP_FUNC_RECORD(Type, LLVMType, Name, Init) Type Name;
1253 return accessors::getFuncHash<ThisT, Endian>(
this);
1257 return accessors::getDataSize<ThisT, Endian>(
this);
1261 return accessors::getFuncNameRef<ThisT, Endian>(
this);
1264 template <llvm::endianness Endian>
1266 return accessors::getFuncNameViaRef<ThisT, Endian>(
this, ProfileNames,
1270 template <llvm::endianness Endian>
1271 std::pair<const char *, const ThisT *>
1273 return accessors::advanceByOneOutOfLine<ThisT, Endian>(
this, MappingBuf);
1280 template <llvm::endianness Endian>
1282 return accessors::getCoverageMappingOutOfLine<ThisT, Endian>(
this,
1291#define COVMAP_FUNC_RECORD(Type, LLVMType, Name, Init) Type Name;
1297 return accessors::getFuncHash<ThisT, Endian>(
this);
1301 return accessors::getDataSize<ThisT, Endian>(
this);
1305 return accessors::getFuncNameRef<ThisT, Endian>(
this);
1308 template <llvm::endianness Endian>
1310 return accessors::getFuncNameViaRef<ThisT, Endian>(
this, ProfileNames,
1316 return support::endian::byte_swap<uint64_t, Endian>(FilenamesRef);
1321 template <llvm::endianness Endian>
1328 template <llvm::endianness Endian>
1329 std::pair<const char *, const CovMapFunctionRecordV3 *>
1333 sizeof(
char) + getDataSize<Endian>();
1344#define COVMAP_HEADER(Type, LLVMType, Name, Init) Type Name;
1347 return support::endian::byte_swap<uint32_t, Endian>(NRecords);
1351 return support::endian::byte_swap<uint32_t, Endian>(FilenamesSize);
1355 return support::endian::byte_swap<uint32_t, Endian>(CoverageSize);
1359 return support::endian::byte_swap<uint32_t, Endian>(
Version);
1426 using namespace coverage;
1428 return CounterExpression(CounterExpression::ExprKind::Subtract,
1429 Counter::getCounter(~0U),
1430 Counter::getCounter(~0U));
1434 using namespace coverage;
1436 return CounterExpression(CounterExpression::ExprKind::Add,
1437 Counter::getCounter(~0U),
1438 Counter::getCounter(~0U));
1442 return static_cast<unsigned>(
1443 hash_combine(V.Kind, V.LHS.getKind(), V.LHS.getCounterID(),
1444 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...
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
CounterMappingContext(ArrayRef< CounterExpression > Expressions, ArrayRef< uint64_t > CounterValues={})
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)
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
const CounterMappingRegion & getDecisionRegion() 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.