projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8bc098b
)
Do not crash when deleing a region with a dead invoke instruction
author
Chris Lattner
<sabre@nondot.org>
Sat, 22 Nov 2003 02:13:08 +0000
(
02:13
+0000)
committer
Chris Lattner
<sabre@nondot.org>
Sat, 22 Nov 2003 02:13:08 +0000
(
02:13
+0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10161
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Scalar/ADCE.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Scalar/ADCE.cpp
b/lib/Transforms/Scalar/ADCE.cpp
index 4d7efd8ae4de0b0895079f3fa257d51fbac51770..a06e746b0e0ea24a5d096f7138a08402bb1f824b 100644
(file)
--- a/
lib/Transforms/Scalar/ADCE.cpp
+++ b/
lib/Transforms/Scalar/ADCE.cpp
@@
-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 ?