[llvm-commits] [llvm] r75378 - in /llvm/trunk/utils/TableGen: AsmMatcherEmitter.cpp AsmMatcherEmitter.h TableGen.cpp
Daniel Dunbar
daniel at zuster.org
Sat Jul 11 12:39:44 PDT 2009
Author: ddunbar
Date: Sat Jul 11 14:39:44 2009
New Revision: 75378
URL: http://llvm.org/viewvc/llvm-project?rev=75378&view=rev
Log:
Stub out assembly matcher (.s -> MCInst) tblgen backend.
Added:
llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
llvm/trunk/utils/TableGen/AsmMatcherEmitter.h
Modified:
llvm/trunk/utils/TableGen/TableGen.cpp
Added: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=75378&view=auto
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (added)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Sat Jul 11 14:39:44 2009
@@ -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;
+}
Added: llvm/trunk/utils/TableGen/AsmMatcherEmitter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.h?rev=75378&view=auto
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.h (added)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.h Sat Jul 11 14:39:44 2009
@@ -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
Modified: llvm/trunk/utils/TableGen/TableGen.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/TableGen.cpp?rev=75378&r1=75377&r2=75378&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/TableGen.cpp (original)
+++ llvm/trunk/utils/TableGen/TableGen.cpp Sat Jul 11 14:39:44 2009
@@ -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 @@
PrintRecords,
GenEmitter,
GenRegisterEnums, GenRegister, GenRegisterHeader,
- GenInstrEnums, GenInstrs, GenAsmWriter,
+ GenInstrEnums, GenInstrs, GenAsmWriter, GenAsmMatcher,
GenCallingConv,
GenClangDiagsDefs,
GenClangDiagGroups,
@@ -77,6 +78,8 @@
"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 @@
case GenAsmWriter:
AsmWriterEmitter(Records).run(*Out);
break;
+ case GenAsmMatcher:
+ AsmMatcherEmitter(Records).run(*Out);
+ break;
case GenClangDiagsDefs:
ClangDiagsDefsEmitter(Records, ClangComponent).run(*Out);
break;
More information about the llvm-commits
mailing list