projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6183fbd
)
Add count() and lookup() to ScopedHashTable. It might be useful to get information...
author
Evan Cheng
<evan.cheng@apple.com>
Tue, 2 Mar 2010 02:37:33 +0000
(
02:37
+0000)
committer
Evan 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
patch
|
blob
|
history
diff --git
a/include/llvm/ADT/ScopedHashTable.h
b/include/llvm/ADT/ScopedHashTable.h
index d5382954c6332c35f0845fc2d6c2ae2d013131ea..df766935db7cfa57f3b4b3e276f5ccd00771f5b0 100644
(file)
--- 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!");