summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-08-01 04:38:18 +0000
committerChris Lattner <sabre@nondot.org>2003-08-01 04:38:18 +0000
commit048c00db1cd05bbbd616e0eff71756eebd45f6b4 (patch)
treee7ba5ba0a19563d5bef59db9c15784435fe19459
parent5c737ad4d669b835b8fb973a5c477a4dbb213830 (diff)
downloadllvm-048c00db1cd05bbbd616e0eff71756eebd45f6b4.tar.gz
llvm-048c00db1cd05bbbd616e0eff71756eebd45f6b4.tar.bz2
llvm-048c00db1cd05bbbd616e0eff71756eebd45f6b4.tar.xz
Simplify code to match new interfaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7464 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--support/tools/TableGen/CodeEmitterGen.cpp12
-rw-r--r--support/tools/TableGen/CodeEmitterGen.h4
-rw-r--r--utils/TableGen/CodeEmitterGen.cpp12
-rw-r--r--utils/TableGen/CodeEmitterGen.h4
4 files changed, 12 insertions, 20 deletions
diff --git a/support/tools/TableGen/CodeEmitterGen.cpp b/support/tools/TableGen/CodeEmitterGen.cpp
index e24211e24d..0619967f77 100644
--- a/support/tools/TableGen/CodeEmitterGen.cpp
+++ b/support/tools/TableGen/CodeEmitterGen.cpp
@@ -8,9 +8,8 @@
#include "Record.h"
#include "Support/Statistic.h"
-bool CodeEmitterGen::run(std::ostream &o) {
- std::vector<Record*> Insts;
- if (Records.getAllDerivedDefinitions("Instruction", Insts)) return true;
+void CodeEmitterGen::run(std::ostream &o) {
+ std::vector<Record*> Insts = Records.getAllDerivedDefinitions("Instruction");
std::string Namespace = "V9::";
std::string ClassName = "SparcV9CodeEmitter::";
@@ -28,10 +27,8 @@ bool CodeEmitterGen::run(std::ostream &o) {
<< " DEBUG(std::cerr << \"Emitting " << R->getName() << "\\n\");\n";
const RecordVal *InstVal = R->getValue("Inst");
- if (!InstVal) {
- std::cerr << "No 'Inst' record found in target description file!\n";
- return true;
- }
+ if (!InstVal)
+ throw std::string("No 'Inst' record found in target description file!");
Init *InitVal = InstVal->getValue();
assert(dynamic_cast<BitsInit*>(InitVal) &&
@@ -226,5 +223,4 @@ bool CodeEmitterGen::run(std::ostream &o) {
<< " }\n"
<< " return Value;\n"
<< "}\n";
- return false;
}
diff --git a/support/tools/TableGen/CodeEmitterGen.h b/support/tools/TableGen/CodeEmitterGen.h
index 1642034024..7ae3ef8d92 100644
--- a/support/tools/TableGen/CodeEmitterGen.h
+++ b/support/tools/TableGen/CodeEmitterGen.h
@@ -16,8 +16,8 @@ class CodeEmitterGen {
public:
CodeEmitterGen(RecordKeeper &R) : Records(R) {}
- // run - Output the code emitter, returning true on failure.
- bool run(std::ostream &o);
+ // run - Output the code emitter
+ void run(std::ostream &o);
private:
void emitMachineOpEmitter(std::ostream &o, const std::string &Namespace);
void emitGetValueBit(std::ostream &o, const std::string &Namespace);
diff --git a/utils/TableGen/CodeEmitterGen.cpp b/utils/TableGen/CodeEmitterGen.cpp
index e24211e24d..0619967f77 100644
--- a/utils/TableGen/CodeEmitterGen.cpp
+++ b/utils/TableGen/CodeEmitterGen.cpp
@@ -8,9 +8,8 @@
#include "Record.h"
#include "Support/Statistic.h"
-bool CodeEmitterGen::run(std::ostream &o) {
- std::vector<Record*> Insts;
- if (Records.getAllDerivedDefinitions("Instruction", Insts)) return true;
+void CodeEmitterGen::run(std::ostream &o) {
+ std::vector<Record*> Insts = Records.getAllDerivedDefinitions("Instruction");
std::string Namespace = "V9::";
std::string ClassName = "SparcV9CodeEmitter::";
@@ -28,10 +27,8 @@ bool CodeEmitterGen::run(std::ostream &o) {
<< " DEBUG(std::cerr << \"Emitting " << R->getName() << "\\n\");\n";
const RecordVal *InstVal = R->getValue("Inst");
- if (!InstVal) {
- std::cerr << "No 'Inst' record found in target description file!\n";
- return true;
- }
+ if (!InstVal)
+ throw std::string("No 'Inst' record found in target description file!");
Init *InitVal = InstVal->getValue();
assert(dynamic_cast<BitsInit*>(InitVal) &&
@@ -226,5 +223,4 @@ bool CodeEmitterGen::run(std::ostream &o) {
<< " }\n"
<< " return Value;\n"
<< "}\n";
- return false;
}
diff --git a/utils/TableGen/CodeEmitterGen.h b/utils/TableGen/CodeEmitterGen.h
index 1642034024..7ae3ef8d92 100644
--- a/utils/TableGen/CodeEmitterGen.h
+++ b/utils/TableGen/CodeEmitterGen.h
@@ -16,8 +16,8 @@ class CodeEmitterGen {
public:
CodeEmitterGen(RecordKeeper &R) : Records(R) {}
- // run - Output the code emitter, returning true on failure.
- bool run(std::ostream &o);
+ // run - Output the code emitter
+ void run(std::ostream &o);
private:
void emitMachineOpEmitter(std::ostream &o, const std::string &Namespace);
void emitGetValueBit(std::ostream &o, const std::string &Namespace);