LLVM 22.0.0git
|
#include "llvm/Support/DebugCounter.h"
Classes | |
struct | Chunk |
struct | CounterInfo |
struct | CounterState |
Public Types | |
typedef UniqueVector< std::string > | CounterVector |
Public Member Functions | |
LLVM_ABI void | push_back (const std::string &) |
LLVM_DUMP_METHOD void | dump () const |
LLVM_ABI 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 LLVM_ABI void | printChunks (raw_ostream &OS, ArrayRef< Chunk >) |
static LLVM_ABI bool | parseChunks (StringRef Str, SmallVector< Chunk > &Res) |
Return true on parsing error and print the error message on the llvm::errs() | |
static LLVM_ABI DebugCounter & | instance () |
Returns a reference to the singleton instance. | |
static unsigned | registerCounter (StringRef Name, StringRef Desc) |
static LLVM_ABI 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 57 of file DebugCounter.h.
typedef UniqueVector<std::string> llvm::DebugCounter::CounterVector |
Definition at line 143 of file DebugCounter.h.
|
inlineprotected |
Definition at line 166 of file DebugCounter.h.
References llvm::CallingConv::C, Counters, and RegisteredCounters.
Referenced by registerCounter().
|
inline |
Definition at line 144 of file DebugCounter.h.
References RegisteredCounters.
LLVM_DUMP_METHOD void DebugCounter::dump | ( | ) | const |
Definition at line 257 of file DebugCounter.cpp.
References llvm::dbgs(), LLVM_DUMP_METHOD, and print().
|
inlinestatic |
Definition at line 154 of file DebugCounter.h.
References Enabled, and instance().
Referenced by push_back().
|
inline |
Definition at line 147 of file DebugCounter.h.
References RegisteredCounters.
Definition at line 130 of file DebugCounter.h.
References RegisteredCounters.
Referenced by print(), and push_back().
|
inline |
Definition at line 138 of file DebugCounter.h.
References Counters, and RegisteredCounters.
|
inlinestatic |
Definition at line 107 of file DebugCounter.h.
References assert(), and instance().
|
inline |
Definition at line 135 of file DebugCounter.h.
References RegisteredCounters.
|
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 97 of file DebugCounter.h.
References Counters, and instance().
|
inlinestatic |
Definition at line 156 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::SmallVectorTemplateCommon< T, typename >::empty(), llvm::StringRef::empty(), llvm::errs(), llvm::Number, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::StringRef::starts_with(), and llvm::StringRef::take_until().
Referenced by push_back().
void DebugCounter::print | ( | raw_ostream & | OS | ) | const |
Definition at line 207 of file DebugCounter.cpp.
References llvm::CallingConv::C, getCounterId(), instance(), llvm::left_justify(), printChunks(), RegisteredCounters, and llvm::sort().
Referenced by dump().
|
static |
Definition at line 19 of file DebugCounter.cpp.
References llvm::ArrayRef< T >::empty().
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 83 of file DebugCounter.h.
References addCounter(), and instance().
|
inlinestatic |
Definition at line 115 of file DebugCounter.h.
References instance().
Definition at line 88 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 224 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 191 of file DebugCounter.h.
|
protected |
Definition at line 182 of file DebugCounter.h.
Referenced by addCounter(), getCounterInfo(), isCounterSet(), and push_back().
|
protected |
Definition at line 187 of file DebugCounter.h.
Referenced by enableAllCounters(), and isCountingEnabled().
|
protected |
Definition at line 183 of file DebugCounter.h.
Referenced by addCounter(), begin(), end(), getCounterId(), getCounterInfo(), getNumCounters(), and print().
|
protected |
Definition at line 189 of file DebugCounter.h.
Referenced by isCountingEnabled().