search for: old_instr

Displaying 1 result from an estimated 1 matches for "old_instr".

Did you mean: alt_instr
2014 Jun 26
2
[LLVMdev] eraseFromParent and stack dump
Hello, I am creating a new instruction and I want to replace the use of a specified instruction. This is the code I have written Instruction *new_instr = BinaryOperator::Create(Instruction::Sub, op1, op2, ""); b->getInstList().insertAfter(old_instr, new_instr); //b is the BasicBlock old_instr->replaceAllUsesWith(new_instr); old_instr->eraseFromParent(); When I print the basic block, I see that my instruction was inserted and replaces the old instruction, however I get a stack dump, when I run the instrumented IR file. 0 opt...