From: Chris Lattner Date: Thu, 30 Jan 2003 20:54:03 +0000 (+0000) Subject: Add new function to allow removal of typed named elements X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=fe9664ce7cd0cbcba7a3effe8508356e8d1faa13;p=oota-llvm.git 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 --- diff --git a/include/llvm/SymbolTable.h b/include/llvm/SymbolTable.h index 7e7cb51f20a..fc5f470a65f 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