[llvm] r176708 - No really, don't use end().

Jakob Stoklund Olesen stoklund at 2pi.dk
Fri Mar 8 10:36:36 PST 2013


Author: stoklund
Date: Fri Mar  8 12:36:36 2013
New Revision: 176708

URL: http://llvm.org/viewvc/llvm-project?rev=176708&view=rev
Log:
No really, don't use end().

Clearly, this function is never actually called with the last
instruction in the function.

Modified:
    llvm/trunk/include/llvm/CodeGen/SlotIndexes.h

Modified: llvm/trunk/include/llvm/CodeGen/SlotIndexes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SlotIndexes.h?rev=176708&r1=176707&r2=176708&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SlotIndexes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SlotIndexes.h Fri Mar  8 12:36:36 2013
@@ -401,8 +401,8 @@ namespace llvm {
     SlotIndex getNextNonNullIndex(SlotIndex Index) {
       IndexList::iterator I = Index.listEntry();
       IndexList::iterator E = indexList.end();
-      while (I != E)
-        if ((++I)->getInstr())
+      while (++I != E)
+        if (I->getInstr())
           return SlotIndex(I, Index.getSlot());
       // We reached the end of the function.
       return getLastIndex();





More information about the llvm-commits mailing list