* I would delete Loop. I used the following code:
cout << "begin to delete loop" << endl;
for (Loop::block_iterator bi = L->block_begin(), bi2; bi != L->block_end(); bi = bi2) {
bi2 = bi;
bi2++;
BasicBlock * BB = *bi;
for (BasicBlock::iterator ii = BB->begin(), ii2; ii != BB->end(); ii= ii2) {
ii2 = ii;
ii2++;
Instruction *inst = ii;
inst->eraseFromParent();
}
BB->eraseFromParent();
}
But I get the following error:
Use still stuck after destroying Def:% t1 = icmp sle i32% t0, 9 opt: /home/llvm/src/lib/VMCore/Value.cpp: 75: virtual llvm :: Value :: ~ Value (): Assertion `use_empty () && & && &" Use remains when value is destroyed! " "Failed. 0 opt 0x0848e569 Stack Reset:
What suggestions do you have to solve this problem? *
source
share