APInt: Simplify code.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sun, 29 Jul 2012 12:33:29 +0000 (12:33 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sun, 29 Jul 2012 12:33:29 +0000 (12:33 +0000)
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160929 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/APInt.h

index 9498ef031dc2576f2e05b4e1c6807a6540b12ba2..f30a6e3f081cd35a6f7f47b111a4063962215900 100644 (file)
@@ -357,13 +357,7 @@ public:
   /// @brief Check if this APInt has an N-bits unsigned integer value.
   bool isIntN(unsigned N) const {
     assert(N && "N == 0 ???");
-    if (N >= getBitWidth())
-      return true;
-
-    if (isSingleWord())
-      return isUIntN(N, VAL);
-    return APInt(N, makeArrayRef(pVal, getNumWords())).zext(getBitWidth())
-      == (*this);
+    return getActiveBits() <= N;
   }
 
   /// @brief Check if this APInt has an N-bits signed integer value.