Add count() and lookup() to ScopedHashTable. It might be useful to get information...
authorEvan Cheng <evan.cheng@apple.com>
Tue, 2 Mar 2010 02:37:33 +0000 (02:37 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Tue, 2 Mar 2010 02:37:33 +0000 (02:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97542 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/ScopedHashTable.h

index d5382954c6332c35f0845fc2d6c2ae2d013131ea..df766935db7cfa57f3b4b3e276f5ccd00771f5b0 100644 (file)
@@ -130,6 +130,14 @@ public:
     assert(CurScope == 0 && TopLevelMap.empty() && "Scope imbalance!");
   }
 
+  bool count(const K &Key) const {
+    return TopLevelMap.count(Key);
+  }
+
+  V lookup(const K &Key) {
+    return TopLevelMap[Key].getValue();
+  }
+
   void insert(const K &Key, const V &Val) {
     assert(CurScope && "No scope active!");