@@ -1191,9 +1191,9 @@ bool AsmParser::parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc,
11911191 return false ;
11921192 }
11931193 }
1194- // Parse symbol variant
1194+ // Parse an optional relocation specifier.
11951195 std::pair<StringRef, StringRef> Split;
1196- if (! MAI.useParensForSymbolVariant ()) {
1196+ if (MAI.useAtForSpecifier ()) {
11971197 if (FirstTokenKind == AsmToken::String) {
11981198 if (Lexer.is (AsmToken::At)) {
11991199 Lex (); // eat @
@@ -1207,8 +1207,8 @@ bool AsmParser::parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc,
12071207 } else {
12081208 Split = Identifier.split (' @' );
12091209 }
1210- } else if (Lexer. is (AsmToken::LParen)) {
1211- Lex (); // eat '('.
1210+ } else if (MAI. useParensForSpecifier () &&
1211+ parseOptionalToken (AsmToken::LParen)) {
12121212 StringRef VName;
12131213 parseIdentifier (VName);
12141214 if (parseRParen ())
@@ -1231,7 +1231,7 @@ bool AsmParser::parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc,
12311231 if (MaybeVariant) {
12321232 SymbolName = Split.first ;
12331233 Variant = MCSymbolRefExpr::VariantKind (*MaybeVariant);
1234- } else if (MAI.doesAllowAtInName () && !MAI. useParensForSymbolVariant () ) {
1234+ } else if (MAI.doesAllowAtInName ()) {
12351235 Variant = MCSymbolRefExpr::VK_None;
12361236 } else {
12371237 return Error (SMLoc::getFromPointer (Split.second .begin ()),
@@ -1463,7 +1463,8 @@ bool AsmParser::parseExpression(const MCExpr *&Res, SMLoc &EndLoc) {
14631463 // As a special case, we support 'a op b @ modifier' by rewriting the
14641464 // expression to include the modifier. This is inefficient, but in general we
14651465 // expect users to use 'a@modifier op b'.
1466- if (parseOptionalToken (AsmToken::At)) {
1466+ if (Ctx.getAsmInfo ()->useAtForSpecifier () &&
1467+ parseOptionalToken (AsmToken::At)) {
14671468 if (Lexer.isNot (AsmToken::Identifier))
14681469 return TokError (" unexpected symbol modifier following '@'" );
14691470
0 commit comments