[LLVMdev] How to delete a instruction?

lucefe noviceup at gmail.com
Tue Apr 20 17:13:57 PDT 2010


I did a simple test just now, but I alse failed.

I delete several ordered instructions from end to begin,
but after deleting the first instruction(the last instruction of F), the
program crashed.
My test code is below (F is a function only containing several sequential
instructions):

for (inst_iterator inst == --inst_end(F); inst != inst_begin(F); --inst) {
Instruction * i =  &*inst;
i->eraseFromParent();
}


Best Regards!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100421/14ae2a33/attachment.html>


More information about the llvm-dev mailing list