Range insertion now returns an iterator
authorChris Lattner <sabre@nondot.org>
Mon, 29 Apr 2002 21:25:34 +0000 (21:25 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 29 Apr 2002 21:25:34 +0000 (21:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2414 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp

index 396b503ebae97231f6514e2c2fd9b7a3e0d9dc32..4637273a46df6e14bbd5130b371b6b3158dde650 100644 (file)
@@ -158,12 +158,9 @@ void DecomposePass::decomposeArrayRef(BasicBlock::iterator &BBI) {
   // Now delete the old instruction...
   delete MAI;
 
-  // Convert our iterator into an index... that cannot get invalidated
-  unsigned ItOffs = BBI-BB->begin();
-
   // Insert all of the new instructions...
-  BB->getInstList().insert(BBI, NewInsts.begin(), NewInsts.end());
+  BBI = BB->getInstList().insert(BBI, NewInsts.begin(), NewInsts.end());
   
   // Advance the iterator to the instruction following the one just inserted...
-  BBI = BB->begin() + ItOffs + NewInsts.size();
+  BBI += NewInsts.size();
 }