diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-31 05:17:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-31 05:17:58 +0000 |
commit | 19dd315e678ac49e3f6cbc874bd4fb447fd41b2c (patch) | |
tree | 45f49d95013dcec0af9a4f029e29b5592e07ac51 /llvm/lib/Transforms | |
parent | 4e3e9307431fc708ee57b6ea5e06e8755536e171 (diff) | |
download | bcm5719-llvm-19dd315e678ac49e3f6cbc874bd4fb447fd41b2c.tar.gz bcm5719-llvm-19dd315e678ac49e3f6cbc874bd4fb447fd41b2c.zip |
improve -debug output, so that -debug is more likely to print when
instcombine is changing stuff.
llvm-svn: 80538
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 64f99e34c29..d17abdf0059 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -327,6 +327,8 @@ namespace { // instruction. Instead, visit methods should return the value returned by // this function. Instruction *EraseInstFromFunction(Instruction &I) { + DEBUG(errs() << "IC: erase " << I); + assert(I.use_empty() && "Cannot erase instruction that is used!"); // Make sure that we reprocess all operands now that we reduced their // use counts. @@ -10149,10 +10151,11 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) { } } - if (Caller->getType() != Type::getVoidTy(*Context) && !Caller->use_empty()) + + if (!Caller->use_empty()) Caller->replaceAllUsesWith(NV); - Caller->eraseFromParent(); - Worklist.Remove(Caller); + + EraseInstFromFunction(*Caller); return true; } |