From 24cee10fb1c7921c3c6f329f3024b142f693f329 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sun, 23 Oct 2011 22:40:13 +0000 Subject: [PATCH] Tidy up a loop to be more idiomatic for LLVM's codebase, and remove some extraneous whitespace. Trying to clean-up this pass as much as I can before I start making functional changes. llvm-svn: 142780 --- llvm/lib/Analysis/BranchProbabilityInfo.cpp | 27 +++++++-------------- 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/llvm/lib/Analysis/BranchProbabilityInfo.cpp b/llvm/lib/Analysis/BranchProbabilityInfo.cpp index 9f175b070d3d..46fe3310c7e6 100644 --- a/llvm/lib/Analysis/BranchProbabilityInfo.cpp +++ b/llvm/lib/Analysis/BranchProbabilityInfo.cpp @@ -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(); - AU.setPreservesAll(); + AU.addRequired(); + AU.setPreservesAll(); } bool BranchProbabilityInfo::runOnFunction(Function &F) {