[llvm-commits] CVS: llvm/include/llvm/ADT/APInt.h
Reid Spencer
reid at x10sys.com
Fri Apr 13 12:19:27 PDT 2007
Changes in directory llvm/include/llvm/ADT:
APInt.h updated: 1.65 -> 1.66
---
Log message:
Implement a getBitsNeeded method to determine how many bits are needed to
represent a string in binary form by an APInt.
---
Diffs of the changes: (+6 -0)
APInt.h | 6 ++++++
1 files changed, 6 insertions(+)
Index: llvm/include/llvm/ADT/APInt.h
diff -u llvm/include/llvm/ADT/APInt.h:1.65 llvm/include/llvm/ADT/APInt.h:1.66
--- llvm/include/llvm/ADT/APInt.h:1.65 Tue Apr 10 11:33:06 2007
+++ llvm/include/llvm/ADT/APInt.h Fri Apr 13 14:19:07 2007
@@ -840,6 +840,12 @@
assert(getActiveBits() <= 64 && "Too many bits for int64_t");
return int64_t(pVal[0]);
}
+
+ /// This method determines how many bits are required to hold the APInt
+ /// equivalent of the string given by \p str of length \p slen.
+ /// @brief Get bits required for string value.
+ static uint32_t getBitsNeeded(const char* str, uint32_t slen, uint8_t radix);
+
/// countLeadingZeros - This function is an APInt version of the
/// countLeadingZeros_{32,64} functions in MathExtras.h. It counts the number
/// of zeros from the most significant bit to the first one bit.
More information about the llvm-commits
mailing list