diff options
author | Chris Lattner <sabre@nondot.org> | 2002-05-26 20:18:18 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-05-26 20:18:18 +0000 |
commit | 16da494c81a09ea4273e7f3e7ad12eec68b05468 (patch) | |
tree | 66373655d5702ed6d2cf5a728f811e02528e9bb2 /lib/Transforms/Utils/Local.cpp | |
parent | 9e77f77687bdeece2a66ed9103379f6da3bbc46e (diff) |
Simplify the interface to local DCE and Constant prop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2749 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/Local.cpp')
-rw-r--r-- | lib/Transforms/Utils/Local.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp index eb06a5b1f9..cc152c6c09 100644 --- a/lib/Transforms/Utils/Local.cpp +++ b/lib/Transforms/Utils/Local.cpp @@ -16,14 +16,14 @@ // ConstantFoldInstruction - If an instruction references constants, try to fold // them together... // -bool doConstantPropogation(BasicBlock *BB, BasicBlock::iterator &II) { +bool doConstantPropogation(BasicBlock::iterator &II) { Instruction *Inst = *II; if (Constant *C = ConstantFoldInstruction(Inst)) { // Replaces all of the uses of a variable with uses of the constant. Inst->replaceAllUsesWith(C); // Remove the instruction from the basic block... - delete BB->getInstList().remove(II); + delete Inst->getParent()->getInstList().remove(II); return true; } @@ -100,11 +100,11 @@ bool isInstructionTriviallyDead(Instruction *I) { // to point to the instruction that immediately succeeded the original // instruction. // -bool dceInstruction(BasicBlock::InstListType &BBIL, - BasicBlock::iterator &BBI) { +bool dceInstruction(BasicBlock::iterator &BBI) { // Look for un"used" definitions... - if (isInstructionTriviallyDead(*BBI)) { - delete BBIL.remove(BBI); // Bye bye + Instruction *I = *BBI; + if (isInstructionTriviallyDead(I)) { + delete I->getParent()->getInstList().remove(BBI); // Bye bye return true; } return false; |