1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Add a static APInt::getNumWords

llvm-svn: 68977
This commit is contained in:
Douglas Gregor 2009-04-13 19:43:10 +00:00
parent 92d79ef835
commit d2b9d57e20

View File

@ -1000,6 +1000,14 @@ public:
/// @returns the number of words to hold the integer value of this APInt.
/// @brief Get the number of words.
unsigned getNumWords() const {
return getNumWords(BitWidth);
}
/// Here one word's bitwidth equals to that of uint64_t.
/// @returns the number of words to hold the integer value with a
/// given bit width.
/// @brief Get the number of words.
static unsigned getNumWords(unsigned BitWidth) {
return (BitWidth + APINT_BITS_PER_WORD - 1) / APINT_BITS_PER_WORD;
}