summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/StringRef.cpp
diff options
context:
space:
mode:
authorColin LeMahieu <colinl@codeaurora.org>2016-03-18 18:22:07 +0000
committerColin LeMahieu <colinl@codeaurora.org>2016-03-18 18:22:07 +0000
commit01431465144de9f12ecdff4fe27d5bbdb767cbca (patch)
tree24ceed5d51843b752c73e63a0b58d9551da1d5f7 /llvm/lib/Support/StringRef.cpp
parent69082f051d678e662b922b5424c0db88eb08e791 (diff)
downloadbcm5719-llvm-01431465144de9f12ecdff4fe27d5bbdb767cbca.tar.gz
bcm5719-llvm-01431465144de9f12ecdff4fe27d5bbdb767cbca.zip
[MCParser] Accept uppercase radix variants 0X and 0B
Differential Revision: http://reviews.llvm.org/D14781 llvm-svn: 263802
Diffstat (limited to 'llvm/lib/Support/StringRef.cpp')
-rw-r--r--llvm/lib/Support/StringRef.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/StringRef.cpp b/llvm/lib/Support/StringRef.cpp
index 7ecff2964c5..8a9da5edca8 100644
--- a/llvm/lib/Support/StringRef.cpp
+++ b/llvm/lib/Support/StringRef.cpp
@@ -351,12 +351,12 @@ size_t StringRef::count(StringRef Str) const {
}
static unsigned GetAutoSenseRadix(StringRef &Str) {
- if (Str.startswith("0x")) {
+ if (Str.startswith("0x") || Str.startswith("0X")) {
Str = Str.substr(2);
return 16;
}
- if (Str.startswith("0b")) {
+ if (Str.startswith("0b") || Str.startswith("0B")) {
Str = Str.substr(2);
return 2;
}
OpenPOWER on IntegriCloud