File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
lib/Target/RISCV/AsmParser Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -2154,19 +2154,23 @@ ParseStatus RISCVAsmParser::parsePseudoQCJumpSymbol(OperandVector &Operands) {
21542154
21552155 if (getLexer ().getKind () != AsmToken::Identifier)
21562156 return ParseStatus::NoMatch;
2157+
21572158 std::string Identifier (getTok ().getIdentifier ());
2159+ SMLoc E = SMLoc::getFromPointer (S.getPointer () + Identifier.size ());
21582160
21592161 if (getLexer ().peekTok ().is (AsmToken::At)) {
21602162 Lex ();
21612163 Lex ();
2164+ SMLoc PLTLoc = getLoc ();
21622165 StringRef PLT;
21632166 if (getParser ().parseIdentifier (PLT) || PLT != " plt" )
2164- return ParseStatus::Failure;
2167+ return Error (PLTLoc,
2168+ " '@plt' is the only valid operand for this instruction" );
2169+ E = SMLoc::getFromPointer (S.getPointer () + /* @plt*/ 4 );
21652170 } else {
21662171 Lex ();
21672172 }
21682173
2169- SMLoc E = SMLoc::getFromPointer (S.getPointer () + Identifier.size ());
21702174 RISCVMCExpr::Specifier Kind = RISCVMCExpr::VK_QC_E_JUMP_PLT;
21712175
21722176 MCSymbol *Sym = getContext ().getOrCreateSymbol (Identifier);
Original file line number Diff line number Diff line change @@ -22,3 +22,6 @@ qc.e.jal 2147483649
2222
2323# CHECK-MINUS: :[[@LINE+1]]:1: error: instruction requires the following: 'Xqcilb' (Qualcomm uC Long Branch Extension)
2424qc.e.jal 2147483640
25+
26+ # CHECK: :[[@LINE+1]]:12: error: '@plt' is the only valid operand for this instruction
27+ qc.e.j foo@rlt
You can’t perform that action at this time.
0 commit comments