aboutsummaryrefslogtreecommitdiffstats
path: root/lib
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
commit8a53a8329f47f86757af17dbea2864aa95414615 (patch)
treee5aa02a936c1281ba6c09526e56829e4c33d691f /lib
parentc91cbb9b0c90a480299cc7deaef166d47a61d9df (diff)
downloadexternal_llvm-8a53a8329f47f86757af17dbea2864aa95414615.zip
external_llvm-8a53a8329f47f86757af17dbea2864aa95414615.tar.gz
external_llvm-8a53a8329f47f86757af17dbea2864aa95414615.tar.bz2
Add llvm::hexDigitValue to convert single characters to hex.
This is duplicated in a couple places in the codebase. Adopt this in APFloat. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172851 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Support/APFloat.cpp21
1 files changed, 1 insertions, 20 deletions
diff --git a/lib/Support/APFloat.cpp b/lib/Support/APFloat.cpp
index 4a7a5d1..2ac86a2 100644
--- a/lib/Support/APFloat.cpp
+++ b/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.