diff options
author | Chris Lattner <sabre@nondot.org> | 2003-11-20 18:25:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-11-20 18:25:24 +0000 |
commit | 2af517281d6c36313f7ff74337a84c4fac716dbb (patch) | |
tree | f6d420f010d81c3328601e8073f8a573831d4223 /llvm/lib/Transforms/Scalar/ADCE.cpp | |
parent | 63a0ccff4496816a6774c1370237dd29c7062b09 (diff) | |
download | bcm5719-llvm-2af517281d6c36313f7ff74337a84c4fac716dbb.tar.gz bcm5719-llvm-2af517281d6c36313f7ff74337a84c4fac716dbb.zip |
Start using the nicer terminator auto-insertion API
llvm-svn: 10111
Diffstat (limited to 'llvm/lib/Transforms/Scalar/ADCE.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/ADCE.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/ADCE.cpp b/llvm/lib/Transforms/Scalar/ADCE.cpp index 941cc2dc09c..5a5151e8b64 100644 --- a/llvm/lib/Transforms/Scalar/ADCE.cpp +++ b/llvm/lib/Transforms/Scalar/ADCE.cpp @@ -302,7 +302,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(), 0, 0, NewEntry); Func->getBasicBlockList().push_front(NewEntry); AliveBlocks.insert(NewEntry); // This block is always alive! LiveSet.insert(NewEntry->getTerminator()); // The branch is live @@ -432,8 +432,8 @@ bool ADCE::doADCE() { // Delete the old terminator instruction... BB->getInstList().pop_back(); const Type *RetTy = Func->getReturnType(); - BB->getInstList().push_back(new ReturnInst(RetTy != Type::VoidTy ? - Constant::getNullValue(RetTy) : 0)); + new ReturnInst(RetTy != Type::VoidTy ? + Constant::getNullValue(RetTy) : 0, BB); } } |