Tidy up a loop to be more idiomatic for LLVM's codebase, and remove some
authorChandler Carruth <chandlerc@gmail.com>
Sun, 23 Oct 2011 22:40:13 +0000 (22:40 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 23 Oct 2011 22:40:13 +0000 (22:40 +0000)
extraneous whitespace. Trying to clean-up this pass as much as I can
before I start making functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142780 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/BranchProbabilityInfo.cpp

index 9f175b070d3d22617c2b256cc9b13f890af0f9d8..46fe3310c7e6e23d4635237506102eb8b7818fed 100644 (file)
@@ -424,34 +424,25 @@ bool BranchProbabilityAnalysis::calcFloatingPointHeuristics(BasicBlock *BB) {
 }
 
 bool BranchProbabilityAnalysis::runOnFunction(Function &F) {
-
-  for (Function::iterator I = F.begin(), E = F.end(); I != E; ) {
-    BasicBlock *BB = I++;
-
-    if (calcMetadataWeights(BB))
+  for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) {
+    if (calcMetadataWeights(I))
       continue;
-
-    if (calcLoopBranchHeuristics(BB))
+    if (calcLoopBranchHeuristics(I))
       continue;
-
-    if (calcReturnHeuristics(BB))
+    if (calcReturnHeuristics(I))
       continue;
-
-    if (calcPointerHeuristics(BB))
+    if (calcPointerHeuristics(I))
       continue;
-
-    if (calcZeroHeuristics(BB))
+    if (calcZeroHeuristics(I))
       continue;
-
-    calcFloatingPointHeuristics(BB);
+    calcFloatingPointHeuristics(I);
   }
-
   return false;
 }
 
 void BranchProbabilityInfo::getAnalysisUsage(AnalysisUsage &AU) const {
-    AU.addRequired<LoopInfo>();
-    AU.setPreservesAll();
+  AU.addRequired<LoopInfo>();
+  AU.setPreservesAll();
 }
 
 bool BranchProbabilityInfo::runOnFunction(Function &F) {