diff options
author | Nico Weber <nicolasweber@gmx.de> | 2019-10-07 11:46:26 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2019-10-07 11:46:26 +0000 |
commit | 0fedc26a0dc0066f3968b9fea6a4e1f746c8d5a4 (patch) | |
tree | 02ea4379d3e28bf16aeebf0b27bbcab2eaa41228 /llvm/lib/MC | |
parent | 77c97002dc1ac66b429d8012df0536f0fd78a826 (diff) | |
download | bcm5719-llvm-0fedc26a0dc0066f3968b9fea6a4e1f746c8d5a4.tar.gz bcm5719-llvm-0fedc26a0dc0066f3968b9fea6a4e1f746c8d5a4.zip |
Revert r373888 "[IA] Recognize hexadecimal escape sequences"
It broke MC/AsmParser/directive_ascii.s on all bots:
Assertion failed: (Index < Length && "Invalid index!"), function operator[],
file ../../llvm/include/llvm/ADT/StringRef.h, line 243.
llvm-svn: 373898
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r-- | llvm/lib/MC/MCParser/AsmParser.cpp | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp index b25959b102d..381bf964161 100644 --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/lib/MC/MCParser/AsmParser.cpp @@ -2914,26 +2914,11 @@ bool AsmParser::parseEscapedString(std::string &Data) { } // Recognize escaped characters. Note that this escape semantics currently - // loosely follows Darwin 'as'. + // loosely follows Darwin 'as'. Notably, it doesn't support hex escapes. ++i; if (i == e) return TokError("unexpected backslash at end of string"); - // Recognize hex sequences similarly to GNU 'as'. - if (Str[i] == 'x' || Str[i] == 'X') { - if (!isHexDigit(Str[i + 1])) - return TokError("invalid hexadecimal escape sequence"); - - // Consume hex characters. GNU 'as' reads all hexadecimal characters and - // then truncates to the lower 16 bits. Seems reasonable. - unsigned Value = 0; - while (isHexDigit(Str[i + 1])) - Value = Value * 16 + hexDigitValue(Str[++i]); - - Data += (unsigned char)(Value & 0xFF); - continue; - } - // Recognize octal sequences. if ((unsigned)(Str[i] - '0') <= 7) { // Consume up to three octal characters. |