Use intptr_t instead of unsigned here, which is more appropriate
[oota-llvm.git] / include / llvm / ADT / PointerIntPair.h
index 4c4bb7dd081f89b65be532f080018ec218abbb96..9d34b44a530e75cad1b550237a30034f7ccf4212 100644 (file)
@@ -53,19 +53,19 @@ public:
   }
   
   void setInt(IntType Int) {
-    assert(Int < (1 << IntBits) && "Integer too large for field");
+    assert(intptr_t(Int) < (1 << IntBits) && "Integer too large for field");
     Value = reinterpret_cast<intptr_t>(getPointer()) | (intptr_t)Int;
   }
   
   void *getOpaqueValue() const { return reinterpret_cast<void*>(Value); }
   void setFromOpaqueValue(void *Val) { Value = reinterpret_cast<intptr_t>(Val);}
   
-  bool operator==(const PointerIntPair &RHS) const {
-    return Value == RHS.Value;
-  }
-  bool operator!=(const PointerIntPair &RHS) const {
-    return Value != RHS.Value;
-  }
+  bool operator==(const PointerIntPair &RHS) const {return Value == RHS.Value;}
+  bool operator!=(const PointerIntPair &RHS) const {return Value != RHS.Value;}
+  bool operator<(const PointerIntPair &RHS) const {return Value < RHS.Value;}
+  bool operator>(const PointerIntPair &RHS) const {return Value > RHS.Value;}
+  bool operator<=(const PointerIntPair &RHS) const {return Value <= RHS.Value;}
+  bool operator>=(const PointerIntPair &RHS) const {return Value >= RHS.Value;}
 };
 
 // Provide specialization of DenseMapInfo for PointerIntPair.