Remove a couple more cases of "getNumUses() == 0". No need to walk the linked
authorNick Lewycky <nicholas@mxc.ca>
Wed, 30 Jan 2008 08:01:28 +0000 (08:01 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Wed, 30 Jan 2008 08:01:28 +0000 (08:01 +0000)
list just to see if whether the list is empty.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46555 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/DeadStoreElimination.cpp

index 2e6db3addfa1025c8629f915ef366723becb50e2..179dab37fabc9cba5e7fe9f890795c02a8fff01e 100644 (file)
@@ -327,7 +327,7 @@ bool DSE::handleEndBlock(BasicBlock& BB,
     if (LoadInst* L = dyn_cast<LoadInst>(BBI)) {
       // However, if this load is unused, we can go ahead and remove it, and
       // not have to worry about it making our pointer undead!
-      if (L->getNumUses() == 0) {
+      if (L->use_empty()) {
         MD.removeInstruction(L);
         
         // DCE instructions only used to calculate that load
@@ -350,7 +350,7 @@ bool DSE::handleEndBlock(BasicBlock& BB,
       deadPointers.erase(A);
       
       // Dead alloca's can be DCE'd when we reach them
-      if (A->getNumUses() == 0) {
+      if (A->use_empty()) {
         MD.removeInstruction(A);
         
         // DCE instructions only used to calculate that load