Skip to content

Commit 82c4153

Browse files
committed
Revert "[AsmParser] make .ascii support spaces as separators"
This reverts commit e0963ae. The change breaks some GDB tests. Revert it while we investigate.
1 parent 35debdf commit 82c4153

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

llvm/lib/MC/MCParser/AsmParser.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3008,20 +3008,13 @@ bool AsmParser::parseAngleBracketString(std::string &Data) {
30083008
}
30093009

30103010
/// parseDirectiveAscii:
3011-
// ::= .ascii [ "string"+ ( , "string"+ )* ]
3012-
/// ::= ( .asciz | .string ) [ "string" ( , "string" )* ]
3011+
/// ::= ( .ascii | .asciz | .string ) [ "string" ( , "string" )* ]
30133012
bool AsmParser::parseDirectiveAscii(StringRef IDVal, bool ZeroTerminated) {
30143013
auto parseOp = [&]() -> bool {
30153014
std::string Data;
3016-
if (checkForValidSection())
3015+
if (checkForValidSection() || parseEscapedString(Data))
30173016
return true;
3018-
// Only support spaces as separators for .ascii directive for now. See the
3019-
// discusssion at https://reviews.llvm.org/D91460 for more details
3020-
do {
3021-
if (parseEscapedString(Data))
3022-
return true;
3023-
getStreamer().emitBytes(Data);
3024-
} while (!ZeroTerminated && getTok().is(AsmToken::String));
3017+
getStreamer().emitBytes(Data);
30253018
if (ZeroTerminated)
30263019
getStreamer().emitBytes(StringRef("\0", 1));
30273020
return false;

llvm/test/MC/AsmParser/directive_ascii.s

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,3 @@ TEST6:
4848
TEST7:
4949
.ascii "\x64\Xa6B"
5050
.ascii "\xface\x0Fe"
51-
52-
# CHECK-LABEL: TEST8:
53-
# CHECK-NEXT: .byte 65
54-
# CHECK-NEXT: .byte 66
55-
# CHECK-NEXT: .byte 67
56-
# CHECK-NEXT: .byte 68
57-
TEST8:
58-
.ascii "A", "B" "C", "D"

0 commit comments

Comments
 (0)