Support: Add llvm::AreStatisticsEnabled().
authorDaniel Dunbar <daniel@zuster.org>
Sat, 26 Feb 2011 23:17:12 +0000 (23:17 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sat, 26 Feb 2011 23:17:12 +0000 (23:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126558 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/Statistic.h
lib/Support/Statistic.cpp

index f137ea21d05845156a3efc6476d322937fb2c36a..fda99c6edbc34f18363db4add2928c8d1df13806 100644 (file)
@@ -121,6 +121,9 @@ protected:
 /// \brief Enable the collection and printing of statistics.
 void EnableStatistics();
 
+/// \brief Check if statistics are enabled.
+bool AreStatisticsEnabled();
+
 /// \brief Print statistics to the file returned by CreateInfoOutputFile().
 void PrintStatistics();
 
index f0ed62690fd311758bbd932b13c357807940160b..1e733d92e6109c471d10461ad8fb72a7d2ef9795 100644 (file)
@@ -101,6 +101,10 @@ void llvm::EnableStatistics() {
   Enabled.setValue(true);
 }
 
+bool llvm::AreStatisticsEnabled() {
+  return Enabled;
+}
+
 void llvm::PrintStatistics(raw_ostream &OS) {
   StatisticInfo &Stats = *StatInfo;