Add count() and lookup() to ScopedHashTable. It might be useful to get information out of the hash table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97542 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2010-03-02 02:37:33 +00:00
parent 6183fbd726
commit 7f05aa72f9

View 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!");