I want to remove instruction from LLVM IR .I used eraseFromParent() in new pass to remove instruction .But when I run this pass I am getting error as
llvm/include/llvm/Support/Casting.h:90: static bool llvm::isa_impl_cl<To, From*>::doit(const From*) [with To = llvm::BinaryOperator; From = llvm::Instruction]: Assertion `Val && “isa<> used on a null pointer”’ failed.
I used erasefromparent as below:
for (auto Inst = BB.begin(), IE = BB.end(); Inst != IE; ++Inst) {
Inst->eraseFromParent();
}
Thank You