summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/Statistic.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-30 17:32:08 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-30 17:32:08 +0000
commit6ce57922bb8d550d91c8133d1fd27dd3eaf24c22 (patch)
treecdfbcb2c7c81aac9ec47b8fc67dc0fe7bf2bc8a8 /include/llvm/ADT/Statistic.h
parent8260ea5c6c15345e00ced1398b03e6886145e45c (diff)
downloadllvm-6ce57922bb8d550d91c8133d1fd27dd3eaf24c22.tar.gz
llvm-6ce57922bb8d550d91c8133d1fd27dd3eaf24c22.tar.bz2
llvm-6ce57922bb8d550d91c8133d1fd27dd3eaf24c22.tar.xz
Introduce namespace-scope functions to enable LLVM statistics without
passing the command-line parameter "-stats" and to print the resulting statistics without calling llvm_shutdown(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99893 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/Statistic.h')
-rw-r--r--include/llvm/ADT/Statistic.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/ADT/Statistic.h b/include/llvm/ADT/Statistic.h
index 1a4833cc4a..c593c58c12 100644
--- a/include/llvm/ADT/Statistic.h
+++ b/include/llvm/ADT/Statistic.h
@@ -29,6 +29,7 @@
#include "llvm/System/Atomic.h"
namespace llvm {
+class raw_ostream;
class Statistic {
public:
@@ -113,6 +114,15 @@ protected:
#define STATISTIC(VARNAME, DESC) \
static llvm::Statistic VARNAME = { DEBUG_TYPE, DESC, 0, 0 }
+/// \brief Enable the collection and printing of statistics.
+void EnableStatistics();
+
+/// \brief Print statistics to the file returned by CreateInfoOutputFile().
+void PrintStatistics();
+
+/// \brief Print statistics to the given output stream.
+void PrintStatistics(raw_ostream &OS);
+
} // End llvm namespace
#endif