diff --git a/src/coreclr/jit/compiler.hpp b/src/coreclr/jit/compiler.hpp index 2af3444ee0a81..62fef7e441ce7 100644 --- a/src/coreclr/jit/compiler.hpp +++ b/src/coreclr/jit/compiler.hpp @@ -294,6 +294,19 @@ class Dumpable virtual void dump(FILE* output) = 0; }; +// Helper class record and display a simple single value. +class Counter : public Dumpable +{ +public: + int64_t Value; + + Counter(int64_t initialValue = 0) : Value(initialValue) + { + } + + void dump(FILE* output); +}; + // Helper class to record and display a histogram of different values. // Usage like: // static unsigned s_buckets[] = { 1, 2, 5, 10, 0 }; // Must have terminating 0 diff --git a/src/coreclr/jit/utils.cpp b/src/coreclr/jit/utils.cpp index 619482dd6bc98..aed8cda7c24df 100644 --- a/src/coreclr/jit/utils.cpp +++ b/src/coreclr/jit/utils.cpp @@ -1098,6 +1098,11 @@ void ConfigDoubleArray::Dump() #if CALL_ARG_STATS || COUNT_BASIC_BLOCKS || COUNT_LOOPS || EMITTER_STATS || MEASURE_NODE_SIZE || MEASURE_MEM_ALLOC +void Counter::dump(FILE* output) +{ + fprintf(output, "%lld\n", (long long)Value); +} + /***************************************************************************** * Histogram class. */