From 5b9bb25c45446460ac140111a0d05dbcbf8072e3 Mon Sep 17 00:00:00 2001 From: Teresa Johnson Date: Sat, 17 Nov 2018 20:41:45 +0000 Subject: 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 --- llvm/lib/IR/ModuleSummaryIndex.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'llvm/lib/IR/ModuleSummaryIndex.cpp') 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 @@ void ModuleSummaryIndex::propagateConstants( GVS->setReadOnly(false); propagateConstantsToRefs(S.get()); } -#if LLVM_ENABLE_STATS - for (auto &P : *this) - if (P.second.SummaryList.size()) - if (auto *GVS = dyn_cast( - 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( + P.second.SummaryList[0]->getBaseObject())) + if (isGlobalValueLive(GVS) && GVS->isReadOnly()) + ReadOnlyLiveGVars++; } // TODO: write a graphviz dumper for SCCs (see ModuleSummaryIndex::exportToDot) -- cgit v1.1