Add count() method to MapVector
[oota-llvm.git] / include / llvm / ADT / MapVector.h
index 3f7a59641381cd484424e4cc4f6a87bb74c54336..6aacca5a6f0fc5c17c87ae1f9fb9fb4dd868cee4 100644 (file)
@@ -78,6 +78,11 @@ public:
     }
     return Vector[I].second;
   }
+
+  unsigned count(const KeyT &Key) const {
+    typename MapType::const_iterator Pos = Map.find(Key);
+    return Pos == Map.end()? 0 : 1;
+  }
 };
 
 }