[llvm] r233598 - Use range loops and add missing braces.

Rafael Espindola rafael.espindola at gmail.com
Mon Mar 30 14:18:36 PDT 2015


Author: rafael
Date: Mon Mar 30 16:18:36 2015
New Revision: 233598

URL: http://llvm.org/viewvc/llvm-project?rev=233598&view=rev
Log:
Use range loops and add missing braces.

Modified:
    llvm/trunk/lib/IR/DebugInfo.cpp

Modified: llvm/trunk/lib/IR/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugInfo.cpp?rev=233598&r1=233597&r2=233598&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DebugInfo.cpp (original)
+++ llvm/trunk/lib/IR/DebugInfo.cpp Mon Mar 30 16:18:36 2015
@@ -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;
 }





More information about the llvm-commits mailing list