LLVM 19.0.0git
Classes | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
llvm::coverage::mcdc::TVIdxBuilder Class Reference

Compute TestVector Indices "TVIdx" from the Conds graph. More...

#include "llvm/ProfileData/Coverage/CoverageMapping.h"

Classes

struct  MCDCNode
 

Public Member Functions

 TVIdxBuilder (const SmallVectorImpl< ConditionIDs > &NextIDs, int Offset=0)
 Calculate and assign Indices.
 

Public Attributes

SmallVector< MCDCNodeSavedNodes
 This is no longer needed after the assignment.
 
SmallVector< std::array< int, 2 > > Indices
 Output: Index for TestVectors bitmap (These are not CondIDs)
 
int NumTestVectors
 Output: The number of test vectors.
 

Static Public Attributes

static constexpr auto HardMaxTVs
 Hard limit of test vectors.
 

Detailed Description

Compute TestVector Indices "TVIdx" from the Conds graph.

Clang CodeGen handles the bitmap index based on TVIdx. llvm-cov reconstructs conditions from TVIdx.

For each leaf "The final decision",

Definition at line 623 of file CoverageMapping.h.

Constructor & Destructor Documentation

◆ TVIdxBuilder()

mcdc::TVIdxBuilder::TVIdxBuilder ( const SmallVectorImpl< ConditionIDs > &  NextIDs,
int  Offset = 0 
)

Calculate and assign Indices.

Parameters
NextIDsThe list of {FalseID, TrueID} indexed by ID The first element [0] should be the root node.
OffsetOffset of index to final decisions.

-Width

Ord

ID

Cond (0 or 1)

Definition at line 226 of file CoverageMapping.cpp.

References assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::CallingConv::C, llvm::SmallVectorBase< Size_T >::empty(), llvm::SmallVectorImpl< T >::erase(), HardMaxTVs, I, Idx, Indices, N, NumTestVectors, llvm::Offset, llvm::SmallVectorTemplateBase< T, bool >::push_back(), SavedNodes, llvm::SmallVectorBase< Size_T >::size(), llvm::size(), and llvm::sort().

Member Data Documentation

◆ HardMaxTVs

constexpr auto llvm::coverage::mcdc::TVIdxBuilder::HardMaxTVs
staticconstexpr
Initial value:
=
std::numeric_limits<decltype(NumTestVectors)>::max()
int NumTestVectors
Output: The number of test vectors.
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)

Hard limit of test vectors.

Definition at line 645 of file CoverageMapping.h.

Referenced by TVIdxBuilder().

◆ Indices

SmallVector<std::array<int, 2> > llvm::coverage::mcdc::TVIdxBuilder::Indices

Output: Index for TestVectors bitmap (These are not CondIDs)

Definition at line 638 of file CoverageMapping.h.

Referenced by TVIdxBuilder().

◆ NumTestVectors

int llvm::coverage::mcdc::TVIdxBuilder::NumTestVectors

Output: The number of test vectors.

Error with HardMaxTVs if the number has exploded.

Definition at line 642 of file CoverageMapping.h.

Referenced by TVIdxBuilder().

◆ SavedNodes

SmallVector<MCDCNode> llvm::coverage::mcdc::TVIdxBuilder::SavedNodes

This is no longer needed after the assignment.

It may be used in assert() for reconfirmation.

Definition at line 634 of file CoverageMapping.h.

Referenced by TVIdxBuilder().


The documentation for this class was generated from the following files: