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().
llvm-svn: 347146
diff --git a/llvm/lib/IR/ModuleSummaryIndex.cpp b/llvm/lib/IR/ModuleSummaryIndex.cpp
index bb5b7d0..e51d69b 100644
--- a/llvm/lib/IR/ModuleSummaryIndex.cpp
+++ b/llvm/lib/IR/ModuleSummaryIndex.cpp
@@ -166,14 +166,13 @@
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)