diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2010-05-04 00:33:13 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2010-05-04 00:33:13 +0000 |
| commit | 9989417f33b1a268286b2cc98263cbcb1a39c157 (patch) | |
| tree | 0e1a8cd0357f7c6f46d7a4ea597f51d916f29d10 /llvm/utils/TableGen | |
| parent | ce0c1e11ce6031a9bc23579bcb35e21178eef4f8 (diff) | |
| download | bcm5719-llvm-9989417f33b1a268286b2cc98263cbcb1a39c157.tar.gz bcm5719-llvm-9989417f33b1a268286b2cc98263cbcb1a39c157.zip | |
MC/Matcher: Add support for over-riding the default MatchInstruction function
name (for example, to allow targets to interpose the actual MatchInstruction
function).
llvm-svn: 102987
Diffstat (limited to 'llvm/utils/TableGen')
| -rw-r--r-- | llvm/utils/TableGen/AsmMatcherEmitter.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp index e5c068bcdf6..1947824cbf8 100644 --- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp +++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp @@ -1564,10 +1564,14 @@ void AsmMatcherEmitter::run(raw_ostream &OS) { Info.Instructions.begin(), ie = Info.Instructions.end(); it != ie; ++it) MaxNumOperands = std::max(MaxNumOperands, (*it)->Operands.size()); - - OS << "bool " << Target.getName() << ClassName - << "::\nMatchInstruction(const SmallVectorImpl<MCParsedAsmOperand*> " - "&Operands,\n MCInst &Inst) {\n"; + + 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"; // Emit the static match table; unused classes get initalized to 0 which is // guaranteed to be InvalidMatchClass. |

