mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-18 11:24:01 +00:00
Rename createEmitter to run because eventually all tablegen backends will
be subclasses of a common interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7445 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
#include "Record.h"
|
#include "Record.h"
|
||||||
#include "CodeEmitterGen.h"
|
#include "CodeEmitterGen.h"
|
||||||
|
|
||||||
int CodeEmitterGen::createEmitter(std::ostream &o) {
|
bool CodeEmitterGen::run(std::ostream &o) {
|
||||||
std::vector<Record*> Insts;
|
std::vector<Record*> Insts;
|
||||||
|
|
||||||
const std::map<std::string, Record*> &Defs = Records.getDefs();
|
const std::map<std::string, Record*> &Defs = Records.getDefs();
|
||||||
@ -33,7 +33,7 @@ int CodeEmitterGen::createEmitter(std::ostream &o) {
|
|||||||
const RecordVal *InstVal = R->getValue("Inst");
|
const RecordVal *InstVal = R->getValue("Inst");
|
||||||
if (!InstVal) {
|
if (!InstVal) {
|
||||||
std::cerr << "No 'Inst' record found in target description file!\n";
|
std::cerr << "No 'Inst' record found in target description file!\n";
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Init *InitVal = InstVal->getValue();
|
Init *InitVal = InstVal->getValue();
|
||||||
@ -229,5 +229,5 @@ int CodeEmitterGen::createEmitter(std::ostream &o) {
|
|||||||
<< " }\n"
|
<< " }\n"
|
||||||
<< " return Value;\n"
|
<< " return Value;\n"
|
||||||
<< "}\n";
|
<< "}\n";
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,8 @@ class CodeEmitterGen {
|
|||||||
public:
|
public:
|
||||||
CodeEmitterGen(RecordKeeper &R) : Records(R) {}
|
CodeEmitterGen(RecordKeeper &R) : Records(R) {}
|
||||||
|
|
||||||
int createEmitter(std::ostream &o);
|
// run - Output the code emitter, returning true on failure.
|
||||||
|
bool run(std::ostream &o);
|
||||||
private:
|
private:
|
||||||
void emitMachineOpEmitter(std::ostream &o, const std::string &Namespace);
|
void emitMachineOpEmitter(std::ostream &o, const std::string &Namespace);
|
||||||
void emitGetValueBit(std::ostream &o, const std::string &Namespace);
|
void emitGetValueBit(std::ostream &o, const std::string &Namespace);
|
||||||
|
@ -402,7 +402,7 @@ int main(int argc, char **argv) {
|
|||||||
switch (Action) {
|
switch (Action) {
|
||||||
case Parse: ParseMachineCode(); break;
|
case Parse: ParseMachineCode(); break;
|
||||||
case GenEmitter:
|
case GenEmitter:
|
||||||
ErrorCode = CodeEmitterGen(Records).createEmitter(*Out);
|
ErrorCode = CodeEmitterGen(Records).run(*Out);
|
||||||
break;
|
break;
|
||||||
case PrintRecords:
|
case PrintRecords:
|
||||||
*Out << Records; // No argument, dump all contents
|
*Out << Records; // No argument, dump all contents
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include "Record.h"
|
#include "Record.h"
|
||||||
#include "CodeEmitterGen.h"
|
#include "CodeEmitterGen.h"
|
||||||
|
|
||||||
int CodeEmitterGen::createEmitter(std::ostream &o) {
|
bool CodeEmitterGen::run(std::ostream &o) {
|
||||||
std::vector<Record*> Insts;
|
std::vector<Record*> Insts;
|
||||||
|
|
||||||
const std::map<std::string, Record*> &Defs = Records.getDefs();
|
const std::map<std::string, Record*> &Defs = Records.getDefs();
|
||||||
@ -33,7 +33,7 @@ int CodeEmitterGen::createEmitter(std::ostream &o) {
|
|||||||
const RecordVal *InstVal = R->getValue("Inst");
|
const RecordVal *InstVal = R->getValue("Inst");
|
||||||
if (!InstVal) {
|
if (!InstVal) {
|
||||||
std::cerr << "No 'Inst' record found in target description file!\n";
|
std::cerr << "No 'Inst' record found in target description file!\n";
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Init *InitVal = InstVal->getValue();
|
Init *InitVal = InstVal->getValue();
|
||||||
@ -229,5 +229,5 @@ int CodeEmitterGen::createEmitter(std::ostream &o) {
|
|||||||
<< " }\n"
|
<< " }\n"
|
||||||
<< " return Value;\n"
|
<< " return Value;\n"
|
||||||
<< "}\n";
|
<< "}\n";
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,8 @@ class CodeEmitterGen {
|
|||||||
public:
|
public:
|
||||||
CodeEmitterGen(RecordKeeper &R) : Records(R) {}
|
CodeEmitterGen(RecordKeeper &R) : Records(R) {}
|
||||||
|
|
||||||
int createEmitter(std::ostream &o);
|
// run - Output the code emitter, returning true on failure.
|
||||||
|
bool run(std::ostream &o);
|
||||||
private:
|
private:
|
||||||
void emitMachineOpEmitter(std::ostream &o, const std::string &Namespace);
|
void emitMachineOpEmitter(std::ostream &o, const std::string &Namespace);
|
||||||
void emitGetValueBit(std::ostream &o, const std::string &Namespace);
|
void emitGetValueBit(std::ostream &o, const std::string &Namespace);
|
||||||
|
@ -402,7 +402,7 @@ int main(int argc, char **argv) {
|
|||||||
switch (Action) {
|
switch (Action) {
|
||||||
case Parse: ParseMachineCode(); break;
|
case Parse: ParseMachineCode(); break;
|
||||||
case GenEmitter:
|
case GenEmitter:
|
||||||
ErrorCode = CodeEmitterGen(Records).createEmitter(*Out);
|
ErrorCode = CodeEmitterGen(Records).run(*Out);
|
||||||
break;
|
break;
|
||||||
case PrintRecords:
|
case PrintRecords:
|
||||||
*Out << Records; // No argument, dump all contents
|
*Out << Records; // No argument, dump all contents
|
||||||
|
Reference in New Issue
Block a user