diff options
author | Chris Lattner <sabre@nondot.org> | 2004-04-21 22:29:37 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-04-21 22:29:37 +0000 |
commit | 4e5f03602c8f990f8ed35574535a29fcd44c8890 (patch) | |
tree | 56093761c098477157c31e48f0cd7428db6d2065 /lib/Transforms/Scalar/DCE.cpp | |
parent | 5d461d20aea308471f2a31b718a274bfee28b60c (diff) | |
download | external_llvm-4e5f03602c8f990f8ed35574535a29fcd44c8890.zip external_llvm-4e5f03602c8f990f8ed35574535a29fcd44c8890.tar.gz external_llvm-4e5f03602c8f990f8ed35574535a29fcd44c8890.tar.bz2 |
This code really wants to iterate over the OPERANDS of an instruction, not
over its USES. If it's dead it doesn't have any uses! :)
Thanks to the fabulous and mysterious Bill Wendling for pointing this out. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13102 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/DCE.cpp')
-rw-r--r-- | lib/Transforms/Scalar/DCE.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/DCE.cpp b/lib/Transforms/Scalar/DCE.cpp index 8d0b1db..36e662a 100644 --- a/lib/Transforms/Scalar/DCE.cpp +++ b/lib/Transforms/Scalar/DCE.cpp @@ -92,9 +92,8 @@ bool DCE::runOnFunction(Function &F) { // instructions being used, add them to the worklist, because they might // go dead after this one is removed. // - for (User::use_iterator UI = I->use_begin(), UE = I->use_end(); - UI != UE; ++UI) - if (Instruction *Used = dyn_cast<Instruction>(*UI)) + for (User::op_iterator OI = I->op_begin(), E = I->op_end(); OI != E; ++OI) + if (Instruction *Used = dyn_cast<Instruction>(*OI)) WorkList.push_back(Used); // Tell the instruction to let go of all of the values it uses... |