[llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp

Chris Lattner lattner at cs.uiuc.edu
Sat Apr 10 02:28:01 PDT 2004


Changes in directory llvm/lib/Transforms/Scalar:

ADCE.cpp updated: 1.73 -> 1.74

---
Log message:

Fix previous patch


---
Diffs of the changes:  (+5 -7)

Index: llvm/lib/Transforms/Scalar/ADCE.cpp
diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.73 llvm/lib/Transforms/Scalar/ADCE.cpp:1.74
--- llvm/lib/Transforms/Scalar/ADCE.cpp:1.73	Sat Apr 10 02:02:02 2004
+++ llvm/lib/Transforms/Scalar/ADCE.cpp	Sat Apr 10 02:27:48 2004
@@ -145,15 +145,13 @@
         //
         PN->replaceAllUsesWith(Constant::getNullValue(PN->getType()));
 
-      } else {
-        if (isa<CallInst>(I))
-          ++NumCallRemoved;
-        else
-          ++NumInstRemoved;
-        
         // Delete the instruction...
-        BB->getInstList().erase(I++);
+        ++I;
+        BB->getInstList().erase(PN);
         Changed = true;
+        ++NumInstRemoved;
+      } else {
+        ++I;
       }
     } else {
       ++I;





More information about the llvm-commits mailing list