make lookup failures not fatal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109530 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2010-07-27 18:59:50 +00:00
parent 977fa34df8
commit 90f8795e1c

View File

@ -139,7 +139,12 @@ public:
} }
V lookup(const K &Key) { 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) { void insert(const K &Key, const V &Val) {