LLVM  14.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"

Collaboration diagram for llvm::GCOVBlock:
Collaboration graph
[legend]

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. More...
 
void dump () const
 dump - Dump GCOVBlock content to dbgs() for debugging purposes. More...
 

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, and N.

◆ 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 438 of file GCOV.cpp.

References i, incoming, llvm::min(), stack, succ, and traversable.

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.

Referenced by llvm::GCOVFunction::propagateCounts().

◆ dump()

LLVM_DUMP_METHOD void GCOVBlock::dump ( ) const

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

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

References assert(), augmentOneCycle(), b, block, count, d, incoming, stack, and traversable.

◆ getLastLine()

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

Definition at line 284 of file GCOV.h.

References 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 407 of file GCOV.cpp.

References count, GCOV_ARC_ON_TREE, lines, N, number, 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.

Referenced by llvm::GCOVFunction::propagateCounts().

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 augmentOneCycle(), and getCyclesCount().


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