Displaying 2 results from an estimated 2 matches for "eraseinst".
2010 Jun 21
0
[LLVMdev] Problems with eraseFromParent()
...ies on these instructions (the number
> of their uses are changed to zero).
> The point is that when I finally attempt to remove the redundant
> unused instructions from the generated code, there is a seg fault error.
> To remove them, I'm using this function:
>
> void EraseInst(Instruction &I) {
> assert(I.use_empty() && "Cannot erase used instructions!");
> I.eraseFromParent();
> }
The problem is in how you use it:
for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E;
I++) {
if (I->...
2010 Jun 21
3
[LLVMdev] Problems with eraseFromParent()
...rder
to eliminate all dependencies on these instructions (the number of their
uses are changed to zero).
The point is that when I finally attempt to remove the redundant unused
instructions from the generated code, there is a seg fault error.
To remove them, I'm using this function:
void EraseInst(Instruction &I) {
assert(I.use_empty() && "Cannot erase used instructions!");
I.eraseFromParent();
}
So please, if anyone could help me on this, i would be very grateful!
PS: It's also following my pass and the bytecode used for tests.
Thanks for...