LLVM 20.0.0git
|
#include "llvm/Support/DebugCounter.h"
Classes | |
struct | Chunk |
struct | CounterInfo |
struct | CounterState |
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 void | printChunks (raw_ostream &OS, ArrayRef< Chunk >) |
static bool | parseChunks (StringRef Str, SmallVector< Chunk > &Res) |
Return true on parsing error and print the error message on the llvm::errs() | |
static DebugCounter & | instance () |
Returns a reference to the singleton instance. | |
static unsigned | registerCounter (StringRef Name, StringRef Desc) |
static bool | shouldExecuteImpl (unsigned CounterName) |
static bool | shouldExecute (unsigned CounterName) |
static bool | isCounterSet (unsigned ID) |
static CounterState | getCounterState (unsigned ID) |
static void | setCounterState (unsigned ID, CounterState State) |
static void | enableAllCounters () |
static bool | isCountingEnabled () |
Protected Member Functions | |
unsigned | addCounter (const std::string &Name, const std::string &Desc) |
Protected Attributes | |
DenseMap< unsigned, CounterInfo > | Counters |
CounterVector | RegisteredCounters |
bool | Enabled = false |
bool | ShouldPrintCounter = false |
bool | BreakOnLast = false |
Definition at line 56 of file DebugCounter.h.
typedef UniqueVector<std::string> llvm::DebugCounter::CounterVector |
Definition at line 140 of file DebugCounter.h.
|
inlineprotected |
Definition at line 163 of file DebugCounter.h.
References Counters, llvm::UniqueVector< T >::insert(), Name, and RegisteredCounters.
Referenced by registerCounter().
|
inline |
Definition at line 141 of file DebugCounter.h.
References llvm::UniqueVector< T >::begin(), and RegisteredCounters.
LLVM_DUMP_METHOD void DebugCounter::dump | ( | ) | const |
Definition at line 250 of file DebugCounter.cpp.
References llvm::dbgs(), and print().
|
inlinestatic |
Definition at line 151 of file DebugCounter.h.
References Enabled, and instance().
Referenced by push_back().
|
inline |
Definition at line 144 of file DebugCounter.h.
References llvm::UniqueVector< T >::end(), and RegisteredCounters.
Definition at line 127 of file DebugCounter.h.
References llvm::UniqueVector< T >::idFor(), Name, and RegisteredCounters.
Referenced by print(), and push_back().
|
inline |
Definition at line 135 of file DebugCounter.h.
References Counters, and RegisteredCounters.
|
inlinestatic |
Definition at line 106 of file DebugCounter.h.
References assert(), and instance().
|
inline |
Definition at line 132 of file DebugCounter.h.
References RegisteredCounters, and llvm::UniqueVector< T >::size().
|
static |
Returns a reference to the singleton instance.
Definition at line 165 of file DebugCounter.cpp.
Referenced by enableAllCounters(), getCounterState(), llvm::initDebugCounterOptions(), isCounterSet(), isCountingEnabled(), print(), registerCounter(), setCounterState(), and shouldExecuteImpl().
Definition at line 96 of file DebugCounter.h.
References Counters, and instance().
|
inlinestatic |
Definition at line 153 of file DebugCounter.h.
References Enabled, instance(), and ShouldPrintCounter.
Referenced by shouldExecute().
|
static |
Return true on parsing error and print the error message on the llvm::errs()
Definition at line 34 of file DebugCounter.cpp.
References llvm::StringRef::drop_front(), llvm::SmallVectorBase< Size_T >::empty(), llvm::StringRef::empty(), llvm::errs(), llvm::Number, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorBase< Size_T >::size(), llvm::StringRef::starts_with(), and llvm::StringRef::take_until().
Referenced by push_back().
void DebugCounter::print | ( | raw_ostream & | OS | ) | const |
Definition at line 202 of file DebugCounter.cpp.
References llvm::UniqueVector< T >::begin(), llvm::UniqueVector< T >::end(), getCounterId(), instance(), llvm::left_justify(), OS, printChunks(), RegisteredCounters, and llvm::sort().
Referenced by dump().
|
static |
Definition at line 19 of file DebugCounter.cpp.
References llvm::ArrayRef< T >::empty(), and OS.
Referenced by print().
void DebugCounter::push_back | ( | const std::string & | Val | ) |
Definition at line 172 of file DebugCounter.cpp.
References llvm::DebugCounter::CounterInfo::Chunks, Counters, enableAllCounters(), llvm::errs(), getCounterId(), llvm::DebugCounter::CounterInfo::IsSet, parseChunks(), and llvm::StringRef::split().
Definition at line 82 of file DebugCounter.h.
References addCounter(), instance(), and Name.
|
inlinestatic |
Definition at line 114 of file DebugCounter.h.
References llvm::DebugCounter::CounterState::ChunkIdx, llvm::DebugCounter::CounterState::Count, and instance().
Definition at line 87 of file DebugCounter.h.
References isCountingEnabled(), and shouldExecuteImpl().
Referenced by checkCondition(), DCEInstruction(), findRenameRegForSameLdStRegPair(), llvm::getKnowledgeFromBundle(), llvm::Attributor::getOrCreateAAFor(), llvm::slpvectorizer::BoUpSLP::isTreeTinyAndNotFullyVectorizable(), llvm::Negator::Negate(), optimizeDivRem(), optimizeSQRT(), llvm::InstCombinerImpl::run(), and llvm::InstructionSelect::selectMachineFunction().
Handle consecutive blocks.
Definition at line 218 of file DebugCounter.cpp.
References llvm::DebugCounter::CounterInfo::Chunks, llvm::DebugCounter::CounterInfo::Count, llvm::DebugCounter::CounterInfo::CurrChunkIdx, instance(), and LLVM_BUILTIN_DEBUGTRAP.
Referenced by shouldExecute().
|
protected |
Definition at line 187 of file DebugCounter.h.
|
protected |
Definition at line 178 of file DebugCounter.h.
Referenced by addCounter(), getCounterInfo(), isCounterSet(), and push_back().
|
protected |
Definition at line 183 of file DebugCounter.h.
Referenced by enableAllCounters(), and isCountingEnabled().
|
protected |
Definition at line 179 of file DebugCounter.h.
Referenced by addCounter(), begin(), end(), getCounterId(), getCounterInfo(), getNumCounters(), and print().
|
protected |
Definition at line 185 of file DebugCounter.h.
Referenced by isCountingEnabled().