Make LoopPass::getContainedPass return a LoopPass* instead of a Pass*
[oota-llvm.git] / include / llvm / ADT / Statistic.h
index 1a4833cc4a07b538fa5072ce6e284583b75c89a4..3a1319f1090ce0c4d42b52b1ec2f62775de3e563 100644 (file)
@@ -29,6 +29,7 @@
 #include "llvm/System/Atomic.h"
 
 namespace llvm {
+class raw_ostream;
 
 class Statistic {
 public:
@@ -55,6 +56,10 @@ public:
   }
   
   const Statistic &operator++() {
+    // FIXME: This function and all those that follow carefully use an
+    // atomic operation to update the value safely in the presence of
+    // concurrent accesses, but not to read the return value, so the
+    // return value is not thread safe.
     sys::AtomicIncrement(&Value);
     return init();
   }
@@ -113,6 +118,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