diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/ADT/APInt.h | 2 | ||||
-rw-r--r-- | include/llvm/ADT/APSInt.h | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h index 971822f..0102d67 100644 --- a/include/llvm/ADT/APInt.h +++ b/include/llvm/ADT/APInt.h @@ -932,7 +932,7 @@ public: /// radix given. The radix can be 2, 8, 10 or 16. /// @returns a character interpretation of the APInt /// @brief Convert unsigned APInt to string representation. - inline std::string toString(uint8_t radix = 10) const { + inline std::string toStringUnsigned(uint8_t radix = 10) const { return toString(radix, false); } diff --git a/include/llvm/ADT/APSInt.h b/include/llvm/ADT/APSInt.h index 7e515da..91dd709 100644 --- a/include/llvm/ADT/APSInt.h +++ b/include/llvm/ADT/APSInt.h @@ -52,6 +52,12 @@ public: void setIsUnsigned(bool Val) { IsUnsigned = Val; } void setIsSigned(bool Val) { IsUnsigned = !Val; } + /// This is used internally to convert an APInt to a string. + /// @brief Converts an APInt to a std::string + std::string toString(uint8_t Radix) const { + return toString(Radix, isSigned()); + } + const APSInt &operator%=(const APSInt &RHS) { assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!"); |