craig.topper added inline comments.
================ Comment at: llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp:1473 + ErrorLoc, + "operand must like {ra [, s0[-sN]]} or {x1 [, x8[-x9][, x18[-xN]]]}"); + } ---------------- like -> be ``` "operand must be '{ra [, s0[-sN]]}' or '{x1 [, x8[-x9][, x18[-xN]]]}'" ``` ================ Comment at: llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp:2373 + if (RegEnd != RISCV::X9) + return MatchOperand_ParseFail; + ---------------- Need to call Error before returning ParseFail ================ Comment at: llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp:2443 + if (Operands[1]->getReg() == RegNo) { + Error(getLoc(), "'rs1' and 'rs2' mast be different"); + return MatchOperand_ParseFail; ---------------- You can check this in `validateInstruction` instead of during parsing. Then you don't need a custom parser. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132819/new/ https://reviews.llvm.org/D132819 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits