diff options
author | Teresa Johnson <tejohnson@google.com> | 2018-11-17 20:41:45 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2018-11-17 20:41:45 +0000 |
commit | 5b9bb25c45446460ac140111a0d05dbcbf8072e3 (patch) | |
tree | 71837313e0513257ec01d198e333eb998c3a9a53 /llvm/lib/IR/ModuleSummaryIndex.cpp | |
parent | 8c1915cc0196a093145970b185e6cc4882de8d7a (diff) | |
download | llvm-5b9bb25c45446460ac140111a0d05dbcbf8072e3.zip llvm-5b9bb25c45446460ac140111a0d05dbcbf8072e3.tar.gz llvm-5b9bb25c45446460ac140111a0d05dbcbf8072e3.tar.bz2 |
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
Diffstat (limited to 'llvm/lib/IR/ModuleSummaryIndex.cpp')
-rw-r--r-- | llvm/lib/IR/ModuleSummaryIndex.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
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<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) |