[LLVMdev] ReplaceInstWithInst appears to invalidate BB iterator?

Justin M. LaPre laprej at cs.rpi.edu
Fri May 6 16:30:51 PDT 2011


Hello,

I have a call to ReplaceInstWithInst(Instruction *From, Instruction *To) inside of a for loop iterating through a BasicBlock::iterator.  On the very next pass after I replace the instruction, the iterator appears to be invalidated.  Is this supposed to happen or am I doing something silly?  Is there a more appropriate way to do this?  Thanks,

-Justin





More information about the llvm-dev mailing list