From d08f32f66adf1ec9735d99cd8f63333e15cf3db0 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Thu, 4 Feb 2016 06:51:38 +0000 Subject: [Support] Use hexdigit instead of manually coding the same thing. NFC llvm-svn: 259762 --- llvm/lib/Support/raw_ostream.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm') diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp index 4bea934a4b4..2a9965ecc30 100644 --- a/llvm/lib/Support/raw_ostream.cpp +++ b/llvm/lib/Support/raw_ostream.cpp @@ -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(N) % 16; + *--CurPtr = hexdigit(x, /*LowerCase*/true); N /= 16; } -- cgit v1.2.3