LLVM  14.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]
Collaboration diagram for llvm::coverage::CounterMappingRegion:
Collaboration graph
[legend]

Public Types

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

Public Member Functions

 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)
 
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)
 

Public Attributes

Counter Count
 Primary Counter that is also used for Branch Regions (TrueCount). More...
 
Counter FalseCount
 Secondary Counter used for Branch Regions (FalseCount). More...
 
unsigned FileID
 
unsigned ExpandedFileID
 
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 208 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.

Definition at line 209 of file CoverageMapping.h.

Constructor & Destructor Documentation

◆ CounterMappingRegion() [1/2]

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

◆ CounterMappingRegion() [2/2]

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

Definition at line 249 of file CoverageMapping.h.

Member Function Documentation

◆ endLoc()

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

Definition at line 299 of file CoverageMapping.h.

References ColumnEnd, and LineEnd.

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

◆ makeBranchRegion()

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

◆ 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

◆ makeRegion()

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

◆ makeSkipped()

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

◆ startLoc()

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

Definition at line 295 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 233 of file CoverageMapping.h.

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

◆ ExpandedFileID

unsigned llvm::coverage::CounterMappingRegion::ExpandedFileID

Definition at line 238 of file CoverageMapping.h.

Referenced by makeExpansion().

◆ FalseCount

Counter llvm::coverage::CounterMappingRegion::FalseCount

Secondary Counter used for Branch Regions (FalseCount).

Definition at line 236 of file CoverageMapping.h.

Referenced by makeBranchRegion().

◆ FileID

unsigned llvm::coverage::CounterMappingRegion::FileID

◆ Kind

RegionKind llvm::coverage::CounterMappingRegion::Kind

Definition at line 240 of file CoverageMapping.h.

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

◆ LineEnd

unsigned llvm::coverage::CounterMappingRegion::LineEnd

◆ LineStart

unsigned llvm::coverage::CounterMappingRegion::LineStart

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