summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/raw_ostream.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2016-02-08 01:03:01 +0000
committerCraig Topper <craig.topper@gmail.com>2016-02-08 01:03:01 +0000
commit52fa32de18c58459e0fea3900d85ba63d30b8a60 (patch)
tree8a2dba1ad7e27870aeccc648e627d6dbb334ddee /llvm/lib/Support/raw_ostream.cpp
parent686e595d419abb38113c21b3a487997919ce5c0e (diff)
downloadbcm5719-llvm-52fa32de18c58459e0fea3900d85ba63d30b8a60.tar.gz
bcm5719-llvm-52fa32de18c58459e0fea3900d85ba63d30b8a60.zip
[Support] Use hexdigit. NFC
llvm-svn: 260068
Diffstat (limited to 'llvm/lib/Support/raw_ostream.cpp')
-rw-r--r--llvm/lib/Support/raw_ostream.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
index 592cb96e894..f5a3162e2ba 100644
--- a/llvm/lib/Support/raw_ostream.cpp
+++ b/llvm/lib/Support/raw_ostream.cpp
@@ -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;
}
OpenPOWER on IntegriCloud