Move APInt::operator! inline, it's small and fuses well with surrounding code when...
authorBenjamin Kramer <benny.kra@googlemail.com>
Wed, 14 Mar 2012 00:01:35 +0000 (00:01 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Wed, 14 Mar 2012 00:01:35 +0000 (00:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152688 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/APInt.h
lib/Support/APInt.cpp

index b08564ca733203550036cf1bc735871a2a7c571c..d8ed22249850092e3b0562725e654efc598a98f8 100644 (file)
@@ -561,7 +561,15 @@ public:
   /// Performs logical negation operation on this APInt.
   /// @returns true if *this is zero, false otherwise.
   /// @brief Logical negation operator.
-  bool operator!() const;
+  bool operator!() const {
+    if (isSingleWord())
+      return !VAL;
+
+    for (unsigned i = 0; i != getNumWords(); ++i)
+      if (pVal[i])
+        return false;
+    return true;
+  }
 
   /// @}
   /// @name Assignment Operators
index e5423f153c3e6733984fd9054a629bfd17cdc8e7..c5713a0eb17086f4995d961da74b233e6d25dff6 100644 (file)
@@ -457,16 +457,6 @@ APInt APInt::XorSlowCase(const APInt& RHS) const {
   return APInt(val, getBitWidth()).clearUnusedBits();
 }
 
-bool APInt::operator !() const {
-  if (isSingleWord())
-    return !VAL;
-
-  for (unsigned i = 0; i < getNumWords(); ++i)
-    if (pVal[i])
-      return false;
-  return true;
-}
-
 APInt APInt::operator*(const APInt& RHS) const {
   assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
   if (isSingleWord())