[llvm-commits] [llvm] r49056 - /llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp

Owen Anderson resistor at mac.com
Tue Apr 1 15:55:53 PDT 2008


David,

This is breaking the build.  Please fix.

--Owen

On Apr 1, 2008, at 5:14 PM, David Greene wrote:

> Author: greened
> Date: Tue Apr  1 17:14:23 2008
> New Revision: 49056
>
> URL: http://llvm.org/viewvc/llvm-project?rev=49056&view=rev
> Log:
>
> Iterators folloring a SmallVector erased element are invalidated so
> don't access cached iterators from after the erased element.
>
> Modified:
>    llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp
>
> Modified: llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp?rev=49056&r1=49055&r2=49056&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp (original)
> +++ llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Tue Apr  1  
> 17:14:23 2008
> @@ -232,8 +232,8 @@
>     return false;
>
>   // First see if it is possible to eliminate loop itself or not.
> -  for (SmallVector<SplitInfo, 4>::iterator SI = SplitData.begin(),
> -         E = SplitData.end(); SI != E;) {
> +  for (SmallVector<SplitInfo, 4>::iterator SI = SplitData.begin();
> +       SI != SplitData.end();) {
>     SplitInfo &SD = *SI;
>     ICmpInst *CI = dyn_cast<ICmpInst>(SD.SplitCondition);
>     if (SD.SplitCondition->getOpcode() == Instruction::And) {
> @@ -244,8 +244,7 @@
>         return Changed;
>       } else {
>         SmallVector<SplitInfo, 4>::iterator Delete_SI = SI;
> -        ++SI;
> -        SplitData.erase(Delete_SI);
> +        SI = SplitData.erase(Delete_SI);
>       }
>     }
>     else if (CI && CI->getPredicate() == ICmpInst::ICMP_EQ) {
> @@ -256,8 +255,7 @@
>         return Changed;
>       } else {
>         SmallVector<SplitInfo, 4>::iterator Delete_SI = SI;
> -        ++SI;
> -        SplitData.erase(Delete_SI);
> +        SI = SplitData.erase(Delete_SI);
>       }
>     } else
>       ++SI;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2555 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20080401/78276a3d/attachment.bin>


More information about the llvm-commits mailing list