aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-03-03 06:17:23 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-03-03 06:17:23 +0000
commit28bb83625accaa7b44d60c71794d35e3e8d61039 (patch)
treee73b355d3675b0c23492bfdc66637f9591b883e4
parentda347141ecb7ce44c532cdc51b000d5ab65db79f (diff)
Make getNumWords public so that those using getRawData stand a chance of
not reading beyond the end of the buffer returned. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34873 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/ADT/APInt.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h
index 3a73b5ffeb..55633ea156 100644
--- a/include/llvm/ADT/APInt.h
+++ b/include/llvm/ADT/APInt.h
@@ -79,13 +79,6 @@ class APInt {
// 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.
- inline uint32_t getNumWords() const {
- return (BitWidth + APINT_BITS_PER_WORD - 1) / APINT_BITS_PER_WORD;
- }
-
/// @returns true if the number of bits <= 64, false otherwise.
/// @brief Determine if this APInt just has one word to store value.
inline bool isSingleWord() const {
@@ -486,6 +479,13 @@ public:
return whichWord(getActiveBits()-1) + 1;
}
+ /// 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.
+ inline uint32_t getNumWords() const {
+ return (BitWidth + APINT_BITS_PER_WORD - 1) / APINT_BITS_PER_WORD;
+ }
+
/// This function returns a pointer to the internal storage of the APInt.
/// This is useful for writing out the APInt in binary form without any
/// conversions.