LLVM 20.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
llvm::coverage::CounterMappingRegion Struct Reference

A Counter mapping region associates a source range with a specific counter. More...

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

Inheritance diagram for llvm::coverage::CounterMappingRegion:
Inheritance graph
[legend]

Public Types

enum  RegionKind {
  CodeRegion , ExpansionRegion , SkippedRegion , GapRegion ,
  BranchRegion , MCDCDecisionRegion , MCDCBranchRegion
}
 

Public Member Functions

const auto & getDecisionParams () const
 
const auto & getBranchParams () const
 
bool isBranch () const
 
 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())
 
 CounterMappingRegion (const mcdc::DecisionParameters &MCDCParams, unsigned FileID, unsigned LineStart, unsigned ColumnStart, unsigned LineEnd, unsigned ColumnEnd, RegionKind Kind)
 
LineColPair startLoc () const
 
LineColPair endLoc () const
 

Static Public Member Functions

static CounterMappingRegion makeRegion (Counter Count, unsigned FileID, unsigned LineStart, unsigned ColumnStart, unsigned LineEnd, unsigned ColumnEnd)
 
static CounterMappingRegion makeExpansion (unsigned FileID, unsigned ExpandedFileID, unsigned LineStart, unsigned ColumnStart, unsigned LineEnd, unsigned ColumnEnd)
 
static CounterMappingRegion makeSkipped (unsigned FileID, unsigned LineStart, unsigned ColumnStart, unsigned LineEnd, unsigned ColumnEnd)
 
static CounterMappingRegion makeGapRegion (Counter Count, unsigned FileID, unsigned LineStart, unsigned ColumnStart, unsigned LineEnd, unsigned ColumnEnd)
 
static CounterMappingRegion makeBranchRegion (Counter Count, Counter FalseCount, unsigned FileID, unsigned LineStart, unsigned ColumnStart, unsigned LineEnd, unsigned ColumnEnd, const mcdc::Parameters &MCDCParams=std::monostate())
 
static CounterMappingRegion makeDecisionRegion (const mcdc::DecisionParameters &MCDCParams, unsigned FileID, unsigned LineStart, unsigned ColumnStart, unsigned LineEnd, unsigned ColumnEnd)
 

Public Attributes

Counter Count
 Primary Counter that is also used for Branch Regions (TrueCount).
 
Counter FalseCount
 Secondary Counter used for Branch Regions (FalseCount).
 
mcdc::Parameters MCDCParams
 Parameters used for Modified Condition/Decision Coverage.
 
unsigned FileID = 0
 
unsigned ExpandedFileID = 0
 
unsigned LineStart
 
unsigned ColumnStart
 
unsigned LineEnd
 
unsigned ColumnEnd
 
RegionKind Kind
 

Detailed Description

A Counter mapping region associates a source range with a specific counter.

Definition at line 221 of file CoverageMapping.h.

Member Enumeration Documentation

◆ RegionKind

Enumerator
CodeRegion 

A CodeRegion associates some code with a counter.

ExpansionRegion 

An ExpansionRegion represents a file expansion region that associates a source range with the expansion of a virtual source file, such as for a macro instantiation or #include file.

SkippedRegion 

A SkippedRegion represents a source range with code that was skipped by a preprocessor or similar means.

GapRegion 

A GapRegion is like a CodeRegion, but its count is only set as the line execution count when its the only region in the line.

BranchRegion 

A BranchRegion represents leaf-level boolean expressions and is associated with two counters, each representing the number of times the expression evaluates to true or false.

MCDCDecisionRegion 

A DecisionRegion represents a top-level boolean expression and is associated with a variable length bitmap index and condition number.

MCDCBranchRegion 

A Branch Region can be extended to include IDs to facilitate MC/DC.

Definition at line 222 of file CoverageMapping.h.

Constructor & Destructor Documentation

◆ CounterMappingRegion() [1/3]

llvm::coverage::CounterMappingRegion::CounterMappingRegion ( Counter  Count,
unsigned  FileID,
unsigned  ExpandedFileID,
unsigned  LineStart,
unsigned  ColumnStart,
unsigned  LineEnd,
unsigned  ColumnEnd,
RegionKind  Kind 
)
inline

Definition at line 279 of file CoverageMapping.h.

◆ CounterMappingRegion() [2/3]

llvm::coverage::CounterMappingRegion::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() 
)
inline

Definition at line 286 of file CoverageMapping.h.

◆ CounterMappingRegion() [3/3]

llvm::coverage::CounterMappingRegion::CounterMappingRegion ( const mcdc::DecisionParameters MCDCParams,
unsigned  FileID,
unsigned  LineStart,
unsigned  ColumnStart,
unsigned  LineEnd,
unsigned  ColumnEnd,
RegionKind  Kind 
)
inline

Definition at line 296 of file CoverageMapping.h.

Member Function Documentation

◆ endLoc()

LineColPair llvm::coverage::CounterMappingRegion::endLoc ( ) const
inline

Definition at line 358 of file CoverageMapping.h.

References ColumnEnd, and LineEnd.

Referenced by llvm::coverage::CoverageMappingWriter::write().

◆ getBranchParams()

const auto & llvm::coverage::CounterMappingRegion::getBranchParams ( ) const
inline

Definition at line 265 of file CoverageMapping.h.

References MCDCParams.

◆ getDecisionParams()

const auto & llvm::coverage::CounterMappingRegion::getDecisionParams ( ) const
inline

Definition at line 261 of file CoverageMapping.h.

References MCDCParams.

◆ isBranch()

bool llvm::coverage::CounterMappingRegion::isBranch ( ) const
inline

Definition at line 275 of file CoverageMapping.h.

References BranchRegion, Kind, and MCDCBranchRegion.

◆ makeBranchRegion()

static CounterMappingRegion llvm::coverage::CounterMappingRegion::makeBranchRegion ( Counter  Count,
Counter  FalseCount,
unsigned  FileID,
unsigned  LineStart,
unsigned  ColumnStart,
unsigned  LineEnd,
unsigned  ColumnEnd,
const mcdc::Parameters MCDCParams = std::monostate() 
)
inlinestatic

◆ makeDecisionRegion()

static CounterMappingRegion llvm::coverage::CounterMappingRegion::makeDecisionRegion ( const mcdc::DecisionParameters MCDCParams,
unsigned  FileID,
unsigned  LineStart,
unsigned  ColumnStart,
unsigned  LineEnd,
unsigned  ColumnEnd 
)
inlinestatic

Definition at line 347 of file CoverageMapping.h.

References ColumnEnd, ColumnStart, FileID, LineEnd, LineStart, MCDCDecisionRegion, and MCDCParams.

◆ makeExpansion()

static CounterMappingRegion llvm::coverage::CounterMappingRegion::makeExpansion ( unsigned  FileID,
unsigned  ExpandedFileID,
unsigned  LineStart,
unsigned  ColumnStart,
unsigned  LineEnd,
unsigned  ColumnEnd 
)
inlinestatic

◆ makeGapRegion()

static CounterMappingRegion llvm::coverage::CounterMappingRegion::makeGapRegion ( Counter  Count,
unsigned  FileID,
unsigned  LineStart,
unsigned  ColumnStart,
unsigned  LineEnd,
unsigned  ColumnEnd 
)
inlinestatic

Definition at line 327 of file CoverageMapping.h.

References ColumnEnd, ColumnStart, Count, FileID, GapRegion, LineEnd, and LineStart.

◆ makeRegion()

static CounterMappingRegion llvm::coverage::CounterMappingRegion::makeRegion ( Counter  Count,
unsigned  FileID,
unsigned  LineStart,
unsigned  ColumnStart,
unsigned  LineEnd,
unsigned  ColumnEnd 
)
inlinestatic

Definition at line 305 of file CoverageMapping.h.

References CodeRegion, ColumnEnd, ColumnStart, Count, FileID, LineEnd, and LineStart.

◆ makeSkipped()

static CounterMappingRegion llvm::coverage::CounterMappingRegion::makeSkipped ( unsigned  FileID,
unsigned  LineStart,
unsigned  ColumnStart,
unsigned  LineEnd,
unsigned  ColumnEnd 
)
inlinestatic

Definition at line 320 of file CoverageMapping.h.

References ColumnEnd, ColumnStart, FileID, LineEnd, LineStart, and SkippedRegion.

◆ startLoc()

LineColPair llvm::coverage::CounterMappingRegion::startLoc ( ) const
inline

Definition at line 354 of file CoverageMapping.h.

References ColumnStart, and LineStart.

Referenced by llvm::coverage::CoverageMappingWriter::write().

Member Data Documentation

◆ ColumnEnd

unsigned llvm::coverage::CounterMappingRegion::ColumnEnd

◆ ColumnStart

unsigned llvm::coverage::CounterMappingRegion::ColumnStart

◆ Count

Counter llvm::coverage::CounterMappingRegion::Count

Primary Counter that is also used for Branch Regions (TrueCount).

Definition at line 253 of file CoverageMapping.h.

Referenced by makeBranchRegion(), makeGapRegion(), and makeRegion().

◆ ExpandedFileID

unsigned llvm::coverage::CounterMappingRegion::ExpandedFileID = 0

Definition at line 270 of file CoverageMapping.h.

Referenced by makeExpansion().

◆ FalseCount

Counter llvm::coverage::CounterMappingRegion::FalseCount

Secondary Counter used for Branch Regions (FalseCount).

Definition at line 256 of file CoverageMapping.h.

Referenced by makeBranchRegion().

◆ FileID

unsigned llvm::coverage::CounterMappingRegion::FileID = 0

◆ Kind

RegionKind llvm::coverage::CounterMappingRegion::Kind

Definition at line 273 of file CoverageMapping.h.

Referenced by isBranch().

◆ LineEnd

unsigned llvm::coverage::CounterMappingRegion::LineEnd

◆ LineStart

unsigned llvm::coverage::CounterMappingRegion::LineStart

◆ MCDCParams

mcdc::Parameters llvm::coverage::CounterMappingRegion::MCDCParams

Parameters used for Modified Condition/Decision Coverage.

Definition at line 259 of file CoverageMapping.h.

Referenced by getBranchParams(), getDecisionParams(), makeBranchRegion(), and makeDecisionRegion().


The documentation for this struct was generated from the following file: