summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/APFloat.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2013-01-18 21:45:30 +0000
committerJordan Rose <jordan_rose@apple.com>2013-01-18 21:45:30 +0000
commite1f76583dd25521e36cdbf33b4779e628bf1853f (patch)
treed16922cf74260671407cef26e9e7199df5beec2f /llvm/lib/Support/APFloat.cpp
parenta17b72e7cf66abee182177950cd0fee05bc6f3d2 (diff)
downloadbcm5719-llvm-e1f76583dd25521e36cdbf33b4779e628bf1853f.tar.gz
bcm5719-llvm-e1f76583dd25521e36cdbf33b4779e628bf1853f.zip
Add llvm::hexDigitValue to convert single characters to hex.
This is duplicated in a couple places in the codebase. Adopt this in APFloat. llvm-svn: 172851
Diffstat (limited to 'llvm/lib/Support/APFloat.cpp')
-rw-r--r--llvm/lib/Support/APFloat.cpp21
1 files changed, 1 insertions, 20 deletions
diff --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp
index 4a7a5d1a056..2ac86a289a4 100644
--- a/llvm/lib/Support/APFloat.cpp
+++ b/llvm/lib/Support/APFloat.cpp
@@ -16,6 +16,7 @@
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/Hashing.h"
+#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
@@ -101,26 +102,6 @@ decDigitValue(unsigned int c)
return c - '0';
}
-static unsigned int
-hexDigitValue(unsigned int c)
-{
- unsigned int r;
-
- r = c - '0';
- if (r <= 9)
- return r;
-
- r = c - 'A';
- if (r <= 5)
- return r + 10;
-
- r = c - 'a';
- if (r <= 5)
- return r + 10;
-
- return -1U;
-}
-
/* Return the value of a decimal exponent of the form
[+-]ddddddd.
OpenPOWER on IntegriCloud