diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2012-09-25 01:55:59 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2012-09-25 01:55:59 +0000 |
commit | 42bca056e05010f994f5be6127a8dceb065291ad (patch) | |
tree | decc02e59e4eedadb64c01469341ac9f162a05c9 /llvm/lib/Transforms | |
parent | 02a6babb3ec8da88a216e909827275861e8c919a (diff) | |
download | bcm5719-llvm-42bca056e05010f994f5be6127a8dceb065291ad.tar.gz bcm5719-llvm-42bca056e05010f994f5be6127a8dceb065291ad.zip |
Don't forget that strcpy and friends return a pointer to the destination, so
it's not a dead store if that pointer is used. Whoops!
llvm-svn: 164583
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp index f96309eb4d1..301ee2f663b 100644 --- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -266,8 +266,8 @@ static bool isRemovable(Instruction *I) { } } - if (CallSite(I)) // If we assume hasMemoryWrite(I) is true, - return true; // then there's nothing left to check. + if (CallSite CS = I) + return CS.getInstruction()->use_empty(); return false; } |