From: Rafael Espindola Date: Mon, 30 Mar 2015 21:18:36 +0000 (+0000) Subject: Use range loops and add missing braces. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=37780d81b1eb79b1dc2b1b91b8768869c27583b4;p=oota-llvm.git Use range loops and add missing braces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233598 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index 91f7c717580..d772583ba6e 100644 --- a/lib/IR/DebugInfo.cpp +++ b/lib/IR/DebugInfo.cpp @@ -978,16 +978,16 @@ bool llvm::StripDebugInfo(Module &M) { } } - for (Module::iterator MI = M.begin(), ME = M.end(); MI != ME; ++MI) - for (Function::iterator FI = MI->begin(), FE = MI->end(); FI != FE; - ++FI) - for (BasicBlock::iterator BI = FI->begin(), BE = FI->end(); BI != BE; - ++BI) { - if (BI->getDebugLoc()) { + for (Function &F : M) { + for (BasicBlock &BB : F) { + for (Instruction &I : BB) { + if (I.getDebugLoc()) { Changed = true; - BI->setDebugLoc(DebugLoc()); + I.setDebugLoc(DebugLoc()); } } + } + } return Changed; }