[llvm] r263889 - Use a range-based for loop. NFC.

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 19 17:16:14 PDT 2016


Author: mkuper
Date: Sat Mar 19 19:16:13 2016
New Revision: 263889

URL: http://llvm.org/viewvc/llvm-project?rev=263889&view=rev
Log:
Use a range-based for loop. NFC.

Modified:
    llvm/trunk/lib/Target/X86/X86CallFrameOptimization.cpp

Modified: llvm/trunk/lib/Target/X86/X86CallFrameOptimization.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CallFrameOptimization.cpp?rev=263889&r1=263888&r2=263889&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86CallFrameOptimization.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86CallFrameOptimization.cpp Sat Mar 19 19:16:13 2016
@@ -233,11 +233,11 @@ bool X86CallFrameOptimization::runOnMach
 
   ContextVector CallSeqVector;
 
-  for (MachineFunction::iterator BB = MF.begin(), E = MF.end(); BB != E; ++BB)
-    for (MachineBasicBlock::iterator I = BB->begin(); I != BB->end(); ++I)
-      if (I->getOpcode() == FrameSetupOpcode) {
+  for (auto &MBB : MF)
+    for (auto &MI : MBB)
+      if (MI.getOpcode() == FrameSetupOpcode) {
         CallContext Context;
-        collectCallInfo(MF, *BB, I, Context);
+        collectCallInfo(MF, MBB, MI, Context);
         CallSeqVector.push_back(Context);
       }
 




More information about the llvm-commits mailing list