[llvm-commits] CVS: llvm/utils/TableGen/CodeEmitterGen.cpp CodeEmitterGen.h TableGen.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Jul 30 23:39:01 PDT 2003
Changes in directory llvm/utils/TableGen:
CodeEmitterGen.cpp updated: 1.14 -> 1.15
CodeEmitterGen.h updated: 1.4 -> 1.5
TableGen.cpp updated: 1.9 -> 1.10
---
Log message:
Rename createEmitter to run because eventually all tablegen backends will
be subclasses of a common interface.
---
Diffs of the changes:
Index: llvm/utils/TableGen/CodeEmitterGen.cpp
diff -u llvm/utils/TableGen/CodeEmitterGen.cpp:1.14 llvm/utils/TableGen/CodeEmitterGen.cpp:1.15
--- llvm/utils/TableGen/CodeEmitterGen.cpp:1.14 Tue Jul 29 18:00:08 2003
+++ llvm/utils/TableGen/CodeEmitterGen.cpp Wed Jul 30 23:38:26 2003
@@ -2,7 +2,7 @@
#include "Record.h"
#include "CodeEmitterGen.h"
-int CodeEmitterGen::createEmitter(std::ostream &o) {
+bool CodeEmitterGen::run(std::ostream &o) {
std::vector<Record*> Insts;
const std::map<std::string, Record*> &Defs = Records.getDefs();
@@ -33,7 +33,7 @@
const RecordVal *InstVal = R->getValue("Inst");
if (!InstVal) {
std::cerr << "No 'Inst' record found in target description file!\n";
- return 1;
+ return true;
}
Init *InitVal = InstVal->getValue();
@@ -229,5 +229,5 @@
<< " }\n"
<< " return Value;\n"
<< "}\n";
- return 0;
+ return false;
}
Index: llvm/utils/TableGen/CodeEmitterGen.h
diff -u llvm/utils/TableGen/CodeEmitterGen.h:1.4 llvm/utils/TableGen/CodeEmitterGen.h:1.5
--- llvm/utils/TableGen/CodeEmitterGen.h:1.4 Wed Jul 30 23:32:37 2003
+++ llvm/utils/TableGen/CodeEmitterGen.h Wed Jul 30 23:38:26 2003
@@ -14,7 +14,8 @@
public:
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:
void emitMachineOpEmitter(std::ostream &o, const std::string &Namespace);
void emitGetValueBit(std::ostream &o, const std::string &Namespace);
Index: llvm/utils/TableGen/TableGen.cpp
diff -u llvm/utils/TableGen/TableGen.cpp:1.9 llvm/utils/TableGen/TableGen.cpp:1.10
--- llvm/utils/TableGen/TableGen.cpp:1.9 Wed Jul 30 14:48:02 2003
+++ llvm/utils/TableGen/TableGen.cpp Wed Jul 30 23:38:26 2003
@@ -402,7 +402,7 @@
switch (Action) {
case Parse: ParseMachineCode(); break;
case GenEmitter:
- ErrorCode = CodeEmitterGen(Records).createEmitter(*Out);
+ ErrorCode = CodeEmitterGen(Records).run(*Out);
break;
case PrintRecords:
*Out << Records; // No argument, dump all contents
More information about the llvm-commits
mailing list