26 #ifndef LLVM_ADT_STATISTIC_H
27 #define LLVM_ADT_STATISTIC_H
47 void construct(
const char *name,
const char *desc) {
55 #if !defined(NDEBUG) || defined(LLVM_ENABLE_STATS)
72 unsigned OldValue =
Value;
84 unsigned OldValue =
Value;
111 #else // Statistics are disabled in release builds.
133 const Statistic &
operator+=(
const unsigned &V) {
137 const Statistic &
operator-=(
const unsigned &V) {
141 const Statistic &
operator*=(
const unsigned &V) {
145 const Statistic &
operator/=(
const unsigned &V) {
149 #endif // !defined(NDEBUG) || defined(LLVM_ENABLE_STATS)
164 #define STATISTIC(VARNAME, DESC) \
165 static llvm::Statistic VARNAME = { DEBUG_TYPE, DESC, 0, 0 }
const Statistic & operator=(unsigned Val)
const Statistic & operator-=(const unsigned &V)
cas_flag AtomicAdd(volatile cas_flag *ptr, cas_flag val)
const Statistic & operator+=(const unsigned &V)
void construct(const char *name, const char *desc)
construct - This should only be called for non-global statistics.
#define TsanHappensAfter(cv)
cas_flag AtomicDiv(volatile cas_flag *ptr, cas_flag val)
void EnableStatistics()
Enable the collection and printing of statistics.
const Statistic & operator++()
const Statistic & operator--()
llvm::sys::cas_flag getValue() const
const Statistic & operator*=(const unsigned &V)
cas_flag AtomicMul(volatile cas_flag *ptr, cas_flag val)
const Statistic & operator/=(const unsigned &V)
const char * getDesc() const
const char * getName() const
void PrintStatistics()
Print statistics to the file returned by CreateInfoOutputFile().
LLVM Value Representation.
cas_flag AtomicIncrement(volatile cas_flag *ptr)
volatile llvm::sys::cas_flag Value
cas_flag AtomicDecrement(volatile cas_flag *ptr)
bool AreStatisticsEnabled()
Check if statistics are enabled.