diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2010-11-27 13:19:46 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2010-11-27 13:19:46 +0000 |
| commit | f9c900d3c9ffc1c6f20e08ca962363397f7dc383 (patch) | |
| tree | ed78c43872cbf4397c27eea7550b2bd57c90cce7 | |
| parent | f80507c28ccc19024d0bf7afcd09564ed912a00f (diff) | |
| download | bcm5719-llvm-f9c900d3c9ffc1c6f20e08ca962363397f7dc383.tar.gz bcm5719-llvm-f9c900d3c9ffc1c6f20e08ca962363397f7dc383.zip | |
Add an optional LowerCase argument to hexdigit().
llvm-svn: 120213
| -rw-r--r-- | llvm/include/llvm/ADT/StringExtras.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/include/llvm/ADT/StringExtras.h b/llvm/include/llvm/ADT/StringExtras.h index 3c53adee63c..263723294a7 100644 --- a/llvm/include/llvm/ADT/StringExtras.h +++ b/llvm/include/llvm/ADT/StringExtras.h @@ -25,10 +25,11 @@ namespace llvm { template<typename T> class SmallVectorImpl; -/// hexdigit - Return the (uppercase) hexadecimal character for the +/// hexdigit - Return the hexadecimal character for the /// given number \arg X (which should be less than 16). -static inline char hexdigit(unsigned X) { - return X < 10 ? '0' + X : 'A' + X - 10; +static inline char hexdigit(unsigned X, bool LowerCase = false) { + const char HexChar = LowerCase ? 'a' : 'A'; + return X < 10 ? '0' + X : HexChar + X - 10; } /// utohex_buffer - Emit the specified number into the buffer specified by |

