Add new function to allow removal of typed named elements
authorChris Lattner <sabre@nondot.org>
Thu, 30 Jan 2003 20:54:03 +0000 (20:54 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 30 Jan 2003 20:54:03 +0000 (20:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5442 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/SymbolTable.h

index 7e7cb51f20ae10ff9ea525cd966c83dd3bc7bfb7..fc5f470a65f739c8d2d0dc852e541c09fb94a472 100644 (file)
@@ -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