llvm.org GIT mirror llvm / 17893a5
Add a static APInt::getNumWords git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68977 91177308-0d34-0410-b5e6-96231b3b80d8 Douglas Gregor 11 years ago
1 changed file(s) with 8 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
999999 /// @returns the number of words to hold the integer value of this APInt.
10001000 /// @brief Get the number of words.
10011001 unsigned getNumWords() const {
1002 return getNumWords(BitWidth);
1003 }
1004
1005 /// Here one word's bitwidth equals to that of uint64_t.
1006 /// @returns the number of words to hold the integer value with a
1007 /// given bit width.
1008 /// @brief Get the number of words.
1009 static unsigned getNumWords(unsigned BitWidth) {
10021010 return (BitWidth + APINT_BITS_PER_WORD - 1) / APINT_BITS_PER_WORD;
10031011 }
10041012