aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/ADT/ScopedHashTable.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2010-09-17 15:48:55 +0000
committerDimitry Andric <dim@FreeBSD.org>2010-09-17 15:48:55 +0000
commitd39c594d39df7f283c2fb8a704a3f31c501180d9 (patch)
tree36453626c792cccd91f783a38a169d610a6b9db9 /include/llvm/ADT/ScopedHashTable.h
parent6144c1de6a7674dad94290650e4e14f24d42e421 (diff)
Notes
Diffstat (limited to 'include/llvm/ADT/ScopedHashTable.h')
-rw-r--r--include/llvm/ADT/ScopedHashTable.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/llvm/ADT/ScopedHashTable.h b/include/llvm/ADT/ScopedHashTable.h
index b5ca374a7ddd..c96ad19707f3 100644
--- a/include/llvm/ADT/ScopedHashTable.h
+++ b/include/llvm/ADT/ScopedHashTable.h
@@ -139,7 +139,12 @@ public:
}
V lookup(const K &Key) {
- return TopLevelMap[Key]->getValue();
+ typename DenseMap<K, ScopedHashTableVal<K, V, KInfo>*, KInfo>::iterator
+ I = TopLevelMap.find(Key);
+ if (I != TopLevelMap.end())
+ return I->second->getValue();
+
+ return V();
}
void insert(const K &Key, const V &Val) {