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

LLVM llvm at cs.uiuc.edu
Wed May 12 11:33:10 PDT 2004


Changes in directory llvm/lib/Transforms/IPO:

DeadTypeElimination.cpp updated: 1.49 -> 1.49.4.1
MutateStructTypes.cpp updated: 1.46 -> 1.46.4.1

---
Log message:

Change SymbolTable to not subclass from std::map but to embed one instead 
and cleanup use of SymbolTable in rest of LLVM. Also, add some new methods
to SymbolTable for small/utility cases and substitute calls to them in 
LLVM.


---
Diffs of the changes:  (+6 -6)

Index: llvm/lib/Transforms/IPO/DeadTypeElimination.cpp
diff -u llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.49 llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.49.4.1
--- llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.49	Thu Feb 26 14:02:23 2004
+++ llvm/lib/Transforms/IPO/DeadTypeElimination.cpp	Wed May 12 11:33:43 2004
@@ -74,11 +74,11 @@
   // Check the symbol table for superfluous type entries...
   //
   // Grab the 'type' plane of the module symbol...
-  SymbolTable::iterator STI = ST.find(Type::TypeTy);
+  SymbolTable::type_iterator STI = ST.find(Type::TypeTy);
   if (STI != ST.end()) {
     // Loop over all entries in the type plane...
-    SymbolTable::VarMap &Plane = STI->second;
-    for (SymbolTable::VarMap::iterator PI = Plane.begin(); PI != Plane.end();) {
+    SymbolTable::ValueMap &Plane = STI->second;
+    for (SymbolTable::value_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.
       const Type *RHS = cast<Type>(PI->second);


Index: llvm/lib/Transforms/IPO/MutateStructTypes.cpp
diff -u llvm/lib/Transforms/IPO/MutateStructTypes.cpp:1.46 llvm/lib/Transforms/IPO/MutateStructTypes.cpp:1.46.4.1
--- llvm/lib/Transforms/IPO/MutateStructTypes.cpp:1.46	Sun Feb  8 22:37:31 2004
+++ llvm/lib/Transforms/IPO/MutateStructTypes.cpp	Wed May 12 11:33:43 2004
@@ -269,10 +269,10 @@
   // Remap the symbol table to refer to the types in a nice way
   //
   SymbolTable &ST = M.getSymbolTable();
-  SymbolTable::iterator I = ST.find(Type::TypeTy);
+  SymbolTable::type_iterator I = ST.find(Type::TypeTy);
   if (I != ST.end()) {    // Get the type plane for Type's
-    SymbolTable::VarMap &Plane = I->second;
-    for (SymbolTable::type_iterator TI = Plane.begin(), TE = Plane.end();
+    SymbolTable::ValueMap &Plane = I->second;
+    for (SymbolTable::value_iterator TI = Plane.begin(), TE = Plane.end();
          TI != TE; ++TI) {
       // FIXME: This is gross, I'm reaching right into a symbol table and
       // mucking around with it's internals... but oh well.





More information about the llvm-commits mailing list