42#ifndef LLVM_SUPPORT_DEBUGCOUNTER_H
43#define LLVM_SUPPORT_DEBUGCOUNTER_H
129 return {
Info.Count,
Info.CurrChunkIdx};
134 Info.Count = State.Count;
135 Info.CurrChunkIdx = State.ChunkIdx;
138#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
169 Counter->Active =
true;
185#define DEBUG_COUNTER(VARNAME, COUNTERNAME, DESC) \
186 static DebugCounter::CounterInfo VARNAME(COUNTERNAME, DESC)
Analysis containing CSE Info
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
This file defines the DenseMap class.
This file implements a map that provides insertion order iteration.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Struct to store counter info.
CounterInfo(StringRef Name, StringRef Desc)
friend class DebugCounter
CounterInfo * getCounterInfo(StringRef Name) const
static CounterState getCounterState(CounterInfo &Info)
static void setCounterState(CounterInfo &Info, CounterState State)
static LLVM_ABI void printChunks(raw_ostream &OS, ArrayRef< Chunk >)
MapVector< StringRef, CounterInfo * >::const_iterator end() const
bool ShouldPrintCounterQueries
void addCounter(CounterInfo *Info)
static void registerCounter(CounterInfo *Info)
bool handleCounterIncrement(CounterInfo &Info)
std::pair< StringRef, StringRef > getCounterDesc(CounterInfo *Info) const
MapVector< StringRef, CounterInfo * >::const_iterator begin() const
LLVM_ABI void push_back(const std::string &)
void activateAllCounters()
static bool shouldExecute(CounterInfo &Counter)
static bool isCounterSet(CounterInfo &Info)
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 bool shouldExecuteImpl(CounterInfo &Counter)
static LLVM_ABI DebugCounter & instance()
Returns a reference to the singleton instance.
LLVM_ABI void print(raw_ostream &OS) const
LLVM_DUMP_METHOD void dump() const
MapVector< StringRef, CounterInfo * > Counters
unsigned int getNumCounters() const
This class implements a map that also provides access to all stored values in a deterministic order.
typename VectorType::const_iterator const_iterator
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
bool contains(int64_t Idx) const
LLVM_ABI void print(llvm::raw_ostream &OS)