|
LLVM 24.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 = std::array<BitVector, 2> |
| 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, TestVectors &&NotExecutedTV, BoolVector &&Folded, CondIDMap &&PosToID, LineColPairMap &&CondLoc) | |
| LLVM_ABI void | findIndependencePairs () |
| const CounterMappingRegion & | getDecisionRegion () const |
| unsigned | getNumConditions () const |
| unsigned | getNumTestVectors () const |
| unsigned | getNumNotExecutedTestVectors () 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 | getNotExecutedTVCondition (unsigned NotExecutedIndex, unsigned Condition) |
| std::pair< unsigned, unsigned > | getDecisions () const |
| Return the number of True and False decisions for all executed test vectors. | |
| CondState | getTVResult (unsigned TestVectorIndex) |
| Return the Result evaluation for an executed test vector. | |
| CondState | getNotExecutedTVResult (unsigned NotExecutedIndex) |
| 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 | getNotExecutedTestVectorString (unsigned NotExecutedIndex) |
| std::string | getConditionCoverageString (unsigned Condition) |
MCDC Record grouping all information together.
Definition at line 388 of file CoverageMapping.h.
| using llvm::coverage::MCDCRecord::BoolVector = std::array<BitVector, 2> |
Definition at line 450 of file CoverageMapping.h.
Definition at line 453 of file CoverageMapping.h.
Definition at line 454 of file CoverageMapping.h.
| using llvm::coverage::MCDCRecord::TestVectors = llvm::SmallVector<std::pair<TestVector, CondState>> |
Definition at line 449 of file CoverageMapping.h.
Definition at line 452 of file CoverageMapping.h.
| using llvm::coverage::MCDCRecord::TVRowPair = std::pair<unsigned, unsigned> |
Definition at line 451 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 395 of file CoverageMapping.h.
|
inline |
Definition at line 504 of file CoverageMapping.h.
References findIndependencePairs(), and llvm::move().
| void MCDCRecord::findIndependencePairs | ( | ) |
Definition at line 252 of file CoverageMapping.cpp.
References A(), assert(), B(), llvm::find_if(), I, MCDC_False, and MCDC_True.
Referenced by MCDCRecord().
|
inline |
Definition at line 640 of file CoverageMapping.h.
References assert(), getConditionIndependencePair(), getNumConditions(), isCondFolded(), and isConditionIndependencePairCovered().
|
inline |
Definition at line 601 of file CoverageMapping.h.
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 579 of file CoverageMapping.h.
References assert(), and isConditionIndependencePairCovered().
Referenced by getConditionCoverageString().
|
inline |
Definition at line 517 of file CoverageMapping.h.
Return the number of True and False decisions for all executed test vectors.
Definition at line 545 of file CoverageMapping.h.
References llvm::count(), llvm::make_second_range(), and MCDC_True.
|
inline |
Definition at line 632 of file CoverageMapping.h.
References assert(), getNumNotExecutedTestVectors(), and getNumTestVectors().
|
inline |
Definition at line 538 of file CoverageMapping.h.
Definition at line 558 of file CoverageMapping.h.
|
inline |
Definition at line 518 of file CoverageMapping.h.
Referenced by getConditionCoverageString(), getPercentCovered(), and getTestVectorHeaderString().
|
inline |
Definition at line 522 of file CoverageMapping.h.
Referenced by getNotExecutedTestVectorString(), and getTestVectorHeaderString().
|
inline |
Definition at line 521 of file CoverageMapping.h.
Referenced by getNotExecutedTestVectorString(), getTestVectorHeaderString(), and getTestVectorString().
|
inline |
Definition at line 585 of file CoverageMapping.h.
References C(), getNumConditions(), isCondFolded(), isConditionIndependencePairCovered(), and llvm::Total.
|
inline |
Definition at line 609 of file CoverageMapping.h.
References getNumConditions(), getNumNotExecutedTestVectors(), getNumTestVectors(), and I.
|
inline |
Definition at line 625 of file CoverageMapping.h.
References assert(), and getNumTestVectors().
|
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 534 of file CoverageMapping.h.
Return the Result evaluation for an executed test vector.
See MCDCRecordProcessor::RecordTestVector().
Definition at line 554 of file CoverageMapping.h.
Definition at line 524 of file CoverageMapping.h.
Referenced by getConditionCoverageString(), and getPercentCovered().
|
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 567 of file CoverageMapping.h.
References assert().
Referenced by getConditionCoverageString(), getConditionIndependencePair(), and getPercentCovered().