summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-08-12 00:55:32 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-08-12 00:55:32 +0000
commit167b9d7f306652d0468f2e615e1014d7b86a90c8 (patch)
tree20b0ed8505ee4d3888122aa99395538ff316a18b /llvm
parent48595bf2bc47065c79626db50fb04a47f161ad85 (diff)
downloadbcm5719-llvm-167b9d7f306652d0468f2e615e1014d7b86a90c8.tar.gz
bcm5719-llvm-167b9d7f306652d0468f2e615e1014d7b86a90c8.zip
tblgen/AsmMatcher: Always emit the match function as 'MatchInstructionImpl',
target specific parsers can adapt the TargetAsmParser to this. llvm-svn: 110888
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Target/Target.td4
-rw-r--r--llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp10
-rw-r--r--llvm/lib/Target/X86/X86.td1
-rw-r--r--llvm/utils/TableGen/AsmMatcherEmitter.cpp9
4 files changed, 11 insertions, 13 deletions
diff --git a/llvm/include/llvm/Target/Target.td b/llvm/include/llvm/Target/Target.td
index 809e088e2b0..b141a77df4f 100644
--- a/llvm/include/llvm/Target/Target.td
+++ b/llvm/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/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index abaf704fa5e..6932afbdb41 100644
--- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -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);
/// }
diff --git a/llvm/lib/Target/X86/X86.td b/llvm/lib/Target/X86/X86.td
index fcb4e362694..a19f1acffac 100644
--- a/llvm/lib/Target/X86/X86.td
+++ b/llvm/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/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
index ddc7bad9d49..558398648d2 100644
--- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp
+++ b/llvm/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<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.
OpenPOWER on IntegriCloud