aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-09-10 23:46:10 +0000
committerChris Lattner <sabre@nondot.org>2002-09-10 23:46:10 +0000
commit9e6161cfd1131f13f2a12beb4408ba03cac83439 (patch)
treebea47f5b6a20f4847c770027807078b96f87d0a2 /lib/Transforms
parent8606d9924b2c1581e45748430be749f1e2934025 (diff)
Fix the last of the silly bugs I just introduced. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3674 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/ADCE.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/ADCE.cpp b/lib/Transforms/Scalar/ADCE.cpp
index 3aca4a2d4c..7d1d896bd2 100644
--- a/lib/Transforms/Scalar/ADCE.cpp
+++ b/lib/Transforms/Scalar/ADCE.cpp
@@ -240,7 +240,7 @@ bool ADCE::doADCE() {
//
if (!AliveBlocks.count(&Func->front())) {
BasicBlock *NewEntry = new BasicBlock();
- new BranchInst(&Func->front(), NewEntry->end());
+ NewEntry->getInstList().push_back(new BranchInst(&Func->front()));
Func->getBasicBlockList().push_front(NewEntry);
AliveBlocks.insert(NewEntry); // This block is always alive!
}
@@ -353,8 +353,8 @@ bool ADCE::doADCE() {
// Delete the old terminator instruction...
BB->getInstList().pop_back();
const Type *RetTy = Func->getReturnType();
- new ReturnInst(RetTy != Type::VoidTy ? Constant::getNullValue(RetTy) :0,
- BB->end());
+ BB->getInstList().push_back(new ReturnInst(RetTy != Type::VoidTy ?
+ Constant::getNullValue(RetTy) : 0));
}
BB->dropAllReferences();