No really, don't use end().
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 8 Mar 2013 18:36:36 +0000 (18:36 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 8 Mar 2013 18:36:36 +0000 (18:36 +0000)
Clearly, this function is never actually called with the last
instruction in the function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176708 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/SlotIndexes.h

index 0f85c994a22eb30fef387cf8eb575bec876b8d0d..a27708046686d62820d3d9eee073f3734b75e657 100644 (file)
@@ -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();