Stub out assembly matcher (.s -> MCInst) tblgen backend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75378 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2009-07-11 19:39:44 +00:00
parent 4429aaf12f
commit d51ffcf303
3 changed files with 64 additions and 1 deletions

View File

@ -0,0 +1,24 @@
//===- AsmMatcherEmitter.cpp - Generate an assembly matcher ---------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This tablegen backend emits a target specifier matcher for converting parsed
// assembly operands in the MCInst structures.
//
//===----------------------------------------------------------------------===//
#include "AsmMatcherEmitter.h"
#include "CodeGenTarget.h"
#include "Record.h"
using namespace llvm;
void AsmMatcherEmitter::run(raw_ostream &O) {
EmitSourceFileHeader("Assembly Matcher Source Fragment", O);
CodeGenTarget Target;
}

View File

@ -0,0 +1,33 @@
//===- AsmMatcherEmitter.h - Generate an assembly matcher -------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This tablegen backend emits a target specifier matcher for converting parsed
// assembly operands in the MCInst structures.
//
//===----------------------------------------------------------------------===//
#ifndef ASMMATCHER_EMITTER_H
#define ASMMATCHER_EMITTER_H
#include "TableGenBackend.h"
#include <map>
#include <vector>
#include <cassert>
namespace llvm {
class AsmMatcherEmitter : public TableGenBackend {
RecordKeeper &Records;
public:
AsmMatcherEmitter(RecordKeeper &R) : Records(R) {}
// run - Output the matcher, returning true on failure.
void run(raw_ostream &o);
};
}
#endif

View File

@ -23,6 +23,7 @@
#include "InstrInfoEmitter.h"
#include "InstrEnumEmitter.h"
#include "AsmWriterEmitter.h"
#include "AsmMatcherEmitter.h"
#include "DAGISelEmitter.h"
#include "FastISelEmitter.h"
#include "SubtargetEmitter.h"
@ -43,7 +44,7 @@ enum ActionType {
PrintRecords,
GenEmitter,
GenRegisterEnums, GenRegister, GenRegisterHeader,
GenInstrEnums, GenInstrs, GenAsmWriter,
GenInstrEnums, GenInstrs, GenAsmWriter, GenAsmMatcher,
GenCallingConv,
GenClangDiagsDefs,
GenClangDiagGroups,
@ -77,6 +78,8 @@ namespace {
"Generate calling convention descriptions"),
clEnumValN(GenAsmWriter, "gen-asm-writer",
"Generate assembly writer"),
clEnumValN(GenAsmMatcher, "gen-asm-matcher",
"Generate assembly instruction matcher"),
clEnumValN(GenDAGISel, "gen-dag-isel",
"Generate a DAG instruction selector"),
clEnumValN(GenFastISel, "gen-fast-isel",
@ -210,6 +213,9 @@ int main(int argc, char **argv) {
case GenAsmWriter:
AsmWriterEmitter(Records).run(*Out);
break;
case GenAsmMatcher:
AsmMatcherEmitter(Records).run(*Out);
break;
case GenClangDiagsDefs:
ClangDiagsDefsEmitter(Records, ClangComponent).run(*Out);
break;