[llvm-commits] CVS: llvm/utils/TableGen/CodeEmitterGen.cpp CodeEmitterGen.h

Chris Lattner lattner at cs.uiuc.edu
Thu Jul 31 23:39:06 PDT 2003


Changes in directory llvm/utils/TableGen:

CodeEmitterGen.cpp updated: 1.18 -> 1.19
CodeEmitterGen.h updated: 1.6 -> 1.7

---
Log message:

Simplify code to match new interfaces


---
Diffs of the changes:

Index: llvm/utils/TableGen/CodeEmitterGen.cpp
diff -u llvm/utils/TableGen/CodeEmitterGen.cpp:1.18 llvm/utils/TableGen/CodeEmitterGen.cpp:1.19
--- llvm/utils/TableGen/CodeEmitterGen.cpp:1.18	Thu Jul 31 23:15:25 2003
+++ llvm/utils/TableGen/CodeEmitterGen.cpp	Thu Jul 31 23:38:18 2003
@@ -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 @@
       << "      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 @@
     << "  }\n"
     << "  return Value;\n"
     << "}\n";
-  return false;
 }


Index: llvm/utils/TableGen/CodeEmitterGen.h
diff -u llvm/utils/TableGen/CodeEmitterGen.h:1.6 llvm/utils/TableGen/CodeEmitterGen.h:1.7
--- llvm/utils/TableGen/CodeEmitterGen.h:1.6	Wed Jul 30 23:43:49 2003
+++ llvm/utils/TableGen/CodeEmitterGen.h	Thu Jul 31 23:38:18 2003
@@ -16,8 +16,8 @@
 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);





More information about the llvm-commits mailing list