Add a new (simple) StringMap::clear method, patch by Pratik
[oota-llvm.git] / include / llvm / ADT / APSInt.h
index d08714fda24910cdff7ed114634d530cf7c4401f..705585c8a0c976da8a702ccdc9881f2893a471e0 100644 (file)
@@ -25,7 +25,8 @@ class APSInt : public APInt {
 public:
   /// APSInt ctor - Create an APSInt with the specified width, default to
   /// unsigned.
-  explicit APSInt(uint32_t BitWidth) : APInt(BitWidth, 0), IsUnsigned(true) {}
+  explicit APSInt(uint32_t BitWidth, bool isUnsigned = true) 
+   : APInt(BitWidth, 0), IsUnsigned(isUnsigned) {}
 
   explicit APSInt(const APInt &I, bool isUnsigned = true) 
    : APInt(I), IsUnsigned(isUnsigned) {}
@@ -129,8 +130,8 @@ public:
   // The remaining operators just wrap the logic of APInt, but retain the
   // signedness information.
   
-  APSInt operator<<(unsigned Bits) {
-    return APSInt(static_cast<APInt&>(*this) << Bits, IsUnsigned);
+  APSInt operator<<(unsigned Bits) const {
+    return APSInt(static_cast<const APInt&>(*this) << Bits, IsUnsigned);
   }  
   APSInt& operator<<=(unsigned Amt) {
     *this = *this << Amt;
@@ -222,7 +223,7 @@ public:
     assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
     return APSInt(static_cast<const APInt&>(*this) - RHS, IsUnsigned);
   }
-  APSInt operator~() {    
+  APSInt operator~() const {    
     return APSInt(~static_cast<const APInt&>(*this), IsUnsigned);
   }