diff options
author | Evan Cheng <evan.cheng@apple.com> | 2010-03-02 02:37:33 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2010-03-02 02:37:33 +0000 |
commit | d62cd93b6cf0ad5861bdfe0bd246f505ac3bb886 (patch) | |
tree | c4cee29d5ee033b2fd171d82b8b2ee211bcac08d /include | |
parent | 4fd9d3136226bf472a0c3a22799f91be39a331a3 (diff) | |
download | external_llvm-d62cd93b6cf0ad5861bdfe0bd246f505ac3bb886.zip external_llvm-d62cd93b6cf0ad5861bdfe0bd246f505ac3bb886.tar.gz external_llvm-d62cd93b6cf0ad5861bdfe0bd246f505ac3bb886.tar.bz2 |
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
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/ADT/ScopedHashTable.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/ADT/ScopedHashTable.h b/include/llvm/ADT/ScopedHashTable.h index d538295..df76693 100644 --- a/include/llvm/ADT/ScopedHashTable.h +++ b/include/llvm/ADT/ScopedHashTable.h @@ -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!"); |