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 | fb9a299f68a0a81c2decc791c891da5f563be18f (patch) | |
| tree | a70f8e34ef8d69194a4a811ed611b9061d1173e3 /llvm/lib | |
| parent | dc7cc350889acf51bd1aa9a6b0165f0b7dde6912 (diff) | |
| download | bcm5719-llvm-fb9a299f68a0a81c2decc791c891da5f563be18f.tar.gz bcm5719-llvm-fb9a299f68a0a81c2decc791c891da5f563be18f.zip | |
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.  :)
llvm-svn: 13102
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/DCE.cpp | 5 | 
1 files changed, 2 insertions, 3 deletions
| diff --git a/llvm/lib/Transforms/Scalar/DCE.cpp b/llvm/lib/Transforms/Scalar/DCE.cpp index 8d0b1db6502..36e662ac2fb 100644 --- a/llvm/lib/Transforms/Scalar/DCE.cpp +++ b/llvm/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... | 

