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
This commit is contained in:
Chris Lattner
2002-09-10 22:38:47 +00:00
parent 9afdb2998b
commit 1d608abbc0
6 changed files with 30 additions and 60 deletions

View File

@@ -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();