diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2016-06-26 17:27:42 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2016-06-26 17:27:42 +0000 |
commit | aa2091505f6de0ababf8a6ec54e8a26c8b0be2be (patch) | |
tree | 124f3edf32b0d056358b0d313f04fee8feb2d1cb /llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | |
parent | d8db1e172cf320490c273380b847690007247b11 (diff) | |
download | llvm-aa2091505f6de0ababf8a6ec54e8a26c8b0be2be.zip llvm-aa2091505f6de0ababf8a6ec54e8a26c8b0be2be.tar.gz llvm-aa2091505f6de0ababf8a6ec54e8a26c8b0be2be.tar.bz2 |
Apply clang-tidy's modernize-loop-convert to lib/Analysis.
Only minor manual fixes. No functionality change intended.
llvm-svn: 273816
Diffstat (limited to 'llvm/lib/Analysis/ModuleSummaryAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp index 7c57c05..ff41581 100644 --- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp +++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp @@ -76,24 +76,23 @@ void ModuleSummaryIndexBuilder::computeFunctionSummary( DenseSet<const Value *> RefEdges; SmallPtrSet<const User *, 8> Visited; - for (Function::const_iterator BB = F.begin(), E = F.end(); BB != E; ++BB) - for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I != E; - ++I) { + for (const BasicBlock &BB : F) + for (const Instruction &I : BB) { if (!isa<DbgInfoIntrinsic>(I)) ++NumInsts; - if (auto CS = ImmutableCallSite(&*I)) { + if (auto CS = ImmutableCallSite(&I)) { auto *CalledFunction = CS.getCalledFunction(); if (CalledFunction && CalledFunction->hasName() && !CalledFunction->isIntrinsic()) { - auto ScaledCount = BFI ? BFI->getBlockProfileCount(&*BB) : None; + auto ScaledCount = BFI ? BFI->getBlockProfileCount(&BB) : None; auto *CalleeId = M->getValueSymbolTable().lookup(CalledFunction->getName()); CallGraphEdges[CalleeId] += (ScaledCount ? ScaledCount.getValue() : 0); } } - findRefEdges(&*I, RefEdges, Visited); + findRefEdges(&I, RefEdges, Visited); } GlobalValueSummary::GVFlags Flags(F); |