aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-07-27 18:59:50 +0000
committerChris Lattner <sabre@nondot.org>2010-07-27 18:59:50 +0000
commit90f8795e1c0d43e5b3d6254ff2a3cad533069218 (patch)
tree3c5a1b2f62dd11ecc4e6c274d664a79d6e273beb /include/llvm/ADT
parent977fa34df8b54595ff64157d0f4e5a14921669e8 (diff)
downloadexternal_llvm-90f8795e1c0d43e5b3d6254ff2a3cad533069218.zip
external_llvm-90f8795e1c0d43e5b3d6254ff2a3cad533069218.tar.gz
external_llvm-90f8795e1c0d43e5b3d6254ff2a3cad533069218.tar.bz2
make lookup failures not fatal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109530 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT')
-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 b5ca374..c96ad19 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) {