diff options
author | Chris Lattner <sabre@nondot.org> | 2003-01-30 20:54:03 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-01-30 20:54:03 +0000 |
commit | fe9664ce7cd0cbcba7a3effe8508356e8d1faa13 (patch) | |
tree | 6cddf7f2a618cbb1f8f4531fcf24dee65bf64033 | |
parent | 2f6bb2bce13084dfc4c8acf47f9eae0578267aaa (diff) |
Add new function to allow removal of typed named elements
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5442 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/SymbolTable.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/llvm/SymbolTable.h b/include/llvm/SymbolTable.h index 7e7cb51f20..fc5f470a65 100644 --- a/include/llvm/SymbolTable.h +++ b/include/llvm/SymbolTable.h @@ -41,6 +41,11 @@ public: insertEntry(N->getName(), N->getType(), N); } + void remove(Value *N); + Value *type_remove(const type_iterator &It) { + return removeEntry(find(It->second->getType()), It); + } + // insert - Insert a constant or type into the symbol table with the specified // name... There can be a many to one mapping between names and // (constant/type)s. @@ -51,9 +56,11 @@ public: insertEntry(Name, V->getType(), V); } - void remove(Value *N); - Value *type_remove(const type_iterator &It) { - return removeEntry(find(It->second->getType()), It); + /// remove - Remove a constant or type from the symbol table with the + /// specified name. + Value *remove(const std::string &Name, Value *V) { + iterator TI = find(V->getType()); + return removeEntry(TI, TI->second.find(Name)); } // getUniqueName - Given a base name, return a string that is either equal to |