[llvm] 8bdcf57 - Revert "[MC] Allow conversion between ParseStatus and MatchOperandResultTy"

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 2 08:57:36 PDT 2023


Author: Sergei Barannikov
Date: 2023-07-02T18:40:00+03:00
New Revision: 8bdcf57e60f508b11b519722ae9529a5301bb567

URL: https://github.com/llvm/llvm-project/commit/8bdcf57e60f508b11b519722ae9529a5301bb567
DIFF: https://github.com/llvm/llvm-project/commit/8bdcf57e60f508b11b519722ae9529a5301bb567.diff

LOG: Revert "[MC] Allow conversion between ParseStatus and MatchOperandResultTy"

This reverts commit 15ef9b26adeb8c9dd98228fc26757966d8355986.

Going to put it for review with larger set of differences.

Added: 
    

Modified: 
    llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h b/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h
index 1d87f0131efcb0..299f9b055ff779 100644
--- a/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h
+++ b/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h
@@ -122,12 +122,6 @@ 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;
@@ -152,17 +146,12 @@ class ParseStatus {
   constexpr bool isSuccess() const { return Status == StatusTy::Success; }
   constexpr bool isFailure() const { return Status == StatusTy::Failure; }
   constexpr bool isNoMatch() const { return Status == StatusTy::NoMatch; }
+};
 
-  // Allow implicit conversions to / from OperandMatchResultTy.
-  constexpr ParseStatus(OperandMatchResultTy R)
-      : Status(R == MatchOperand_Success     ? Success
-               : R == MatchOperand_ParseFail ? Failure
-                                             : NoMatch) {}
-  constexpr operator OperandMatchResultTy() const {
-    return isSuccess()   ? MatchOperand_Success
-           : isFailure() ? MatchOperand_ParseFail
-                         : MatchOperand_NoMatch;
-  }
+enum OperandMatchResultTy {
+  MatchOperand_Success,  // operand matched successfully
+  MatchOperand_NoMatch,  // operand did not match
+  MatchOperand_ParseFail // operand matched but had errors
 };
 
 enum class DiagnosticPredicateTy {


        


More information about the llvm-commits mailing list