42#ifndef LLVM_SUPPORT_DEBUGCOUNTER_H
43#define LLVM_SUPPORT_DEBUGCOUNTER_H
125 return {
Info.Count,
Info.CurrChunkIdx};
130 Info.Count = State.Count;
131 Info.CurrChunkIdx = State.ChunkIdx;
134#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
165 Counter->Active =
true;
181#define DEBUG_COUNTER(VARNAME, COUNTERNAME, DESC) \
182 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 LLVM_ABI void printChunks(raw_ostream &OS, ArrayRef< IntegerInclusiveInterval > Intervals)
static CounterState getCounterState(CounterInfo &Info)
static void setCounterState(CounterInfo &Info, CounterState State)
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 LLVM_ABI bool parseChunks(StringRef Str, IntegerInclusiveIntervalUtils::IntervalList &Res)
Return true on parsing error and print the error message on the llvm::errs()
static bool shouldExecute(CounterInfo &Counter)
static bool isCounterSet(CounterInfo &Info)
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
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.
SmallVector< IntegerInclusiveInterval, 8 > IntervalList
A list of integer intervals.
This is an optimization pass for GlobalISel generic memory operations.