LLVM  8.0.1
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

 ~DebugCounter ()
 
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. More...
 
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 ()
 

Detailed Description

Definition at line 56 of file DebugCounter.h.

Member Typedef Documentation

◆ CounterVector

Definition at line 139 of file DebugCounter.h.

Constructor & Destructor Documentation

◆ ~DebugCounter()

DebugCounter::~DebugCounter ( )

Definition at line 59 of file DebugCounter.cpp.

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

Member Function Documentation

◆ begin()

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

Definition at line 140 of file DebugCounter.h.

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

◆ dump()

LLVM_DUMP_METHOD void DebugCounter::dump ( ) const

Definition at line 134 of file DebugCounter.cpp.

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

Referenced by setCounterValue().

◆ enableAllCounters()

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

Definition at line 150 of file DebugCounter.h.

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

◆ end()

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

Definition at line 143 of file DebugCounter.h.

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

◆ getCounterId()

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

Definition at line 126 of file DebugCounter.h.

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

◆ 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 107 of file DebugCounter.h.

References assert(), and instance().

◆ getNumCounters()

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

Definition at line 131 of file DebugCounter.h.

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

◆ instance()

DebugCounter & DebugCounter::instance ( )
static

Returns a reference to the singleton instance.

Definition at line 64 of file DebugCounter.cpp.

References DC.

Referenced by enableAllCounters(), getCounterValue(), isCounterSet(), registerCounter(), setCounterValue(), and shouldExecute().

◆ isCounterSet()

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

Definition at line 102 of file DebugCounter.h.

References instance().

◆ print()

void DebugCounter::print ( raw_ostream OS) const

Definition at line 119 of file DebugCounter.cpp.

References llvm::left_justify(), and llvm::sort().

Referenced by setCounterValue().

◆ push_back()

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

Definition at line 68 of file DebugCounter.cpp.

References llvm::errs(), and llvm::StringRef::split().

◆ registerCounter()

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

Definition at line 71 of file DebugCounter.h.

References instance().

◆ setCounterValue()

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

Definition at line 115 of file DebugCounter.h.

References dump(), instance(), LLVM_DUMP_METHOD, and print().

◆ shouldExecute()

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

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