Add a new (simple) StringMap::clear method, patch by Pratik
[oota-llvm.git] / include / llvm / ADT / StringMap.h
index f180b363606067734c5bd6cf31611646521f234d..7189931abb9fb6c8a2a44bcaa91599e714817b7b 100644 (file)
@@ -333,6 +333,12 @@ public:
     return true;
   }
 
+  // clear - Empties out the StringMap
+  void clear() {
+    while (!empty())
+      erase(begin());
+  }
+
   /// GetOrCreateValue - Look up the specified key in the table.  If a value
   /// exists, return it.  Otherwise, default construct a value, insert it, and
   /// return.