]> granicus.if.org Git - llvm/commitdiff
[APInt] Implement operator! using operator==(uint64_t). NFCI
authorCraig Topper <craig.topper@gmail.com>
Sat, 1 Apr 2017 06:50:00 +0000 (06:50 +0000)
committerCraig Topper <craig.topper@gmail.com>
Sat, 1 Apr 2017 06:50:00 +0000 (06:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299293 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/APInt.h

index f2d4390a8117e0d5b5e44adee2c93335ae2e0b38..402422507a57842814d13c69a009500f58c1d7dc 100644 (file)
@@ -627,13 +627,7 @@ public:
   ///
   /// \returns true if *this is zero, false otherwise.
   bool operator!() const {
-    if (isSingleWord())
-      return !VAL;
-
-    for (unsigned i = 0; i != getNumWords(); ++i)
-      if (pVal[i])
-        return false;
-    return true;
+    return *this == 0;
   }
 
   /// @}