[llvm-commits] [llvm] r145903 - /llvm/trunk/lib/CodeGen/MachineSSAUpdater.cpp

Evan Cheng evan.cheng at apple.com
Mon Dec 5 18:49:07 PST 2011


Author: evancheng
Date: Mon Dec  5 20:49:06 2011
New Revision: 145903

URL: http://llvm.org/viewvc/llvm-project?rev=145903&view=rev
Log:
Mix some minor misuse of MachineBasicBlock iterator.

Modified:
    llvm/trunk/lib/CodeGen/MachineSSAUpdater.cpp

Modified: llvm/trunk/lib/CodeGen/MachineSSAUpdater.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineSSAUpdater.cpp?rev=145903&r1=145902&r2=145903&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineSSAUpdater.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineSSAUpdater.cpp Mon Dec  5 20:49:06 2011
@@ -81,7 +81,7 @@
   if (BB->empty())
     return 0;
 
-  MachineBasicBlock::iterator I = BB->front();
+  MachineBasicBlock::iterator I = BB->begin();
   if (!I->isPHI())
     return 0;
 
@@ -182,7 +182,7 @@
     return DupPHI;
 
   // Otherwise, we do need a PHI: insert one now.
-  MachineBasicBlock::iterator Loc = BB->empty() ? BB->end() : BB->front();
+  MachineBasicBlock::iterator Loc = BB->empty() ? BB->end() : BB->begin();
   MachineInstr *InsertedPHI = InsertNewDef(TargetOpcode::PHI, BB,
                                            Loc, VRC, MRI, TII);
 
@@ -311,7 +311,7 @@
   /// Add it into the specified block and return the register.
   static unsigned CreateEmptyPHI(MachineBasicBlock *BB, unsigned NumPreds,
                                  MachineSSAUpdater *Updater) {
-    MachineBasicBlock::iterator Loc = BB->empty() ? BB->end() : BB->front();
+    MachineBasicBlock::iterator Loc = BB->empty() ? BB->end() : BB->begin();
     MachineInstr *PHI = InsertNewDef(TargetOpcode::PHI, BB, Loc,
                                      Updater->VRC, Updater->MRI,
                                      Updater->TII);





More information about the llvm-commits mailing list