Skip to content

Commit

Permalink
Add an instruction selector emitter skeleton
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7629 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
lattner committed Aug 6, 2003
1 parent 0e5e49e commit 3f78134
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
9 changes: 7 additions & 2 deletions support/tools/TableGen/TableGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
#include "CodeEmitterGen.h"
#include "RegisterInfoEmitter.h"
#include "InstrInfoEmitter.h"
#include "InstrSelectorEmitter.h"
#include <algorithm>
#include <fstream>

enum ActionType {
PrintRecords,
GenEmitter,
GenRegisterEnums, GenRegister, GenRegisterHeader,
GenInstrEnums, GenInstrs,
GenInstrEnums, GenInstrs, GenInstrSelector,
PrintEnums,
Parse,
};
Expand All @@ -44,6 +45,8 @@ namespace {
"Generate enum values for instructions"),
clEnumValN(GenInstrs, "gen-instr-desc",
"Generate instruction descriptions"),
clEnumValN(GenInstrSelector, "gen-instr-selector",
"Generate an instruction selector"),
clEnumValN(PrintEnums, "print-enums",
"Print enum values for a class"),
clEnumValN(Parse, "parse",
Expand Down Expand Up @@ -440,7 +443,9 @@ int main(int argc, char **argv) {
case GenInstrs:
InstrInfoEmitter(Records).run(*Out);
break;

case GenInstrSelector:
InstrSelectorEmitter(Records).run(*Out);
break;
case PrintEnums:
std::vector<Record*> Recs = Records.getAllDerivedDefinitions(Class);
for (unsigned i = 0, e = Recs.size(); i != e; ++i)
Expand Down
9 changes: 7 additions & 2 deletions utils/TableGen/TableGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
#include "CodeEmitterGen.h"
#include "RegisterInfoEmitter.h"
#include "InstrInfoEmitter.h"
#include "InstrSelectorEmitter.h"
#include <algorithm>
#include <fstream>

enum ActionType {
PrintRecords,
GenEmitter,
GenRegisterEnums, GenRegister, GenRegisterHeader,
GenInstrEnums, GenInstrs,
GenInstrEnums, GenInstrs, GenInstrSelector,
PrintEnums,
Parse,
};
Expand All @@ -44,6 +45,8 @@ namespace {
"Generate enum values for instructions"),
clEnumValN(GenInstrs, "gen-instr-desc",
"Generate instruction descriptions"),
clEnumValN(GenInstrSelector, "gen-instr-selector",
"Generate an instruction selector"),
clEnumValN(PrintEnums, "print-enums",
"Print enum values for a class"),
clEnumValN(Parse, "parse",
Expand Down Expand Up @@ -440,7 +443,9 @@ int main(int argc, char **argv) {
case GenInstrs:
InstrInfoEmitter(Records).run(*Out);
break;

case GenInstrSelector:
InstrSelectorEmitter(Records).run(*Out);
break;
case PrintEnums:
std::vector<Record*> Recs = Records.getAllDerivedDefinitions(Class);
for (unsigned i = 0, e = Recs.size(); i != e; ++i)
Expand Down

0 comments on commit 3f78134

Please sign in to comment.