diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2014-07-14 21:56:54 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2014-07-14 21:56:54 +0000 |
| commit | 54b2d64cdc21bd9ef0fbfc4c0af2e204b691f420 (patch) | |
| tree | 488f66bc377213c157e61c16e4869b124c6d9912 | |
| parent | a56f8c227cef559f1fbc05972caa5f6bdc30c8b3 (diff) | |
| download | bcm5719-llvm-54b2d64cdc21bd9ef0fbfc4c0af2e204b691f420.tar.gz bcm5719-llvm-54b2d64cdc21bd9ef0fbfc4c0af2e204b691f420.zip | |
ADT: Surface LowerCase argument for utohexstr
The underlying function. utohex_buffer, already supports an argument for
deciding if the hex characters should be upper or lower case. Expose an
identical argument for utohexstr.
llvm-svn: 212991
| -rw-r--r-- | llvm/include/llvm/ADT/StringExtras.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/include/llvm/ADT/StringExtras.h b/llvm/include/llvm/ADT/StringExtras.h index a152f4d3c2a..0992f5d4a54 100644 --- a/llvm/include/llvm/ADT/StringExtras.h +++ b/llvm/include/llvm/ADT/StringExtras.h @@ -53,7 +53,7 @@ static inline unsigned hexDigitValue(char C) { /// This should only be used with unsigned types. /// template<typename IntTy> -static inline char *utohex_buffer(IntTy X, char *BufferEnd) { +static inline char *utohex_buffer(IntTy X, char *BufferEnd, bool LowerCase = false) { char *BufPtr = BufferEnd; *--BufPtr = 0; // Null terminate buffer. if (X == 0) { @@ -63,15 +63,15 @@ static inline char *utohex_buffer(IntTy X, char *BufferEnd) { while (X) { unsigned char Mod = static_cast<unsigned char>(X) & 15; - *--BufPtr = hexdigit(Mod); + *--BufPtr = hexdigit(Mod, LowerCase); X >>= 4; } return BufPtr; } -static inline std::string utohexstr(uint64_t X) { +static inline std::string utohexstr(uint64_t X, bool LowerCase = false) { char Buffer[17]; - return utohex_buffer(X, Buffer+17); + return utohex_buffer(X, Buffer+17, LowerCase); } static inline std::string utostr_32(uint32_t X, bool isNeg = false) { |

