[PATCH] D101665: [SystemZ][z/OS] Enforce prefix-less registers in SystemZAsmParser for the HLASM dialect.
Anirudh Prasad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 3 08:45:00 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3ed6a6f6cdea: [SystemZ][z/OS] Enforce prefix-less registers in SystemZAsmParser for the HLASM… (authored by anirudhp).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101665/new/
https://reviews.llvm.org/D101665
Files:
llvm/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp
Index: llvm/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp
===================================================================
--- llvm/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp
+++ llvm/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp
@@ -830,7 +830,7 @@
}
// Handle register names of the form %<prefix><number>
- if (Parser.getTok().is(AsmToken::Percent)) {
+ if (isParsingATT() && Parser.getTok().is(AsmToken::Percent)) {
if (parseRegister(Reg))
return MatchOperand_ParseFail;
@@ -912,6 +912,9 @@
Operands.push_back(SystemZOperand::createImm(Register, StartLoc, EndLoc));
}
else {
+ if (isParsingHLASM())
+ return MatchOperand_NoMatch;
+
Register Reg;
if (parseRegister(Reg))
return MatchOperand_ParseFail;
@@ -1019,7 +1022,7 @@
if (getLexer().is(AsmToken::LParen)) {
Parser.Lex();
- if (getLexer().is(AsmToken::Percent)) {
+ if (isParsingATT() && getLexer().is(AsmToken::Percent)) {
// Parse the first register.
HaveReg1 = true;
if (parseRegister(Reg1))
@@ -1062,7 +1065,7 @@
if (parseIntegerRegister(Reg2, RegGR))
return true;
} else {
- if (parseRegister(Reg2))
+ if (isParsingATT() && parseRegister(Reg2))
return true;
}
}
@@ -1419,7 +1422,7 @@
// a context-dependent parse routine, which gives the required register
// class. The code is here to mop up other cases, like those where
// the instruction isn't recognized.
- if (Parser.getTok().is(AsmToken::Percent)) {
+ if (isParsingATT() && Parser.getTok().is(AsmToken::Percent)) {
Register Reg;
if (parseRegister(Reg))
return true;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101665.342408.patch
Type: text/x-patch
Size: 1693 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210503/f7d4dbc4/attachment.bin>
More information about the llvm-commits
mailing list