[Support] Use hexdigit. NFC

llvm-svn: 260068
This commit is contained in:
Craig Topper 2016-02-08 01:03:01 +00:00
parent 686e595d41
commit 52fa32de18
1 changed files with 2 additions and 3 deletions

View File

@ -420,11 +420,10 @@ raw_ostream &raw_ostream::operator<<(const FormattedNumber &FN) {
NumberBuffer[1] = '0';
char *EndPtr = NumberBuffer+Width;
char *CurPtr = EndPtr;
const char A = FN.Upper ? 'A' : 'a';
unsigned long long N = FN.HexValue;
while (N) {
uintptr_t x = N % 16;
*--CurPtr = (x < 10 ? '0' + x : A + x - 10);
unsigned char x = static_cast<unsigned char>(N) % 16;
*--CurPtr = hexdigit(x, !FN.Upper);
N /= 16;
}