diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-11 19:39:44 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-11 19:39:44 +0000 |
commit | d51ffcf303070b0a5aea7f365b85f6f969c384cb (patch) | |
tree | a918e8c59288ca387aa52e4c642c4d96b75d5124 /utils/TableGen | |
parent | 4429aaf12f5c0c7a3718e5abf9edfa52a1fcdb8a (diff) | |
download | external_llvm-d51ffcf303070b0a5aea7f365b85f6f969c384cb.zip external_llvm-d51ffcf303070b0a5aea7f365b85f6f969c384cb.tar.gz external_llvm-d51ffcf303070b0a5aea7f365b85f6f969c384cb.tar.bz2 |
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
Diffstat (limited to 'utils/TableGen')
-rw-r--r-- | utils/TableGen/AsmMatcherEmitter.cpp | 24 | ||||
-rw-r--r-- | utils/TableGen/AsmMatcherEmitter.h | 33 | ||||
-rw-r--r-- | utils/TableGen/TableGen.cpp | 8 |
3 files changed, 64 insertions, 1 deletions
diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp new file mode 100644 index 0000000..e0ee944 --- /dev/null +++ b/utils/TableGen/AsmMatcherEmitter.cpp @@ -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; +} diff --git a/utils/TableGen/AsmMatcherEmitter.h b/utils/TableGen/AsmMatcherEmitter.h new file mode 100644 index 0000000..729c938 --- /dev/null +++ b/utils/TableGen/AsmMatcherEmitter.h @@ -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 diff --git a/utils/TableGen/TableGen.cpp b/utils/TableGen/TableGen.cpp index 90fba06..376bec1 100644 --- a/utils/TableGen/TableGen.cpp +++ b/utils/TableGen/TableGen.cpp @@ -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; |