Skip to content

Commit

Permalink
handle hexa number with 0X prefix, not just 0x
Browse files Browse the repository at this point in the history
  • Loading branch information
aquynh committed Aug 8, 2016
1 parent 2d4b37b commit f8a3eba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion llvm/lib/MC/MCParser/AsmLexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ AsmToken AsmLexer::LexDigit()
return intToken(Result, Value);
}

if (*CurPtr == 'x') {
if (*CurPtr == 'x' || *CurPtr == 'X') {
++CurPtr;
const char *NumStart = CurPtr;
while (isxdigit(CurPtr[0]))
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Support/StringRef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ 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;
}
Expand Down

0 comments on commit f8a3eba

Please sign in to comment.