Do not crash when deleing a region with a dead invoke instruction

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10161 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-11-22 02:13:08 +00:00
parent 8bc098be0c
commit c8ecd22037

View File

@ -430,6 +430,10 @@ bool ADCE::doADCE() {
}
// Delete the old terminator instruction...
const Type *TermTy = BB->getTerminator()->getType();
if (TermTy != Type::VoidTy)
BB->getTerminator()->replaceAllUsesWith(
Constant::getNullValue(TermTy));
BB->getInstList().pop_back();
const Type *RetTy = Func->getReturnType();
new ReturnInst(RetTy != Type::VoidTy ?