[PATCH] D23496: [TableGen] Move OperandMatchResultTy enum to MCTargetAsmParser.h

Alex Bradbury via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 8 11:56:13 PDT 2016


asb retitled this revision from "[TableGen] Make AsmMatcherEmitter unconditionally expose OperandMatchResultTy enum" to "[TableGen] Move OperandMatchResultTy enum to MCTargetAsmParser.h".
asb updated the summary for this revision.
asb added a reviewer: grosbach.
asb updated this revision to Diff 74040.
asb added a comment.

Rather than the hacky previous approach (unconditionally emittingthe enum), move it to a header.


https://reviews.llvm.org/D23496

Files:
  include/llvm/MC/MCParser/MCTargetAsmParser.h
  utils/TableGen/AsmMatcherEmitter.cpp


Index: utils/TableGen/AsmMatcherEmitter.cpp
===================================================================
--- utils/TableGen/AsmMatcherEmitter.cpp
+++ utils/TableGen/AsmMatcherEmitter.cpp
@@ -2903,11 +2903,6 @@
      << "                                unsigned VariantID = 0);\n";
 
   if (!Info.OperandMatchInfo.empty()) {
-    OS << "\n  enum OperandMatchResultTy {\n";
-    OS << "    MatchOperand_Success,    // operand matched successfully\n";
-    OS << "    MatchOperand_NoMatch,    // operand did not match\n";
-    OS << "    MatchOperand_ParseFail   // operand matched but had errors\n";
-    OS << "  };\n";
     OS << "  OperandMatchResultTy MatchOperandParserImpl(\n";
     OS << "    OperandVector &Operands,\n";
     OS << "    StringRef Mnemonic);\n";
Index: include/llvm/MC/MCParser/MCTargetAsmParser.h
===================================================================
--- include/llvm/MC/MCParser/MCTargetAsmParser.h
+++ include/llvm/MC/MCParser/MCTargetAsmParser.h
@@ -82,6 +82,12 @@
     : AsmRewrites(rewrites) {}
 };
 
+enum OperandMatchResultTy {
+  MatchOperand_Success,  // operand matched successfully
+  MatchOperand_NoMatch,  // operand did not match
+  MatchOperand_ParseFail // operand matched but had errors
+};
+
 /// MCTargetAsmParser - Generic interface to target specific assembly parsers.
 class MCTargetAsmParser : public MCAsmParserExtension {
 public:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23496.74040.patch
Type: text/x-patch
Size: 1400 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161008/45ae5831/attachment.bin>


More information about the llvm-commits mailing list