14#ifndef LLVM_PROFILEDATA_COVERAGE_COVERAGEMAPPING_H
15#define LLVM_PROFILEDATA_COVERAGE_COVERAGEMAPPING_H
42#include <system_error>
48class IndexedInstrProfReader;
83 : Err(Err), Msg(ErrStr.str()) {
87 std::string
message()
const override;
144 return std::tie(
LHS.Kind,
LHS.ID) < std::tie(
RHS.Kind,
RHS.ID);
177 std::vector<CounterExpression> Expressions;
194 Term(
unsigned CounterID,
int Factor)
195 : CounterID(CounterID), Factor(Factor) {}
272 return mcdc::getParams<const mcdc::DecisionParameters>(
MCDCParams);
276 return mcdc::getParams<const mcdc::BranchParameters>(
MCDCParams);
442 const auto &
A = *
this;
461 std::optional<TVPairMap> IndependencePairs;
480 return Region.getDecisionParams().NumConditions;
484 return Folded[
false][Condition] || Folded[
true][Condition];
494 return TV[TestVectorIndex].first[PosToID[Condition]];
500 return TV[TestVectorIndex].second;
509 assert(IndependencePairs);
510 auto It = PosToID.
find(Condition);
511 assert(It != PosToID.
end() &&
"Condition ID without an Ordinal mapping");
512 return IndependencePairs->contains(It->second);
522 assert(IndependencePairs);
523 return (*IndependencePairs)[PosToID[Condition]];
528 unsigned Covered = 0;
539 return (
static_cast<double>(Covered) /
static_cast<double>(
Total)) * 100.0;
543 std::ostringstream
OS;
544 OS <<
"Condition C" << Condition + 1 <<
" --> (";
545 OS << CondLoc[Condition].first <<
":" << CondLoc[Condition].second;
551 std::ostringstream
OS;
557 for (
unsigned I = 0;
I < NumConditions;
I++) {
559 if (
I != NumConditions - 1)
568 "TestVector index out of bounds!");
569 std::ostringstream
OS;
572 OS <<
" " << TestVectorIndex + 1 <<
" { ";
573 for (
unsigned Condition = 0; Condition < NumConditions; Condition++) {
589 if (Condition != NumConditions - 1)
606 "Condition index is out of bounds!");
607 std::ostringstream
OS;
609 OS <<
" C" << Condition + 1 <<
"-Pair: ";
611 OS <<
"constant folded\n";
614 OS <<
"covered: (" << rows.first <<
",";
615 OS << rows.second <<
")\n";
617 OS <<
"not covered\n";
682 : Expressions(Expressions), CounterValues(CounterValues) {}
753 std::forward_iterator_tag, FunctionRecord> {
759 void skipOtherFiles();
764 : Records(Records_), Current(Records.begin()), Filename(Filename) {
771 return Current ==
RHS.Current && Filename ==
RHS.Filename;
777 assert(Current != Records.end() &&
"incremented past end");
826 bool IsBranchRegion =
false)
831 return std::tie(L.Line, L.Col, L.Count, L.HasCount, L.IsRegionEntry,
832 L.IsGapRegion) == std::tie(R.Line, R.Col, R.Count,
833 R.HasCount, R.IsRegionEntry,
848 std::vector<const FunctionRecord *> Instantiations;
851 std::vector<const FunctionRecord *> Instantiations)
852 : Line(Line), Col(Col), Instantiations(
std::
move(Instantiations)) {}
859 size_t size()
const {
return Instantiations.size(); }
869 for (
unsigned I = 1,
E = Instantiations.size();
I <
E; ++
I)
870 if (Instantiations[
I]->
Name != Instantiations[0]->
Name)
877 assert(
hasName() &&
"Instantiations don't have a shared name");
878 return Instantiations[0]->Name;
885 Count +=
F->ExecutionCount;
891 return Instantiations;
903 std::string Filename;
904 std::vector<CoverageSegment> Segments;
905 std::vector<ExpansionRecord> Expansions;
906 std::vector<CountedRegion> BranchRegions;
907 std::vector<MCDCRecord> MCDCRecords;
909 bool SingleByteCoverage =
false;
924 std::vector<CoverageSegment>::const_iterator
begin()
const {
925 return Segments.begin();
928 std::vector<CoverageSegment>::const_iterator
end()
const {
929 return Segments.end();
932 bool empty()
const {
return Segments.empty(); }
950 std::vector<FunctionRecord> Functions;
952 std::vector<std::pair<std::string, uint64_t>> FuncHashMismatches;
954 std::optional<bool> SingleByteCoverage;
959 static Error loadFromReaders(
960 ArrayRef<std::unique_ptr<CoverageMappingReader>> CoverageReaders,
979 getImpreciseRecordIndicesForFilename(
StringRef Filename)
const;
987 load(
ArrayRef<std::unique_ptr<CoverageMappingReader>> CoverageReaders,
998 bool CheckBinaryIDs =
false);
1011 return FuncHashMismatches;
1048 std::vector<InstantiationGroup>
1055 bool HasMultipleRegions;
1077 return LineSegments;
1087 std::forward_iterator_tag,
1088 const LineCoverageStats> {
1094 : CD(CD), WrappedSegment(nullptr), Next(CD.begin()), Ended(
false),
1100 return &CD == &R.CD && Next == R.Next && Ended == R.Ended;
1109 EndIt.Next = CD.
end();
1117 std::vector<CoverageSegment>::const_iterator Next;
1128 auto End = Begin.getEnd();
1159namespace accessors {
1162template <
class FuncRecordTy, llvm::endianness Endian>
1164 return support::endian::byte_swap<uint64_t, Endian>(
Record->FuncHash);
1168template <
class FuncRecordTy, llvm::endianness Endian>
1170 return support::endian::byte_swap<uint32_t, Endian>(
Record->DataSize);
1174template <
class FuncRecordTy, llvm::endianness Endian>
1176 return support::endian::byte_swap<uint64_t, Endian>(
Record->NameRef);
1181template <
class FuncRecordTy, llvm::endianness Endian>
1192template <
class FuncRecordTy, llvm::endianness Endian>
1194 const char *MappingBuf) {
1195 return {MappingBuf, size_t(getDataSize<FuncRecordTy, Endian>(
Record))};
1200template <
class FuncRecordTy, llvm::endianness Endian>
1201std::pair<const char *, const FuncRecordTy *>
1203 return {MappingBuf + getDataSize<FuncRecordTy, Endian>(
Record),
Record + 1};
1209template <
class IntPtrT>
1214#define COVMAP_FUNC_RECORD(Type, LLVMType, Name, Init) Type Name;
1220 return accessors::getFuncHash<ThisT, Endian>(
this);
1224 return accessors::getDataSize<ThisT, Endian>(
this);
1229 return support::endian::byte_swap<IntPtrT, Endian>(NamePtr);
1233 template <llvm::endianness Endian>
1235 IntPtrT NameRef = getFuncNameRef<Endian>();
1237 FuncName = ProfileNames.
getFuncName(NameRef, NameS);
1238 if (NameS && FuncName.
empty())
1240 "function name is empty");
1244 template <llvm::endianness Endian>
1245 std::pair<const char *, const ThisT *>
1247 return accessors::advanceByOneOutOfLine<ThisT, Endian>(
this, MappingBuf);
1254 template <llvm::endianness Endian>
1256 return accessors::getCoverageMappingOutOfLine<ThisT, Endian>(
this,
1265#define COVMAP_FUNC_RECORD(Type, LLVMType, Name, Init) Type Name;
1271 return accessors::getFuncHash<ThisT, Endian>(
this);
1275 return accessors::getDataSize<ThisT, Endian>(
this);
1279 return accessors::getFuncNameRef<ThisT, Endian>(
this);
1282 template <llvm::endianness Endian>
1284 return accessors::getFuncNameViaRef<ThisT, Endian>(
this, ProfileNames,
1288 template <llvm::endianness Endian>
1289 std::pair<const char *, const ThisT *>
1291 return accessors::advanceByOneOutOfLine<ThisT, Endian>(
this, MappingBuf);
1298 template <llvm::endianness Endian>
1300 return accessors::getCoverageMappingOutOfLine<ThisT, Endian>(
this,
1309#define COVMAP_FUNC_RECORD(Type, LLVMType, Name, Init) Type Name;
1315 return accessors::getFuncHash<ThisT, Endian>(
this);
1319 return accessors::getDataSize<ThisT, Endian>(
this);
1323 return accessors::getFuncNameRef<ThisT, Endian>(
this);
1326 template <llvm::endianness Endian>
1328 return accessors::getFuncNameViaRef<ThisT, Endian>(
this, ProfileNames,
1334 return support::endian::byte_swap<uint64_t, Endian>(FilenamesRef);
1339 template <llvm::endianness Endian>
1346 template <llvm::endianness Endian>
1347 std::pair<const char *, const CovMapFunctionRecordV3 *>
1351 sizeof(
char) + getDataSize<Endian>();
1362#define COVMAP_HEADER(Type, LLVMType, Name, Init) Type Name;
1365 return support::endian::byte_swap<uint32_t, Endian>(NRecords);
1369 return support::endian::byte_swap<uint32_t, Endian>(FilenamesSize);
1373 return support::endian::byte_swap<uint32_t, Endian>(CoverageSize);
1377 return support::endian::byte_swap<uint32_t, Endian>(
Version);
1444 using namespace coverage;
1446 return CounterExpression(CounterExpression::ExprKind::Subtract,
1447 Counter::getCounter(~0U),
1448 Counter::getCounter(~0U));
1452 using namespace coverage;
1454 return CounterExpression(CounterExpression::ExprKind::Add,
1455 Counter::getCounter(~0U),
1456 Counter::getCounter(~0U));
1460 return static_cast<unsigned>(
1461 hash_combine(V.Kind, V.LHS.getKind(), V.LHS.getCounterID(),
1462 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)
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.
Counter subst(Counter C, const SubstMap &Map)
std::map< Counter, Counter > SubstMap
K to V map.
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.
bool getSingleByteCoverage() const
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(bool Single, 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.
CountedRegion(const CounterMappingRegion &R, uint64_t ExecutionCount, uint64_t FalseExecutionCount)
CountedRegion(const CounterMappingRegion &R, uint64_t ExecutionCount)
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)
MCDC Record grouping all information together.
std::pair< unsigned, unsigned > TVRowPair
MCDCRecord(const CounterMappingRegion &Region, TestVectors &&TV, BoolVector &&Folded, CondIDMap &&PosToID, LineColPairMap &&CondLoc)
float getPercentCovered() const
std::string getConditionCoverageString(unsigned Condition)
std::string getConditionHeaderString(unsigned Condition)
unsigned getNumTestVectors() const
void findIndependencePairs()
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
std::array< BitVector, 2 > BoolVector
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.