Add a private constructor for efficiency.
[oota-llvm.git] / include / llvm / ADT / APInt.h
index ca09ff68acffc9f2ecab7f192b5dc219384d678b..d4fba2006c8a36459ba31460699563d0a4b27db5 100644 (file)
@@ -60,6 +60,7 @@ namespace APIntOps {
 /// @brief Class for arbitrary precision integers.
 class APInt {
 public:
+
   uint32_t BitWidth;      ///< The number of bits in this APInt.
 
   /// This union is used to store the integer value. When the
@@ -76,6 +77,9 @@ public:
     APINT_WORD_SIZE = sizeof(uint64_t)
   };
 
+  // Fast internal constructor
+  APInt(uint64_t* val, uint32_t bits) : BitWidth(bits), pVal(val) { }
+
   /// Here one word's bitwidth equals to that of uint64_t.
   /// @returns the number of words to hold the integer value of this APInt.
   /// @brief Get the number of words.