[llvm] 6e2ade2 - [RISCV] Return MatchOperand_ParseFail instead of MatchOperand_NoMatch from parseFPImm.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 7 14:47:06 PST 2023
Author: Craig Topper
Date: 2023-03-07T14:46:47-08:00
New Revision: 6e2ade23c7944a09241d6cafe559f05b39cb17e8
URL: https://github.com/llvm/llvm-project/commit/6e2ade23c7944a09241d6cafe559f05b39cb17e8
DIFF: https://github.com/llvm/llvm-project/commit/6e2ade23c7944a09241d6cafe559f05b39cb17e8.diff
LOG: [RISCV] Return MatchOperand_ParseFail instead of MatchOperand_NoMatch from parseFPImm.
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.
Added:
Modified:
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp b/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
index 3bb227011204b..e3c9e1d3f0888 100644
--- a/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
+++ b/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
@@ -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.
More information about the llvm-commits
mailing list