[llvm-commits] [llvm-gcc-4.0] r42406 - /llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp

Devang Patel dpatel at apple.com
Thu Sep 27 11:02:48 PDT 2007


Author: dpatel
Date: Thu Sep 27 13:02:47 2007
New Revision: 42406

URL: http://llvm.org/viewvc/llvm-project?rev=42406&view=rev
Log:
While searching for appropriate place for temporaries, do not over-incerement iterator.


Modified:
    llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp

Modified: llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp?rev=42406&r1=42405&r2=42406&view=diff

==============================================================================
--- llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp Thu Sep 27 13:02:47 2007
@@ -2935,6 +2935,7 @@
            CI != E; ++CI) {
         if (&*CI == AllocaInsertionPoint) {
           InsertPt = AllocaInsertionPoint;
+          ++InsertPt;
           break;
         }
       }
@@ -2945,12 +2946,14 @@
       InsertPt = II->getNormalDest()->begin();
       while (isa<PHINode>(InsertPt))
         ++InsertPt;
-    }
+    } else
+      ++InsertPt; // Insert after the init instruction.
   } else {
     InsertPt = AllocaInsertionPoint;   // Insert after the allocas.
+    ++InsertPt;
   }
   BasicBlock *BB = InsertPt->getParent();
-  BB->getInstList().insert(++InsertPt, SI);
+  BB->getInstList().insert(InsertPt, SI);
   
   // Finally, This is no longer a GCC temporary.
   DECL_GIMPLE_FORMAL_TEMP_P(Var) = 0;





More information about the llvm-commits mailing list