aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/ADCE.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-09-10 22:38:47 +0000
committerChris Lattner <sabre@nondot.org>2002-09-10 22:38:47 +0000
commit1d608abbc07bbc7c78c20da6b305ef14c6c30e8e (patch)
treebde93bb9c18724578cee27583246b5960cbb8ac8 /lib/Transforms/Scalar/ADCE.cpp
parent9afdb2998b9f1d518a5a8d1f5a7771848a5b2b19 (diff)
Clean up code due to auto-insert constructors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3665 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/ADCE.cpp')
-rw-r--r--lib/Transforms/Scalar/ADCE.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/ADCE.cpp b/lib/Transforms/Scalar/ADCE.cpp
index 15b71fdf55..3aca4a2d4c 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();
- NewEntry->getInstList().push_back(new BranchInst(&Func->front()));
+ new BranchInst(&Func->front(), NewEntry->end());
Func->getBasicBlockList().push_front(NewEntry);
AliveBlocks.insert(NewEntry); // This block is always alive!
}
@@ -353,9 +353,8 @@ bool ADCE::doADCE() {
// Delete the old terminator instruction...
BB->getInstList().pop_back();
const Type *RetTy = Func->getReturnType();
- Instruction *New = new ReturnInst(RetTy != Type::VoidTy ?
- Constant::getNullValue(RetTy) : 0);
- BB->getInstList().push_back(New);
+ new ReturnInst(RetTy != Type::VoidTy ? Constant::getNullValue(RetTy) :0,
+ BB->end());
}
BB->dropAllReferences();