[llvm-commits] CVS: llvm/lib/VMCore/SymbolTable.cpp

Chris Lattner lattner at cs.uiuc.edu
Sat Mar 5 21:46:54 PST 2005



Changes in directory llvm/lib/VMCore:

SymbolTable.cpp updated: 1.55 -> 1.56
---
Log message:

Delete the really inefficient method: void remove(const Type* Typ);
Speed up the symbol stripping code by avoiding a linear search of the
type table.

Get rid of removeEntry(type_iterator), since 'remove' is exactly the same
operation.



---
Diffs of the changes:  (+2 -18)

 SymbolTable.cpp |   20 ++------------------
 1 files changed, 2 insertions(+), 18 deletions(-)


Index: llvm/lib/VMCore/SymbolTable.cpp
diff -u llvm/lib/VMCore/SymbolTable.cpp:1.55 llvm/lib/VMCore/SymbolTable.cpp:1.56
--- llvm/lib/VMCore/SymbolTable.cpp:1.55	Sat Mar  5 23:21:40 2005
+++ llvm/lib/VMCore/SymbolTable.cpp	Sat Mar  5 23:46:41 2005
@@ -166,23 +166,8 @@
   return Result;
 }
 
-
-// remove - Remove a type
-void SymbolTable::remove(const Type* Ty ) {
-  type_iterator TI = this->type_begin();
-  type_iterator TE = this->type_end();
-
-  // Search for the entry
-  while ( TI != TE && TI->second != Ty )
-    ++TI;
-
-  if ( TI != TE )
-    this->removeEntry( TI );
-}
-
-
 // removeEntry - Remove a type from the symbol table...
-Type* SymbolTable::removeEntry(type_iterator Entry) {
+Type* SymbolTable::remove(type_iterator Entry) {
   assert( Entry != tmap.end() && "Invalid entry to remove!");
 
   const Type* Result = Entry->second;
@@ -300,8 +285,7 @@
   }
 
   for (type_iterator TI = tmap.begin(); TI != tmap.end(); ) {
-    const Type* T = (TI++)->second;
-    remove(T);
+    remove(TI++);
     RemovedSymbol = true;
   }
  






More information about the llvm-commits mailing list