Minor cleanups
authorChris Lattner <sabre@nondot.org>
Fri, 1 Aug 2003 04:15:25 +0000 (04:15 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 1 Aug 2003 04:15:25 +0000 (04:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7462 91177308-0d34-0410-b5e6-96231b3b80d8

support/tools/TableGen/CodeEmitterGen.cpp
utils/TableGen/CodeEmitterGen.cpp

index 75303c4f60d2c4c6a92b8a498c4237b207357440..e24211e24d183aac9ebb1c08b224c67dd619b2d5 100644 (file)
 
 bool CodeEmitterGen::run(std::ostream &o) {
   std::vector<Record*> Insts;
-
-  const std::map<std::string, Record*> &Defs = Records.getDefs();
-
-  Records.getAllDerivedDefinitions("Instruction", Insts);
+  if (Records.getAllDerivedDefinitions("Instruction", Insts)) return true;
 
   std::string Namespace = "V9::";
   std::string ClassName = "SparcV9CodeEmitter::";
@@ -25,8 +22,7 @@ bool CodeEmitterGen::run(std::ostream &o) {
     << "  DEBUG(std::cerr << MI);\n"
     << "  switch (MI.getOpcode()) {\n";
   for (std::vector<Record*>::iterator I = Insts.begin(), E = Insts.end();
-       I != E; ++I)
-  {
+       I != E; ++I) {
     Record *R = *I;
     o << "    case " << Namespace << R->getName() << ": {\n"
       << "      DEBUG(std::cerr << \"Emitting " << R->getName() << "\\n\");\n";
index 75303c4f60d2c4c6a92b8a498c4237b207357440..e24211e24d183aac9ebb1c08b224c67dd619b2d5 100644 (file)
 
 bool CodeEmitterGen::run(std::ostream &o) {
   std::vector<Record*> Insts;
-
-  const std::map<std::string, Record*> &Defs = Records.getDefs();
-
-  Records.getAllDerivedDefinitions("Instruction", Insts);
+  if (Records.getAllDerivedDefinitions("Instruction", Insts)) return true;
 
   std::string Namespace = "V9::";
   std::string ClassName = "SparcV9CodeEmitter::";
@@ -25,8 +22,7 @@ bool CodeEmitterGen::run(std::ostream &o) {
     << "  DEBUG(std::cerr << MI);\n"
     << "  switch (MI.getOpcode()) {\n";
   for (std::vector<Record*>::iterator I = Insts.begin(), E = Insts.end();
-       I != E; ++I)
-  {
+       I != E; ++I) {
     Record *R = *I;
     o << "    case " << Namespace << R->getName() << ": {\n"
       << "      DEBUG(std::cerr << \"Emitting " << R->getName() << "\\n\");\n";