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:
977fa34
)
make lookup failures not fatal.
author
Chris Lattner
<sabre@nondot.org>
Tue, 27 Jul 2010 18:59:50 +0000
(18:59 +0000)
committer
Chris Lattner
<sabre@nondot.org>
Tue, 27 Jul 2010 18:59:50 +0000
(18:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109530
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 b5ca374a7ddd46acfb5ecd9a3baa72baf53eed2a..c96ad19707f38a2bdade59507120bde1bd05078b 100644
(file)
--- 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) {