[Support] Use hexdigit instead of manually coding the same thing. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259762 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper 2016-02-04 06:51:38 +00:00
parent 730d9343ca
commit a7bacb76b2

View File

@ -171,8 +171,8 @@ raw_ostream &raw_ostream::write_hex(unsigned long long N) {
char *CurPtr = EndPtr;
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, /*LowerCase*/true);
N /= 16;
}