diff options
author | Chris Lattner <sabre@nondot.org> | 2005-03-06 05:46:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-03-06 05:46:41 +0000 |
commit | c27aa8ddb25d758bd6d3e6e2ab9f2b06206e72ec (patch) | |
tree | e3e85dc07bd90289c12969528d8267dbd506cdeb /lib/VMCore/SymbolTable.cpp | |
parent | 1327c5ab990c76bb4f02e5e12434580ce108123e (diff) | |
download | llvm-c27aa8ddb25d758bd6d3e6e2ab9f2b06206e72ec.tar.gz llvm-c27aa8ddb25d758bd6d3e6e2ab9f2b06206e72ec.tar.bz2 llvm-c27aa8ddb25d758bd6d3e6e2ab9f2b06206e72ec.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20481 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/SymbolTable.cpp')
-rw-r--r-- | lib/VMCore/SymbolTable.cpp | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/lib/VMCore/SymbolTable.cpp b/lib/VMCore/SymbolTable.cpp index 024d4b3a10..2c5db71dad 100644 --- a/lib/VMCore/SymbolTable.cpp +++ b/lib/VMCore/SymbolTable.cpp @@ -166,23 +166,8 @@ Value *SymbolTable::removeEntry(plane_iterator Plane, value_iterator Entry) { 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 @@ bool SymbolTable::strip() { } for (type_iterator TI = tmap.begin(); TI != tmap.end(); ) { - const Type* T = (TI++)->second; - remove(T); + remove(TI++); RemovedSymbol = true; } |