I have a test.c file which has this function call:
functiontest(2,x);
I would like to delete this function call (with an llvm pass) and when I try to use removeFromParent() function like this:
calledFunction1->removeFromParent();
this causes LLVM to produce the following error:
Referencing function in another module!
call void @functiontest(i32 2, float %tmp15)LLVM ERROR: Broken function found, compilation aborted!
I also tried calling eraseFromParent() but this triggers an assert:
Assertion `use_empty() && "Uses remain when a value is destroyed!"' failed.
I would prefer to use removeFromParent()
Any ideas what's wrong ?