[LLVMdev] moving instructions

Patrick Meredith pmeredit at uiuc.edu
Wed Aug 4 05:03:34 PDT 2004


How does one move instructions from one basic block to another?  I tried
this:
 (IB is an Instruction* as is current_last, current_BB is a BasicBlock*)

      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....




More information about the llvm-dev mailing list