aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-02-25 07:29:03 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-02-25 07:29:03 +0000
commit20b1f5db1e93d28debc6449dcd56da6ca7aa6b67 (patch)
treefffa6fb5e8754815e4237bb0eb765a450ca37701
parent7d53a1c45eec9deed3b02678c59303d843fc7751 (diff)
Add a private constructor for efficiency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34580 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/ADT/APInt.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h
index ca09ff68ac..d4fba2006c 100644
--- a/include/llvm/ADT/APInt.h
+++ b/include/llvm/ADT/APInt.h
@@ -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.