[LLVMdev] moving instructions

Misha Brukman brukman at uiuc.edu
Wed Aug 4 07:36:22 PDT 2004


On Wed, Aug 04, 2004 at 07:03:34AM -0500, Patrick Meredith wrote:
>       IB->getParent()->getInstList().remove(IB);
>       current_BB->getInstList().insert(current_last, IB);
> 
> and I get this assertion:
>  Assertion `V->getParent() == 0 && "Value already in a container!!"'
>  failed.
> 
> it seems to me that remove should remove it from it's container....

You want to use `erase' instead of `remove'.
See http://llvm.cs.uiuc.edu/docs/ProgrammersManual.html#schanges_deleting

-- 
Misha Brukman :: http://misha.brukman.net :: http://llvm.cs.uiuc.edu




More information about the llvm-dev mailing list