From 4f98f834593f0a107268d19a557b63f0da33a751 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 12 Aug 2010 00:55:32 +0000 Subject: [PATCH] tblgen/AsmMatcher: Always emit the match function as 'MatchInstructionImpl', 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 | 4 ---- lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 10 ++++++++-- lib/Target/X86/X86.td | 1 - utils/TableGen/AsmMatcherEmitter.cpp | 9 +++------ 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/include/llvm/Target/Target.td b/include/llvm/Target/Target.td index 809e088e2b0..b141a77df4f 100644 --- a/include/llvm/Target/Target.td +++ b/include/llvm/Target/Target.td @@ -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. diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index abaf704fa5e..6932afbdb41 100644 --- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -80,13 +80,19 @@ private: bool ParseDirectiveSyntax(SMLoc L); + bool MatchInstruction(const SmallVectorImpl &Operands, + MCInst &Inst) { + return MatchInstructionImpl(Operands, Inst); + } + /// @name Auto-generated Match Functions /// { unsigned ComputeAvailableFeatures(const ARMSubtarget *Subtarget) const; - bool MatchInstruction(const SmallVectorImpl &Operands, - MCInst &Inst); + bool MatchInstructionImpl(const SmallVectorImpl + &Operands, + MCInst &Inst); /// } diff --git a/lib/Target/X86/X86.td b/lib/Target/X86/X86.td index fcb4e362694..a19f1acffac 100644 --- a/lib/Target/X86/X86.td +++ b/lib/Target/X86/X86.td @@ -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. diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp index ddc7bad9d49..558398648d2 100644 --- a/utils/TableGen/AsmMatcherEmitter.cpp +++ b/utils/TableGen/AsmMatcherEmitter.cpp @@ -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 &Operands,\n"; - OS.indent(MatchName.size() + 1); - OS << "MCInst &Inst) {\n"; + << "MatchInstructionImpl(const SmallVectorImpl" + << " &Operands,\n"; + OS << " MCInst &Inst) {\n"; // Emit the static match table; unused classes get initalized to 0 which is // guaranteed to be InvalidMatchClass.