From: Chris Lattner Date: Sat, 10 Apr 2004 07:27:48 +0000 (+0000) Subject: Fix previous patch X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=27c694bacb40be5f727c469095d7a44fe05c3334;p=oota-llvm.git Fix previous patch git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12811 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/ADCE.cpp b/lib/Transforms/Scalar/ADCE.cpp index 18c11c3adee..8adf630f91c 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(I)) - ++NumCallRemoved; - else - ++NumInstRemoved; - // Delete the instruction... - BB->getInstList().erase(I++); + ++I; + BB->getInstList().erase(PN); Changed = true; + ++NumInstRemoved; + } else { + ++I; } } else { ++I;