precommit APSInt format for D140059
authorPeter Rong <PeterRong96@gmail.com>
Sat, 17 Dec 2022 20:59:59 +0000 (12:59 -0800)
committerPeter Rong <PeterRong96@gmail.com>
Sat, 17 Dec 2022 21:07:12 +0000 (13:07 -0800)
Signed-off-by: Peter Rong <PeterRong96@gmail.com>
llvm/include/llvm/ADT/APSInt.h

index c9c2118..c64cf30 100644 (file)
@@ -29,10 +29,10 @@ public:
 
   /// Create an APSInt with the specified width, default to unsigned.
   explicit APSInt(uint32_t BitWidth, bool isUnsigned = true)
-   : APInt(BitWidth, 0), IsUnsigned(isUnsigned) {}
+      : APInt(BitWidth, 0), IsUnsigned(isUnsigned) {}
 
   explicit APSInt(APInt I, bool isUnsigned = true)
-   : APInt(std::move(I)), IsUnsigned(isUnsigned) {}
+      : APInt(std::move(I)), IsUnsigned(isUnsigned) {}
 
   /// Construct an APSInt from a string representation.
   ///
@@ -137,7 +137,7 @@ public:
   APSInt operator>>(unsigned Amt) const {
     return IsUnsigned ? APSInt(lshr(Amt), true) : APSInt(ashr(Amt), false);
   }
-  APSIntoperator>>=(unsigned Amt) {
+  APSInt &operator>>=(unsigned Amt) {
     if (IsUnsigned)
       lshrInPlace(Amt);
     else
@@ -149,29 +149,27 @@ public:
                       : APSInt(relativeAShr(Amt), false);
   }
 
-  inline bool operator<(const APSIntRHS) const {
+  inline bool operator<(const APSInt &RHS) const {
     assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
     return IsUnsigned ? ult(RHS) : slt(RHS);
   }
-  inline bool operator>(const APSIntRHS) const {
+  inline bool operator>(const APSInt &RHS) const {
     assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
     return IsUnsigned ? ugt(RHS) : sgt(RHS);
   }
-  inline bool operator<=(const APSIntRHS) const {
+  inline bool operator<=(const APSInt &RHS) const {
     assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
     return IsUnsigned ? ule(RHS) : sle(RHS);
   }
-  inline bool operator>=(const APSIntRHS) const {
+  inline bool operator>=(const APSInt &RHS) const {
     assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
     return IsUnsigned ? uge(RHS) : sge(RHS);
   }
-  inline bool operator==(const APSIntRHS) const {
+  inline bool operator==(const APSInt &RHS) const {
     assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
     return eq(RHS);
   }
-  inline bool operator!=(const APSInt& RHS) const {
-    return !((*this) == RHS);
-  }
+  inline bool operator!=(const APSInt &RHS) const { return !((*this) == RHS); }
 
   bool operator==(int64_t RHS) const {
     return compareValues(*this, get(RHS)) == 0;
@@ -196,10 +194,10 @@ public:
   // signedness information.
 
   APSInt operator<<(unsigned Bits) const {
-    return APSInt(static_cast<const APInt&>(*this) << Bits, IsUnsigned);
+    return APSInt(static_cast<const APInt &>(*this) << Bits, IsUnsigned);
   }
-  APSIntoperator<<=(unsigned Amt) {
-    static_cast<APInt&>(*this) <<= Amt;
+  APSInt &operator<<=(unsigned Amt) {
+    static_cast<APInt &>(*this) <<= Amt;
     return *this;
   }
   APSInt relativeShl(unsigned Amt) const {
@@ -207,97 +205,99 @@ public:
                       : APSInt(relativeAShl(Amt), false);
   }
 
-  APSIntoperator++() {
-    ++(static_cast<APInt&>(*this));
+  APSInt &operator++() {
+    ++(static_cast<APInt &>(*this));
     return *this;
   }
-  APSIntoperator--() {
-    --(static_cast<APInt&>(*this));
+  APSInt &operator--() {
+    --(static_cast<APInt &>(*this));
     return *this;
   }
   APSInt operator++(int) {
-    return APSInt(++static_cast<APInt&>(*this), IsUnsigned);
+    return APSInt(++static_cast<APInt &>(*this), IsUnsigned);
   }
   APSInt operator--(int) {
-    return APSInt(--static_cast<APInt&>(*this), IsUnsigned);
+    return APSInt(--static_cast<APInt &>(*this), IsUnsigned);
   }
   APSInt operator-() const {
-    return APSInt(-static_cast<const APInt&>(*this), IsUnsigned);
+    return APSInt(-static_cast<const APInt &>(*this), IsUnsigned);
   }
-  APSInt& operator+=(const APSInt& RHS) {
+  APSInt &operator+=(const APSInt &RHS) {
     assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
-    static_cast<APInt&>(*this) += RHS;
+    static_cast<APInt &>(*this) += RHS;
     return *this;
   }
-  APSInt& operator-=(const APSInt& RHS) {
+  APSInt &operator-=(const APSInt &RHS) {
     assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
-    static_cast<APInt&>(*this) -= RHS;
+    static_cast<APInt &>(*this) -= RHS;
     return *this;
   }
-  APSInt& operator*=(const APSInt& RHS) {
+  APSInt &operator*=(const APSInt &RHS) {
     assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
-    static_cast<APInt&>(*this) *= RHS;
+    static_cast<APInt &>(*this) *= RHS;
     return *this;
   }
-  APSInt& operator&=(const APSInt& RHS) {
+  APSInt &operator&=(const APSInt &RHS) {
     assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
-    static_cast<APInt&>(*this) &= RHS;
+    static_cast<APInt &>(*this) &= RHS;
     return *this;
   }
-  APSInt& operator|=(const APSInt& RHS) {
+  APSInt &operator|=(const APSInt &RHS) {
     assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
-    static_cast<APInt&>(*this) |= RHS;
+    static_cast<APInt &>(*this) |= RHS;
     return *this;
   }
-  APSInt& operator^=(const APSInt& RHS) {
+  APSInt &operator^=(const APSInt &RHS) {
     assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
-    static_cast<APInt&>(*this) ^= RHS;
+    static_cast<APInt &>(*this) ^= RHS;
     return *this;
   }
 
-  APSInt operator&(const APSIntRHS) const {
+  APSInt operator&(const APSInt &RHS) const {
     assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
-    return APSInt(static_cast<const APInt&>(*this) & RHS, IsUnsigned);
+    return APSInt(static_cast<const APInt &>(*this) & RHS, IsUnsigned);
   }
 
-  APSInt operator|(const APSIntRHS) const {
+  APSInt operator|(const APSInt &RHS) const {
     assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
-    return APSInt(static_cast<const APInt&>(*this) | RHS, IsUnsigned);
+    return APSInt(static_cast<const APInt &>(*this) | RHS, IsUnsigned);
   }
 
   APSInt operator^(const APSInt &RHS) const {
     assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
-    return APSInt(static_cast<const APInt&>(*this) ^ RHS, IsUnsigned);
+    return APSInt(static_cast<const APInt &>(*this) ^ RHS, IsUnsigned);
   }
 
-  APSInt operator*(const APSIntRHS) const {
+  APSInt operator*(const APSInt &RHS) const {
     assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
-    return APSInt(static_cast<const APInt&>(*this) * RHS, IsUnsigned);
+    return APSInt(static_cast<const APInt &>(*this) * RHS, IsUnsigned);
   }
-  APSInt operator+(const APSIntRHS) const {
+  APSInt operator+(const APSInt &RHS) const {
     assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
-    return APSInt(static_cast<const APInt&>(*this) + RHS, IsUnsigned);
+    return APSInt(static_cast<const APInt &>(*this) + RHS, IsUnsigned);
   }
-  APSInt operator-(const APSIntRHS) const {
+  APSInt operator-(const APSInt &RHS) const {
     assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
-    return APSInt(static_cast<const APInt&>(*this) - RHS, IsUnsigned);
+    return APSInt(static_cast<const APInt &>(*this) - RHS, IsUnsigned);
   }
   APSInt operator~() const {
-    return APSInt(~static_cast<const APInt&>(*this), IsUnsigned);
+    return APSInt(~static_cast<const APInt &>(*this), IsUnsigned);
   }
 
   /// Return the APSInt representing the maximum integer value with the given
   /// bit width and signedness.
   static APSInt getMaxValue(uint32_t numBits, bool Unsigned) {
     return APSInt(Unsigned ? APInt::getMaxValue(numBits)
-                           : APInt::getSignedMaxValue(numBits), Unsigned);
+                           : APInt::getSignedMaxValue(numBits),
+                  Unsigned);
   }
 
   /// Return the APSInt representing the minimum integer value with the given
   /// bit width and signedness.
   static APSInt getMinValue(uint32_t numBits, bool Unsigned) {
     return APSInt(Unsigned ? APInt::getMinValue(numBits)
-                           : APInt::getSignedMinValue(numBits), Unsigned);
+                           : APInt::getSignedMinValue(numBits),
+                  Unsigned);
   }
 
   /// Determine if two APSInts have the same value, zero- or
@@ -337,7 +337,7 @@ public:
 
   /// Used to insert APSInt objects, or objects that contain APSInt objects,
   /// into FoldingSets.
-  void Profile(FoldingSetNodeIDID) const;
+  void Profile(FoldingSetNodeID &ID) const;
 };
 
 inline bool operator==(int64_t V1, const APSInt &V2) { return V2 == V1; }