[llvm] r347146 - Fix bot failure from r347145

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 17 12:41:46 PST 2018


Author: tejohnson
Date: Sat Nov 17 12:41:45 2018
New Revision: 347146

URL: http://llvm.org/viewvc/llvm-project?rev=347146&view=rev
Log:
Fix bot failure from r347145

The #if check around the statistics computation gave an error about
the statistic being an unused variable. Instead, guard with
AreStatisticsEnabled().

Modified:
    llvm/trunk/lib/IR/ModuleSummaryIndex.cpp

Modified: llvm/trunk/lib/IR/ModuleSummaryIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/ModuleSummaryIndex.cpp?rev=347146&r1=347145&r2=347146&view=diff
==============================================================================
--- llvm/trunk/lib/IR/ModuleSummaryIndex.cpp (original)
+++ llvm/trunk/lib/IR/ModuleSummaryIndex.cpp Sat Nov 17 12:41:45 2018
@@ -166,14 +166,13 @@ void ModuleSummaryIndex::propagateConsta
           GVS->setReadOnly(false);
       propagateConstantsToRefs(S.get());
     }
-#if LLVM_ENABLE_STATS
-  for (auto &P : *this)
-    if (P.second.SummaryList.size())
-      if (auto *GVS = dyn_cast<GlobalVarSummary>(
-              P.second.SummaryList[0]->getBaseObject()))
-        if (isGlobalValueLive(GVS) && GVS->isReadOnly())
-          ReadOnlyLiveGVars++;
-#endif
+  if (llvm::AreStatisticsEnabled())
+    for (auto &P : *this)
+      if (P.second.SummaryList.size())
+        if (auto *GVS = dyn_cast<GlobalVarSummary>(
+                P.second.SummaryList[0]->getBaseObject()))
+          if (isGlobalValueLive(GVS) && GVS->isReadOnly())
+            ReadOnlyLiveGVars++;
 }
 
 // TODO: write a graphviz dumper for SCCs (see ModuleSummaryIndex::exportToDot)




More information about the llvm-commits mailing list