From 048c00db1cd05bbbd616e0eff71756eebd45f6b4 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 1 Aug 2003 04:38:18 +0000 Subject: Simplify code to match new interfaces git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7464 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/TableGen/CodeEmitterGen.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'utils/TableGen/CodeEmitterGen.cpp') 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 Insts; - if (Records.getAllDerivedDefinitions("Instruction", Insts)) return true; +void CodeEmitterGen::run(std::ostream &o) { + std::vector 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(InitVal) && @@ -226,5 +223,4 @@ bool CodeEmitterGen::run(std::ostream &o) { << " }\n" << " return Value;\n" << "}\n"; - return false; } -- cgit v1.2.3