LLVM 19.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
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)
 
uint32_t getLastLine () const
 
uint64_t getCount () const
 
void addSrcEdge (GCOVArc *Edge)
 
void addDstEdge (GCOVArc *Edge)
 
iterator_range< EdgeIteratorsrcs () const
 
iterator_range< EdgeIteratordsts () const
 
void print (raw_ostream &OS) const
 collectLineCounts - Collect line counts.
 
void dump () const
 dump - Dump GCOVBlock content to dbgs() for debugging purposes.
 

Static Public Member Functions

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

Public Attributes

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

Detailed Description

GCOVBlock - Collects block information.

Definition at line 274 of file GCOV.h.

Member Typedef Documentation

◆ BlockVector

Definition at line 277 of file GCOV.h.

◆ BlockVectorLists

Definition at line 278 of file GCOV.h.

◆ EdgeIterator

Definition at line 276 of file GCOV.h.

◆ Edges

Definition at line 279 of file GCOV.h.

Constructor & Destructor Documentation

◆ GCOVBlock()

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

Definition at line 281 of file GCOV.h.

Member Function Documentation

◆ addDstEdge()

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

Definition at line 289 of file GCOV.h.

References succ.

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

◆ addLine()

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

Definition at line 283 of file GCOV.h.

References lines, N, and llvm::SmallVectorTemplateBase< T, bool >::push_back().

◆ addSrcEdge()

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

Definition at line 287 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 473 of file GCOV.cpp.

References incoming, and succ.

Referenced by getCyclesCount().

◆ dsts()

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

Definition at line 295 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 469 of file GCOV.cpp.

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

◆ getCount()

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

Definition at line 285 of file GCOV.h.

References count.

◆ getCyclesCount()

uint64_t GCOVBlock::getCyclesCount ( const BlockVector blocks)
static

Definition at line 524 of file GCOV.cpp.

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

◆ getLastLine()

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

Definition at line 284 of file GCOV.h.

References llvm::SmallVectorTemplateCommon< T, typename >::back(), and lines.

◆ getLineCount()

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

◆ 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, llvm::SmallVectorBase< Size_T >::empty(), GCOV_ARC_ON_TREE, lines, N, number, OS, pred, and succ.

Referenced by dump().

◆ srcs()

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

Definition at line 291 of file GCOV.h.

References llvm::make_range(), and pred.

Member Data Documentation

◆ count

uint64_t llvm::GCOVBlock::count = 0

Definition at line 310 of file GCOV.h.

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

◆ incoming

GCOVArc* llvm::GCOVBlock::incoming = nullptr

Definition at line 315 of file GCOV.h.

Referenced by augmentOneCycle(), and getCyclesCount().

◆ lines

SmallVector<uint32_t, 4> llvm::GCOVBlock::lines

Definition at line 313 of file GCOV.h.

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

◆ number

uint32_t llvm::GCOVBlock::number

Definition at line 309 of file GCOV.h.

Referenced by print().

◆ pred

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

Definition at line 311 of file GCOV.h.

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

◆ succ

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

Definition at line 312 of file GCOV.h.

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

◆ traversable

bool llvm::GCOVBlock::traversable = false

Definition at line 314 of file GCOV.h.

Referenced by getCyclesCount().


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