diff options
Diffstat (limited to 'llvm/lib/Transforms/Scalar/ADCE.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/ADCE.cpp | 7 | 
1 files changed, 3 insertions, 4 deletions
| diff --git a/llvm/lib/Transforms/Scalar/ADCE.cpp b/llvm/lib/Transforms/Scalar/ADCE.cpp index 15b71fdf55f..3aca4a2d4cd 100644 --- a/llvm/lib/Transforms/Scalar/ADCE.cpp +++ b/llvm/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(); | 

