[LLVMdev] Erasing Instruction

Chayan Sarkar chayan.ju at gmail.com
Fri Jun 18 05:28:39 PDT 2010


Hi,

Can anyone tell me how to erase an instruction, (specially a
load/store instruction) ?

If I use Instr->eraseFromParent(), I get following error. Note the
instruction does not have any use.


opt: /home/chayan/llvm/llvm-2.6/include/llvm/ADT/ilist.h:218:
llvm::ilist_iterator<NodeTy>&
llvm::ilist_iterator<NodeTy>::operator++() [with NodeTy =
llvm::Instruction]: Assertion `NodePtr && "++'d off the end of an
ilist!"' failed.
0   opt 0x084560a8
Stack dump:
0.	Running pass 'Function Pass Manager' on module '<stdin>'.
1.	Running pass 'Testing try-outs' on function '@test'
./unoptrun.sh: line 10: 32064 Aborted                 opt -load
/home/chayan/llvm/llvm-2.6/Release/lib/test.so -test < input.bc >
output.bc
llvm-dis: Invalid bitcode signature


Any idea how to solve this.

Regards,
Chayan



More information about the llvm-dev mailing list