[llvm] [AsmParser] Remove OperandMatchResultTy (PR #126650)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 10 18:04:54 PST 2025


================
@@ -122,15 +122,13 @@ struct ParseInstructionInfo {
     : AsmRewrites(rewrites) {}
 };
 
-enum OperandMatchResultTy {
-  MatchOperand_Success,  // operand matched successfully
-  MatchOperand_NoMatch,  // operand did not match
-  MatchOperand_ParseFail // operand matched but had errors
-};
-
 /// Ternary parse status returned by various parse* methods.
 class ParseStatus {
-  enum class StatusTy { Success, Failure, NoMatch } Status;
+  enum class StatusTy {
+    Success, // operand matched successfully
+    Failure, // operand matched but had errors
+    NoMatch  // operand did not match
+  } Status;
----------------
s-barannikov wrote:

Note that this class can be used for reporting status of any parsing, not just operand parsing. I would suggest to reword the comments to something like
* parsing succeeded
* parsing failed after consuming some tokens
* parsing failed without consuming any tokens


https://github.com/llvm/llvm-project/pull/126650


More information about the llvm-commits mailing list