LLVM 20.0.0git
|
MCDC Record grouping all information together. More...
#include "llvm/ProfileData/Coverage/CoverageMapping.h"
Classes | |
class | TestVector |
Emulate SmallVector<CondState> with a pair of BitVector. More... | |
Public Types | |
enum | CondState { MCDC_DontCare = -1 , MCDC_False = 0 , MCDC_True = 1 } |
CondState represents the evaluation of a condition in an executed test vector, which can be True or False. More... | |
using | TestVectors = llvm::SmallVector< std::pair< TestVector, CondState > > |
using | BoolVector = llvm::SmallVector< bool > |
using | TVRowPair = std::pair< unsigned, unsigned > |
using | TVPairMap = llvm::DenseMap< unsigned, TVRowPair > |
using | CondIDMap = llvm::DenseMap< unsigned, unsigned > |
using | LineColPairMap = llvm::DenseMap< unsigned, LineColPair > |
Public Member Functions | |
MCDCRecord (const CounterMappingRegion &Region, TestVectors &&TV, TVPairMap &&IndependencePairs, BoolVector &&Folded, CondIDMap &&PosToID, LineColPairMap &&CondLoc) | |
const CounterMappingRegion & | getDecisionRegion () const |
unsigned | getNumConditions () const |
unsigned | getNumTestVectors () const |
bool | isCondFolded (unsigned Condition) const |
CondState | getTVCondition (unsigned TestVectorIndex, unsigned Condition) |
Return the evaluation of a condition (indicated by Condition) in an executed test vector (indicated by TestVectorIndex), which will be True, False, or DontCare if the condition is unevaluatable. | |
CondState | getTVResult (unsigned TestVectorIndex) |
Return the Result evaluation for an executed test vector. | |
bool | isConditionIndependencePairCovered (unsigned Condition) const |
Determine whether a given condition (indicated by Condition) is covered by an Independence Pair. | |
TVRowPair | getConditionIndependencePair (unsigned Condition) |
Return the Independence Pair that covers the given condition. | |
float | getPercentCovered () const |
std::string | getConditionHeaderString (unsigned Condition) |
std::string | getTestVectorHeaderString () const |
std::string | getTestVectorString (unsigned TestVectorIndex) |
std::string | getConditionCoverageString (unsigned Condition) |
MCDC Record grouping all information together.
Definition at line 383 of file CoverageMapping.h.
Definition at line 445 of file CoverageMapping.h.
Definition at line 448 of file CoverageMapping.h.
Definition at line 449 of file CoverageMapping.h.
using llvm::coverage::MCDCRecord::TestVectors = llvm::SmallVector<std::pair<TestVector, CondState> > |
Definition at line 444 of file CoverageMapping.h.
Definition at line 447 of file CoverageMapping.h.
using llvm::coverage::MCDCRecord::TVRowPair = std::pair<unsigned, unsigned> |
Definition at line 446 of file CoverageMapping.h.
CondState represents the evaluation of a condition in an executed test vector, which can be True or False.
A DontCare is used to mask an unevaluatable condition resulting from short-circuit behavior of logical operators in languages like C/C++. When comparing the evaluation of a condition across executed test vectors, comparisons against a DontCare are effectively ignored.
Enumerator | |
---|---|
MCDC_DontCare | |
MCDC_False | |
MCDC_True |
Definition at line 390 of file CoverageMapping.h.
|
inline |
Definition at line 460 of file CoverageMapping.h.
|
inline |
Definition at line 591 of file CoverageMapping.h.
References assert(), getConditionIndependencePair(), getNumConditions(), isCondFolded(), isConditionIndependencePairCovered(), and OS.
|
inline |
Definition at line 529 of file CoverageMapping.h.
References OS.
Return the Independence Pair that covers the given condition.
Because condition IDs are not associated based on their position in the expression, accessing conditions in the TestVectors requires a translation from a ordinal position to actual condition ID. This is done via PosToID[].
Definition at line 508 of file CoverageMapping.h.
References assert(), and isConditionIndependencePairCovered().
Referenced by getConditionCoverageString().
|
inline |
Definition at line 468 of file CoverageMapping.h.
|
inline |
Definition at line 469 of file CoverageMapping.h.
Referenced by getConditionCoverageString(), getPercentCovered(), getTestVectorHeaderString(), and getTestVectorString().
|
inline |
Definition at line 472 of file CoverageMapping.h.
References llvm::SmallVectorBase< Size_T >::size().
Referenced by getTestVectorHeaderString(), and getTestVectorString().
|
inline |
Definition at line 513 of file CoverageMapping.h.
References llvm::CallingConv::C, getNumConditions(), isCondFolded(), isConditionIndependencePairCovered(), and llvm::Total.
|
inline |
Definition at line 537 of file CoverageMapping.h.
References getNumConditions(), getNumTestVectors(), I, and OS.
|
inline |
Definition at line 553 of file CoverageMapping.h.
References assert(), getNumConditions(), getNumTestVectors(), getTVCondition(), getTVResult(), isCondFolded(), MCDC_DontCare, MCDC_False, MCDC_True, and OS.
|
inline |
Return the evaluation of a condition (indicated by Condition) in an executed test vector (indicated by TestVectorIndex), which will be True, False, or DontCare if the condition is unevaluatable.
Because condition IDs are not associated based on their position in the expression, accessing conditions in the TestVectors requires a translation from a ordinal position to actual condition ID. This is done via PosToID[].
Definition at line 481 of file CoverageMapping.h.
Referenced by getTestVectorString().
Return the Result evaluation for an executed test vector.
See MCDCRecordProcessor::RecordTestVector().
Definition at line 487 of file CoverageMapping.h.
Referenced by getTestVectorString().
Definition at line 473 of file CoverageMapping.h.
Referenced by getConditionCoverageString(), getPercentCovered(), and getTestVectorString().
|
inline |
Determine whether a given condition (indicated by Condition) is covered by an Independence Pair.
Because condition IDs are not associated based on their position in the expression, accessing conditions in the TestVectors requires a translation from a ordinal position to actual condition ID. This is done via PosToID[].
Definition at line 496 of file CoverageMapping.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::contains(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), and llvm_unreachable.
Referenced by getConditionCoverageString(), getConditionIndependencePair(), and getPercentCovered().