Skip to content

Commit a02bbee

Browse files
committed
[AArch64][AsmParser] NFC: Use helpers in matrix tile list parsing
1 parent 40202b1 commit a02bbee

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3837,14 +3837,11 @@ bool AArch64AsmParser::parseSymbolicImmVal(const MCExpr *&ImmVal) {
38373837

38383838
OperandMatchResultTy
38393839
AArch64AsmParser::tryParseMatrixTileList(OperandVector &Operands) {
3840-
MCAsmParser &Parser = getParser();
3841-
3842-
if (Parser.getTok().isNot(AsmToken::LCurly))
3840+
if (getTok().isNot(AsmToken::LCurly))
38433841
return MatchOperand_NoMatch;
38443842

3845-
auto ParseMatrixTile = [this, &Parser](unsigned &Reg,
3846-
unsigned &ElementWidth) {
3847-
StringRef Name = Parser.getTok().getString();
3843+
auto ParseMatrixTile = [this](unsigned &Reg, unsigned &ElementWidth) {
3844+
StringRef Name = getTok().getString();
38483845
size_t DotPosition = Name.find('.');
38493846
if (DotPosition == StringRef::npos)
38503847
return MatchOperand_NoMatch;
@@ -3862,13 +3859,13 @@ AArch64AsmParser::tryParseMatrixTileList(OperandVector &Operands) {
38623859
}
38633860
ElementWidth = KindRes->second;
38643861
Reg = RegNum;
3865-
Parser.Lex(); // Eat the register.
3862+
Lex(); // Eat the register.
38663863
return MatchOperand_Success;
38673864
};
38683865

38693866
SMLoc S = getLoc();
3870-
auto LCurly = Parser.getTok();
3871-
Parser.Lex(); // Eat left bracket token.
3867+
auto LCurly = getTok();
3868+
Lex(); // Eat left bracket token.
38723869

38733870
// Empty matrix list
38743871
if (parseOptionalToken(AsmToken::RCurly)) {
@@ -3878,8 +3875,8 @@ AArch64AsmParser::tryParseMatrixTileList(OperandVector &Operands) {
38783875
}
38793876

38803877
// Try parse {za} alias early
3881-
if (Parser.getTok().getString().equals_insensitive("za")) {
3882-
Parser.Lex(); // Eat 'za'
3878+
if (getTok().getString().equals_insensitive("za")) {
3879+
Lex(); // Eat 'za'
38833880

38843881
if (parseToken(AsmToken::RCurly, "'}' expected"))
38853882
return MatchOperand_ParseFail;
@@ -3894,7 +3891,7 @@ AArch64AsmParser::tryParseMatrixTileList(OperandVector &Operands) {
38943891
unsigned FirstReg, ElementWidth;
38953892
auto ParseRes = ParseMatrixTile(FirstReg, ElementWidth);
38963893
if (ParseRes != MatchOperand_Success) {
3897-
Parser.getLexer().UnLex(LCurly);
3894+
getLexer().UnLex(LCurly);
38983895
return ParseRes;
38993896
}
39003897

0 commit comments

Comments
 (0)