LLVM 22.0.0git
llvm::GCOVBlock Class Reference

GCOVBlock - Collects block information. More...

#include "llvm/ProfileData/GCOV.h"

Public Types

using EdgeIterator = SmallVectorImpl<GCOVArc *>::const_iterator
using BlockVector = SmallVector<const GCOVBlock *, 1>
using BlockVectorLists = SmallVector<BlockVector, 4>
using Edges = SmallVector<GCOVArc *, 4>

Public Member Functions

 GCOVBlock (uint32_t N)
void addLine (uint32_t N)
void addFile (unsigned fileIdx)
uint32_t getLastLine () const
uint64_t getCount () const
void addSrcEdge (GCOVArc *Edge)
void addDstEdge (GCOVArc *Edge)
iterator_range< EdgeIteratorsrcs () const
iterator_range< EdgeIteratordsts () const
LLVM_ABI void print (raw_ostream &OS) const
 collectLineCounts - Collect line counts.
LLVM_ABI void dump () const
 dump - Dump GCOVBlock content to dbgs() for debugging purposes.

Static Public Member Functions

static LLVM_ABI uint64_t augmentOneCycle (GCOVBlock *src, std::vector< std::pair< GCOVBlock *, size_t > > &stack)
static LLVM_ABI uint64_t getCyclesCount (const BlockVector &blocks)
static LLVM_ABI uint64_t getLineCount (const BlockVector &Blocks)

Public Attributes

uint32_t number
uint64_t count = 0
SmallVector< GCOVArc *, 2 > pred
SmallVector< GCOVArc *, 2 > succ
SmallVector< GCOVBlockLocationlocations
uint32_t lastLine = 0
bool traversable = false
GCOVArcincoming = nullptr

Detailed Description

GCOVBlock - Collects block information.

Definition at line 283 of file GCOV.h.

Member Typedef Documentation

◆ BlockVector

Definition at line 286 of file GCOV.h.

◆ BlockVectorLists

Definition at line 287 of file GCOV.h.

◆ EdgeIterator

◆ Edges

Definition at line 288 of file GCOV.h.

Constructor & Destructor Documentation

◆ GCOVBlock()

llvm::GCOVBlock::GCOVBlock ( uint32_t N)
inline

Definition at line 290 of file GCOV.h.

References N, and number.

Referenced by augmentOneCycle(), and getCyclesCount().

Member Function Documentation

◆ addDstEdge()

void llvm::GCOVBlock::addDstEdge ( GCOVArc * Edge)
inline

Definition at line 303 of file GCOV.h.

References succ.

Referenced by llvm::GCOVFile::readGCNO().

◆ addFile()

void llvm::GCOVBlock::addFile ( unsigned fileIdx)
inline

Definition at line 296 of file GCOV.h.

References locations.

◆ addLine()

void llvm::GCOVBlock::addLine ( uint32_t N)
inline

Definition at line 292 of file GCOV.h.

References lastLine, locations, and N.

◆ addSrcEdge()

void llvm::GCOVBlock::addSrcEdge ( GCOVArc * Edge)
inline

Definition at line 301 of file GCOV.h.

References pred.

Referenced by llvm::GCOVFile::readGCDA(), and llvm::GCOVFile::readGCNO().

◆ augmentOneCycle()

uint64_t GCOVBlock::augmentOneCycle ( GCOVBlock * src,
std::vector< std::pair< GCOVBlock *, size_t > > & stack )
static

Definition at line 475 of file GCOV.cpp.

References GCOVBlock(), incoming, and succ.

Referenced by getCyclesCount().

◆ dsts()

iterator_range< EdgeIterator > llvm::GCOVBlock::dsts ( ) const
inline

Definition at line 309 of file GCOV.h.

References llvm::make_range(), and succ.

◆ dump()

LLVM_DUMP_METHOD void GCOVBlock::dump ( ) const

dump - Dump GCOVBlock content to dbgs() for debugging purposes.

Definition at line 471 of file GCOV.cpp.

References llvm::dbgs(), LLVM_DUMP_METHOD, and print().

◆ getCount()

uint64_t llvm::GCOVBlock::getCount ( ) const
inline

Definition at line 299 of file GCOV.h.

References count.

◆ getCyclesCount()

uint64_t GCOVBlock::getCyclesCount ( const BlockVector & blocks)
static

Definition at line 526 of file GCOV.cpp.

References assert(), augmentOneCycle(), block, blocks, count, GCOVBlock(), incoming, and traversable.

◆ getLastLine()

uint32_t llvm::GCOVBlock::getLastLine ( ) const
inline

Definition at line 298 of file GCOV.h.

References lastLine.

◆ getLineCount()

LLVM_ABI uint64_t llvm::GCOVBlock::getLineCount ( const BlockVector & Blocks)
static

References LLVM_ABI.

◆ print()

void GCOVBlock::print ( raw_ostream & OS) const

collectLineCounts - Collect line counts.

This must be used after reading .gcno and .gcda files.

Definition at line 442 of file GCOV.cpp.

References count, GCOV_ARC_ON_TREE, locations, N, number, pred, and succ.

Referenced by dump().

◆ srcs()

iterator_range< EdgeIterator > llvm::GCOVBlock::srcs ( ) const
inline

Definition at line 305 of file GCOV.h.

References llvm::make_range(), and pred.

Member Data Documentation

◆ count

uint64_t llvm::GCOVBlock::count = 0

Definition at line 324 of file GCOV.h.

Referenced by getCount(), getCyclesCount(), and print().

◆ incoming

GCOVArc* llvm::GCOVBlock::incoming = nullptr

Definition at line 330 of file GCOV.h.

Referenced by augmentOneCycle(), and getCyclesCount().

◆ lastLine

uint32_t llvm::GCOVBlock::lastLine = 0

Definition at line 328 of file GCOV.h.

Referenced by addLine(), and getLastLine().

◆ locations

SmallVector<GCOVBlockLocation> llvm::GCOVBlock::locations

Definition at line 327 of file GCOV.h.

Referenced by addFile(), addLine(), and print().

◆ number

uint32_t llvm::GCOVBlock::number

Definition at line 323 of file GCOV.h.

Referenced by GCOVBlock(), and print().

◆ pred

SmallVector<GCOVArc *, 2> llvm::GCOVBlock::pred

Definition at line 325 of file GCOV.h.

Referenced by addSrcEdge(), print(), and srcs().

◆ succ

SmallVector<GCOVArc *, 2> llvm::GCOVBlock::succ

Definition at line 326 of file GCOV.h.

Referenced by addDstEdge(), augmentOneCycle(), dsts(), and print().

◆ traversable

bool llvm::GCOVBlock::traversable = false

Definition at line 329 of file GCOV.h.

Referenced by getCyclesCount().


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