diff options
author | Chris Lattner <sabre@nondot.org> | 2004-04-10 07:27:48 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-04-10 07:27:48 +0000 |
commit | 27c694bacb40be5f727c469095d7a44fe05c3334 (patch) | |
tree | 2323098a7c4db10bd8443fb7f77b46f2bb04d8ca | |
parent | 17177601fb9fa065a6159a116832eb6e3ce6e9b1 (diff) |
Fix previous patch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12811 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/ADCE.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Transforms/Scalar/ADCE.cpp b/lib/Transforms/Scalar/ADCE.cpp index 18c11c3ade..8adf630f91 100644 --- a/lib/Transforms/Scalar/ADCE.cpp +++ b/lib/Transforms/Scalar/ADCE.cpp @@ -145,15 +145,13 @@ bool ADCE::dropReferencesOfDeadInstructionsInLiveBlock(BasicBlock *BB) { // PN->replaceAllUsesWith(Constant::getNullValue(PN->getType())); - } else { - if (isa<CallInst>(I)) - ++NumCallRemoved; - else - ++NumInstRemoved; - // Delete the instruction... - BB->getInstList().erase(I++); + ++I; + BB->getInstList().erase(PN); Changed = true; + ++NumInstRemoved; + } else { + ++I; } } else { ++I; |