tblgen/AsmMatcher: Always emit the match function as 'MatchInstructionImpl',
authorDaniel Dunbar <daniel@zuster.org>
Thu, 12 Aug 2010 00:55:32 +0000 (00:55 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 12 Aug 2010 00:55:32 +0000 (00:55 +0000)
target specific parsers can adapt the TargetAsmParser to this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110888 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/Target.td
lib/Target/ARM/AsmParser/ARMAsmParser.cpp
lib/Target/X86/X86.td
utils/TableGen/AsmMatcherEmitter.cpp

index 809e088e2b0c10a1a9c540b03743343901dce31a..b141a77df4f20539e2b1f6b55c85e668bc40f77c 100644 (file)
@@ -511,10 +511,6 @@ class AsmParser {
   // perform target specific instruction post-processing.
   string AsmParserInstCleanup  = "";
 
-  // MatchInstructionName - The name of the instruction matching function to
-  // generate.
-  string MatchInstructionName  = "MatchInstruction";
-
   // Variant - AsmParsers can be of multiple different variants.  Variants are
   // used to support targets that need to parser multiple formats for the
   // assembly language.
index abaf704fa5e5a83df01c966ad1b6b5c1a74d21a6..6932afbdb419c12c8b9d54650ae2a271d7b9e7f2 100644 (file)
@@ -80,13 +80,19 @@ private:
 
   bool ParseDirectiveSyntax(SMLoc L);
 
+  bool MatchInstruction(const SmallVectorImpl<MCParsedAsmOperand*> &Operands,
+                        MCInst &Inst) {
+    return MatchInstructionImpl(Operands, Inst);
+  }
+
   /// @name Auto-generated Match Functions
   /// {
 
   unsigned ComputeAvailableFeatures(const ARMSubtarget *Subtarget) const;
 
-  bool MatchInstruction(const SmallVectorImpl<MCParsedAsmOperand*> &Operands,
-                        MCInst &Inst);
+  bool MatchInstructionImpl(const SmallVectorImpl<MCParsedAsmOperand*>
+                              &Operands,
+                            MCInst &Inst);
 
   /// }
 
index fcb4e362694391ddea9a8b3023f3b999ebce0463..a19f1acffaca89b88c953cecacdb83168dcb8377 100644 (file)
@@ -182,7 +182,6 @@ include "X86CallingConv.td"
 // Currently the X86 assembly parser only supports ATT syntax.
 def ATTAsmParser : AsmParser {
   string AsmParserClassName = "ATTAsmParser";
-  string MatchInstructionName = "MatchInstructionImpl";
   int Variant = 0;
 
   // Discard comments in assembly strings.
index ddc7bad9d496ee3d2132b032031639eb61c2c8fd..558398648d2cc1f6bb19221860cab1c548fb6891 100644 (file)
@@ -1699,13 +1699,10 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {
        it != ie; ++it)
     MaxNumOperands = std::max(MaxNumOperands, (*it)->Operands.size());
 
-  const std::string &MatchName =
-    AsmParser->getValueAsString("MatchInstructionName");
   OS << "bool " << Target.getName() << ClassName << "::\n"
-     << MatchName
-     << "(const SmallVectorImpl<MCParsedAsmOperand*> &Operands,\n";
-  OS.indent(MatchName.size() + 1);
-  OS << "MCInst &Inst) {\n";
+     << "MatchInstructionImpl(const SmallVectorImpl<MCParsedAsmOperand*>"
+     << " &Operands,\n";
+  OS << "                     MCInst &Inst) {\n";
 
   // Emit the static match table; unused classes get initalized to 0 which is
   // guaranteed to be InvalidMatchClass.