llvm.org GIT mirror llvm / 4aeb489
Add an optional LowerCase argument to hexdigit(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120213 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 9 years ago
1 changed file(s) with 4 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
2424 namespace llvm {
2525 template class SmallVectorImpl;
2626
27 /// hexdigit - Return the (uppercase) hexadecimal character for the
27 /// hexdigit - Return the hexadecimal character for the
2828 /// given number \arg X (which should be less than 16).
29 static inline char hexdigit(unsigned X) {
30 return X < 10 ? '0' + X : 'A' + X - 10;
29 static inline char hexdigit(unsigned X, bool LowerCase = false) {
30 const char HexChar = LowerCase ? 'a' : 'A';
31 return X < 10 ? '0' + X : HexChar + X - 10;
3132 }
3233
3334 /// utohex_buffer - Emit the specified number into the buffer specified by