Add Imagination Technologies to the vendors in llvm::Triple
[oota-llvm.git] / include / llvm / ADT / SmallSet.h
index ecd3843cd0a7384d1b25c458e884ae8abc895866..bb1971eb7c5d09465bd9b1943f9ea5f55302483c 100644 (file)
@@ -37,21 +37,22 @@ class SmallSet {
   typedef typename SmallVector<T, N>::const_iterator VIterator;
   typedef typename SmallVector<T, N>::iterator mutable_iterator;
 public:
+  typedef size_t size_type;
   SmallSet() {}
 
   bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const {
     return Vector.empty() && Set.empty();
   }
 
-  unsigned size() const {
+  size_type size() const {
     return isSmall() ? Vector.size() : Set.size();
   }
 
-  /// count - Return true if the element is in the set.
-  bool count(const T &V) const {
+  /// count - Return 1 if the element is in the set, 0 otherwise.
+  size_type count(const T &V) const {
     if (isSmall()) {
       // Since the collection is small, just do a linear search.
-      return vfind(V) != Vector.end();
+      return vfind(V) == Vector.end() ? 0 : 1;
     } else {
       return Set.count(V);
     }