@@ -591,16 +591,7 @@ struct RISCVOperand final : public MCParsedAsmOperand {
591591 (VK == RISCVMCExpr::VK_CALL || VK == RISCVMCExpr::VK_CALL_PLT);
592592 }
593593
594- bool isPseudoQCJumpSymbol () const {
595- int64_t Imm;
596- // Must be of 'immediate' type but not a constant.
597- if (!isImm () || evaluateConstantImm (getImm (), Imm))
598- return false ;
599-
600- RISCVMCExpr::Specifier VK = RISCVMCExpr::VK_None;
601- return RISCVAsmParser::classifySymbolRef (getImm (), VK) &&
602- VK == RISCVMCExpr::VK_QC_E_JUMP_PLT;
603- }
594+ bool isPseudoQCJumpSymbol () const { return isBareSymbol (); }
604595
605596 bool isPseudoJumpSymbol () const {
606597 int64_t Imm;
@@ -2079,9 +2070,6 @@ ParseStatus RISCVAsmParser::parseBareSymbol(OperandVector &Operands) {
20792070
20802071 SMLoc E = SMLoc::getFromPointer (S.getPointer () + Identifier.size ());
20812072
2082- if (Identifier.consume_back (" @plt" ))
2083- return Error (getLoc (), " '@plt' operand not valid for instruction" );
2084-
20852073 MCSymbol *Sym = getContext ().getOrCreateSymbol (Identifier);
20862074
20872075 if (Sym->isVariable ()) {
@@ -2129,8 +2117,9 @@ ParseStatus RISCVAsmParser::parseCallSymbol(OperandVector &Operands) {
21292117 Lex ();
21302118 Lex ();
21312119 StringRef PLT;
2120+ SMLoc Loc = getLoc ();
21322121 if (getParser ().parseIdentifier (PLT) || PLT != " plt" )
2133- return ParseStatus::Failure ;
2122+ return Error (Loc, " @ (except the deprecated/ignored @plt) is disallowed " ) ;
21342123 } else if (!getLexer ().peekTok ().is (AsmToken::EndOfStatement)) {
21352124 // Avoid parsing the register in `call rd, foo` as a call symbol.
21362125 return ParseStatus::NoMatch;
@@ -2157,25 +2146,10 @@ ParseStatus RISCVAsmParser::parsePseudoQCJumpSymbol(OperandVector &Operands) {
21572146
21582147 std::string Identifier (getTok ().getIdentifier ());
21592148 SMLoc E = getTok ().getEndLoc ();
2160-
2161- if (getLexer ().peekTok ().is (AsmToken::At)) {
2162- Lex ();
2163- Lex ();
2164- SMLoc PLTLoc = getLoc ();
2165- StringRef PLT;
2166- E = getTok ().getEndLoc ();
2167- if (getParser ().parseIdentifier (PLT) || PLT != " plt" )
2168- return Error (PLTLoc,
2169- " '@plt' is the only valid operand for this instruction" );
2170- } else {
2171- Lex ();
2172- }
2173-
2174- RISCVMCExpr::Specifier Kind = RISCVMCExpr::VK_QC_E_JUMP_PLT;
2149+ Lex ();
21752150
21762151 MCSymbol *Sym = getContext ().getOrCreateSymbol (Identifier);
21772152 Res = MCSymbolRefExpr::create (Sym, getContext ());
2178- Res = RISCVMCExpr::create (Res, Kind, getContext ());
21792153 Operands.push_back (RISCVOperand::createImm (Res, S, E, isRV64 ()));
21802154 return ParseStatus::Success;
21812155}
0 commit comments