LLVM 19.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::DebugCounter Class Reference

#include "llvm/Support/DebugCounter.h"

Public Types

typedef UniqueVector< std::string > CounterVector
 

Public Member Functions

void push_back (const std::string &)
 
LLVM_DUMP_METHOD void dump () const
 
void print (raw_ostream &OS) const
 
unsigned getCounterId (const std::string &Name) const
 
unsigned int getNumCounters () const
 
std::pair< std::string, std::string > getCounterInfo (unsigned ID) const
 
CounterVector::const_iterator begin () const
 
CounterVector::const_iterator end () const
 

Static Public Member Functions

static DebugCounterinstance ()
 Returns a reference to the singleton instance.
 
static unsigned registerCounter (StringRef Name, StringRef Desc)
 
static bool shouldExecute (unsigned CounterName)
 
static bool isCounterSet (unsigned ID)
 
static int64_t getCounterValue (unsigned ID)
 
static void setCounterValue (unsigned ID, int64_t Count)
 
static void enableAllCounters ()
 
static bool isCountingEnabled ()
 

Detailed Description

Definition at line 56 of file DebugCounter.h.

Member Typedef Documentation

◆ CounterVector

Definition at line 137 of file DebugCounter.h.

Member Function Documentation

◆ begin()

CounterVector::const_iterator llvm::DebugCounter::begin ( ) const
inline

Definition at line 138 of file DebugCounter.h.

References llvm::UniqueVector< T >::begin().

◆ dump()

LLVM_DUMP_METHOD void DebugCounter::dump ( ) const

Definition at line 150 of file DebugCounter.cpp.

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

◆ enableAllCounters()

static void llvm::DebugCounter::enableAllCounters ( )
inlinestatic

Definition at line 148 of file DebugCounter.h.

References instance().

Referenced by push_back().

◆ end()

CounterVector::const_iterator llvm::DebugCounter::end ( ) const
inline

Definition at line 141 of file DebugCounter.h.

References llvm::UniqueVector< T >::end().

◆ getCounterId()

unsigned llvm::DebugCounter::getCounterId ( const std::string &  Name) const
inline

Definition at line 124 of file DebugCounter.h.

References llvm::UniqueVector< T >::idFor(), and Name.

Referenced by print(), and push_back().

◆ getCounterInfo()

std::pair< std::string, std::string > llvm::DebugCounter::getCounterInfo ( unsigned  ID) const
inline

◆ getCounterValue()

static int64_t llvm::DebugCounter::getCounterValue ( unsigned  ID)
inlinestatic

Definition at line 105 of file DebugCounter.h.

References assert(), and instance().

◆ getNumCounters()

unsigned int llvm::DebugCounter::getNumCounters ( ) const
inline

Definition at line 129 of file DebugCounter.h.

References llvm::UniqueVector< T >::size().

◆ instance()

DebugCounter & DebugCounter::instance ( )
static

◆ isCounterSet()

static bool llvm::DebugCounter::isCounterSet ( unsigned  ID)
inlinestatic

Definition at line 100 of file DebugCounter.h.

References instance().

◆ isCountingEnabled()

static bool llvm::DebugCounter::isCountingEnabled ( )
inlinestatic

Definition at line 150 of file DebugCounter.h.

References instance().

Referenced by shouldExecute().

◆ print()

void DebugCounter::print ( raw_ostream OS) const

◆ push_back()

void DebugCounter::push_back ( const std::string &  Val)

◆ registerCounter()

static unsigned llvm::DebugCounter::registerCounter ( StringRef  Name,
StringRef  Desc 
)
inlinestatic

Definition at line 69 of file DebugCounter.h.

References instance(), and Name.

◆ setCounterValue()

static void llvm::DebugCounter::setCounterValue ( unsigned  ID,
int64_t  Count 
)
inlinestatic

Definition at line 113 of file DebugCounter.h.

References instance().

◆ shouldExecute()

static bool llvm::DebugCounter::shouldExecute ( unsigned  CounterName)
inlinestatic

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