[llvm-commits] CVS: llvm/lib/CodeGen/IfConversion.cpp

Evan Cheng evan.cheng at apple.com
Tue Jun 5 00:05:47 PDT 2007



Changes in directory llvm/lib/CodeGen:

IfConversion.cpp updated: 1.25 -> 1.26
---
Log message:

I had a senior moment.

---
Diffs of the changes:  (+4 -3)

 IfConversion.cpp |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)


Index: llvm/lib/CodeGen/IfConversion.cpp
diff -u llvm/lib/CodeGen/IfConversion.cpp:1.25 llvm/lib/CodeGen/IfConversion.cpp:1.26
--- llvm/lib/CodeGen/IfConversion.cpp:1.25	Mon Jun  4 20:31:40 2007
+++ llvm/lib/CodeGen/IfConversion.cpp	Tue Jun  5 02:05:25 2007
@@ -444,10 +444,11 @@
 /// isNextBlock - Returns true either if ToBB the next block after BB or
 /// that all the intervening blocks are empty.
 static bool isNextBlock(MachineBasicBlock *BB, MachineBasicBlock *ToBB) {
-  MachineFunction *MF = BB->getParent();
   MachineFunction::iterator I = BB;
-  while (++I != MF->end() && I != MachineFunction::iterator(ToBB))
-    if (!I->empty())
+  MachineFunction::iterator TI = ToBB;
+  MachineFunction::iterator E = BB->getParent()->end();
+  while (++I != TI)
+    if (I == E || !I->empty())
       return false;
   return true;
 }






More information about the llvm-commits mailing list