[llvm-commits] [llvm] r160929 - /llvm/trunk/include/llvm/ADT/APInt.h

Benjamin Kramer benny.kra at googlemail.com
Sun Jul 29 05:33:29 PDT 2012


Author: d0k
Date: Sun Jul 29 07:33:29 2012
New Revision: 160929

URL: http://llvm.org/viewvc/llvm-project?rev=160929&view=rev
Log:
APInt: Simplify code.

No functionality change.

Modified:
    llvm/trunk/include/llvm/ADT/APInt.h

Modified: llvm/trunk/include/llvm/ADT/APInt.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/APInt.h?rev=160929&r1=160928&r2=160929&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/APInt.h (original)
+++ llvm/trunk/include/llvm/ADT/APInt.h Sun Jul 29 07:33:29 2012
@@ -357,13 +357,7 @@
   /// @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.





More information about the llvm-commits mailing list