summaryrefslogtreecommitdiffstats
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
commit16f043a12aabfc3454663bf57984dcb457a9d2f7 (patch)
tree286435a10a447b614d9278a66c6334f0edc9cb54
parentd6b853ad1bfd35298353af54a4517527b671be08 (diff)
downloadbcm5719-llvm-16f043a12aabfc3454663bf57984dcb457a9d2f7.tar.gz
bcm5719-llvm-16f043a12aabfc3454663bf57984dcb457a9d2f7.zip
Add a private constructor for efficiency.
llvm-svn: 34580
-rw-r--r--llvm/include/llvm/ADT/APInt.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/include/llvm/ADT/APInt.h b/llvm/include/llvm/ADT/APInt.h
index ca09ff68acf..d4fba2006c8 100644
--- a/llvm/include/llvm/ADT/APInt.h
+++ b/llvm/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.
OpenPOWER on IntegriCloud