LLVM  8.0.1
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::GCOVBlock Class Reference

GCOVBlock - Collects block information. More...

#include "llvm/ProfileData/GCOV.h"

Public Types

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

Public Member Functions

 GCOVBlock (GCOVFunction &P, uint32_t N)
 
 ~GCOVBlock ()
 ~GCOVBlock - Delete GCOVBlock and its content. More...
 
const GCOVFunctiongetParent () const
 
void addLine (uint32_t N)
 
uint32_t getLastLine () const
 
void addCount (size_t DstEdgeNo, uint64_t N)
 addCount - Add to block counter while storing the edge count. More...
 
uint64_t getCount () const
 
void addSrcEdge (GCOVEdge *Edge)
 
void addDstEdge (GCOVEdge *Edge)
 
size_t getNumSrcEdges () const
 
size_t getNumDstEdges () const
 
void sortDstEdges ()
 sortDstEdges - Sort destination edges by block number, nop if already sorted. More...
 
EdgeIterator src_begin () const
 
EdgeIterator src_end () const
 
iterator_range< EdgeIteratorsrcs () const
 
EdgeIterator dst_begin () const
 
EdgeIterator dst_end () const
 
iterator_range< EdgeIteratordsts () const
 
void print (raw_ostream &OS) const
 
void dump () const
 dump - Dump GCOVBlock content to dbgs() for debugging purposes. More...
 
void collectLineCounts (FileInfo &FI)
 collectLineCounts - Collect line counts. More...
 

Static Public Member Functions

static uint64_t getCycleCount (const Edges &Path)
 Get the count for the detected cycle. More...
 
static void unblock (const GCOVBlock *U, BlockVector &Blocked, BlockVectorLists &BlockLists)
 Unblock a vertex previously marked as blocked. More...
 
static bool lookForCircuit (const GCOVBlock *V, const GCOVBlock *Start, Edges &Path, BlockVector &Blocked, BlockVectorLists &BlockLists, const BlockVector &Blocks, uint64_t &Count)
 
static void getCyclesCount (const BlockVector &Blocks, uint64_t &Count)
 Get the count for the list of blocks which lie on the same line. More...
 
static uint64_t getLineCount (const BlockVector &Blocks)
 Get the count for the list of blocks which lie on the same line. More...
 

Detailed Description

GCOVBlock - Collects block information.

Definition at line 312 of file GCOV.h.

Member Typedef Documentation

◆ BlockVector

Definition at line 328 of file GCOV.h.

◆ BlockVectorLists

Definition at line 329 of file GCOV.h.

◆ EdgeIterator

Definition at line 327 of file GCOV.h.

◆ Edges

Definition at line 330 of file GCOV.h.

Constructor & Destructor Documentation

◆ GCOVBlock()

llvm::GCOVBlock::GCOVBlock ( GCOVFunction P,
uint32_t  N 
)
inline

Definition at line 332 of file GCOV.h.

References Number.

◆ ~GCOVBlock()

GCOVBlock::~GCOVBlock ( )

~GCOVBlock - Delete GCOVBlock and its content.

Definition at line 380 of file GCOV.cpp.

Member Function Documentation

◆ addCount()

void GCOVBlock::addCount ( size_t  DstEdgeNo,
uint64_t  N 
)

addCount - Add to block counter while storing the edge count.

If the destination has no outgoing edges, also update that block's count too.

Definition at line 388 of file GCOV.cpp.

References assert(), and N.

◆ addDstEdge()

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

Definition at line 346 of file GCOV.h.

References assert(), llvm::GCOVEdge::Dst, and llvm::GCOVEdge::Src.

◆ addLine()

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

Definition at line 336 of file GCOV.h.

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

◆ addSrcEdge()

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

Definition at line 341 of file GCOV.h.

References assert(), and llvm::GCOVEdge::Dst.

◆ collectLineCounts()

void GCOVBlock::collectLineCounts ( FileInfo FI)

collectLineCounts - Collect line counts.

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

Definition at line 407 of file GCOV.cpp.

References llvm::FileInfo::addBlockLine(), and N.

◆ dst_begin()

EdgeIterator llvm::GCOVBlock::dst_begin ( ) const
inline

Definition at line 364 of file GCOV.h.

◆ dst_end()

EdgeIterator llvm::GCOVBlock::dst_end ( ) const
inline

Definition at line 365 of file GCOV.h.

◆ dsts()

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

Definition at line 366 of file GCOV.h.

References llvm::dump(), llvm::make_range(), and print().

Referenced by llvm::FileInfo::printBranchInfo().

◆ dump()

LLVM_DUMP_METHOD void GCOVBlock::dump ( ) const

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

Definition at line 436 of file GCOV.cpp.

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

◆ getCount()

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

Definition at line 339 of file GCOV.h.

Referenced by llvm::FileInfo::printBlockInfo(), and llvm::FileInfo::printBranchInfo().

◆ getCycleCount()

uint64_t GCOVBlock::getCycleCount ( const Edges Path)
static

Get the count for the detected cycle.

Definition at line 447 of file GCOV.cpp.

References E, and llvm::max().

◆ getCyclesCount()

void GCOVBlock::getCyclesCount ( const BlockVector Blocks,
uint64_t &  Count 
)
static

Get the count for the list of blocks which lie on the same line.

Definition at line 525 of file GCOV.cpp.

References lookForCircuit().

Referenced by getLineCount().

◆ getLastLine()

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

Definition at line 337 of file GCOV.h.

References N.

◆ getLineCount()

uint64_t GCOVBlock::getLineCount ( const BlockVector Blocks)
static

Get the count for the list of blocks which lie on the same line.

Definition at line 537 of file GCOV.cpp.

References E, llvm::find(), getCyclesCount(), and llvm::RISCVFenceField::W.

Referenced by llvm::FileInfo::print().

◆ getNumDstEdges()

size_t llvm::GCOVBlock::getNumDstEdges ( ) const
inline

Definition at line 355 of file GCOV.h.

◆ getNumSrcEdges()

size_t llvm::GCOVBlock::getNumSrcEdges ( ) const
inline

Definition at line 354 of file GCOV.h.

◆ getParent()

const GCOVFunction& llvm::GCOVBlock::getParent ( ) const
inline

Definition at line 335 of file GCOV.h.

Referenced by llvm::FileInfo::printBranchInfo().

◆ lookForCircuit()

bool GCOVBlock::lookForCircuit ( const GCOVBlock V,
const GCOVBlock Start,
Edges Path,
BlockVector Blocked,
BlockVectorLists BlockLists,
const BlockVector Blocks,
uint64_t &  Count 
)
static

Definition at line 476 of file GCOV.cpp.

Referenced by getCyclesCount().

◆ print()

void GCOVBlock::print ( raw_ostream OS) const

Definition at line 412 of file GCOV.cpp.

References N, and llvm::Number.

◆ sortDstEdges()

void GCOVBlock::sortDstEdges ( )

sortDstEdges - Sort destination edges by block number, nop if already sorted.

This is required for printing branch info in the correct order.

Definition at line 398 of file GCOV.cpp.

◆ src_begin()

EdgeIterator llvm::GCOVBlock::src_begin ( ) const
inline

Definition at line 358 of file GCOV.h.

◆ src_end()

EdgeIterator llvm::GCOVBlock::src_end ( ) const
inline

Definition at line 359 of file GCOV.h.

◆ srcs()

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

Definition at line 360 of file GCOV.h.

References llvm::make_range().

◆ unblock()

void GCOVBlock::unblock ( const GCOVBlock U,
BlockVector Blocked,
BlockVectorLists BlockLists 
)
static

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