make lookup failures not fatal.
[oota-llvm.git] / include / llvm / ADT / ScopedHashTable.h
index b5ca374a7ddd46acfb5ecd9a3baa72baf53eed2a..c96ad19707f38a2bdade59507120bde1bd05078b 100644 (file)
@@ -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) {