[llvm-commits] CVS: llvm/lib/Transforms/IPO/DeadTypeElimination.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Feb 13 23:35:01 PST 2003


Changes in directory llvm/lib/Transforms/IPO:

DeadTypeElimination.cpp updated: 1.42 -> 1.43

---
Log message:

Fix a misunderstanding of the standard associative containers


---
Diffs of the changes:

Index: llvm/lib/Transforms/IPO/DeadTypeElimination.cpp
diff -u llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.42 llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.43
--- llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.42	Wed Nov 20 12:34:36 2002
+++ llvm/lib/Transforms/IPO/DeadTypeElimination.cpp	Thu Feb 13 23:34:35 2003
@@ -77,15 +77,10 @@
     for (SymbolTable::VarMap::iterator PI = Plane.begin(); PI != Plane.end();)
       // If this entry should be unconditionally removed, or if we detect that
       // the type is not used, remove it.
-      //
       if (ShouldNukeSymtabEntry(*PI) ||
           !UsedTypes.count(cast<Type>(PI->second))) {
-#if MAP_IS_NOT_BRAINDEAD
-        PI = Plane.erase(PI);     // STD C++ Map should support this!
-#else
-        Plane.erase(PI);          // Alas, GCC 2.95.3 doesn't  *SIGH*
-        PI = Plane.begin();
-#endif
+        SymbolTable::VarMap::iterator PJ = PI++;
+        Plane.erase(PJ);
         ++NumKilled;
         Changed = true;
       } else {





More information about the llvm-commits mailing list