[RISCV] Return MatchOperand_ParseFail instead of MatchOperand_NoMatch from parseFPImm.
authorCraig Topper <craig.topper@sifive.com>
Tue, 7 Mar 2023 22:36:17 +0000 (14:36 -0800)
committerCraig Topper <craig.topper@sifive.com>
Tue, 7 Mar 2023 22:46:47 +0000 (14:46 -0800)
MatchOperand_NoMatch will fall back to regular operand parsing.
Returning MatchOperand_ParseFail will prevent this.

We also printed our own error message which we should only do for
MatchOperand_ParseFail.

llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp

index 3bb2270..e3c9e1d 100644 (file)
@@ -1570,7 +1570,7 @@ OperandMatchResultTy RISCVAsmParser::parseFPImm(OperandVector &Operands) {
   if (!Tok.is(AsmToken::Real) && !Tok.is(AsmToken::Integer) &&
       !Tok.is(AsmToken::Identifier)) {
     TokError("invalid floating point immediate");
-    return MatchOperand_NoMatch;
+    return MatchOperand_ParseFail;
   }
 
   // Parse special floats (inf/nan/min) representation.