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 | 7f05aa72f970bdb92c831a83b02197b8699f7635 (patch) | |
| tree | c4cee29d5ee033b2fd171d82b8b2ee211bcac08d | |
| parent | 6183fbd7267a7de857e32a2106cfb46a219728f1 (diff) | |
| download | external_llvm-7f05aa72f970bdb92c831a83b02197b8699f7635.zip external_llvm-7f05aa72f970bdb92c831a83b02197b8699f7635.tar.gz external_llvm-7f05aa72f970bdb92c831a83b02197b8699f7635.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
| -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!"); |
