mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 17:32:19 +00:00
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:
parent
4429aaf12f
commit
d51ffcf303
24
utils/TableGen/AsmMatcherEmitter.cpp
Normal file
24
utils/TableGen/AsmMatcherEmitter.cpp
Normal 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;
|
||||
}
|
33
utils/TableGen/AsmMatcherEmitter.h
Normal file
33
utils/TableGen/AsmMatcherEmitter.h
Normal 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
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user