Don't generate any output if there were errors

This commit is contained in:
Nick Gasson 2008-06-04 21:03:36 +01:00
parent f49dd97d24
commit 234f73e7bf
1 changed files with 12 additions and 9 deletions

View File

@ -85,16 +85,19 @@ extern "C" int target_design(ivl_design_t des)
ivl_design_process(des, draw_process, NULL); ivl_design_process(des, draw_process, NULL);
// Write the generated elements to the output file // Write the generated elements to the output file
const char *ofname = ivl_design_flag(des, "-o"); // only if there are no errors
std::ofstream outfile(ofname); if (0 == g_errors) {
const char *ofname = ivl_design_flag(des, "-o");
for (entity_list_t::iterator it = g_entities.begin(); std::ofstream outfile(ofname);
it != g_entities.end();
++it) for (entity_list_t::iterator it = g_entities.begin();
(*it)->emit(outfile); it != g_entities.end();
++it)
(*it)->emit(outfile);
outfile.close();
}
outfile.close();
// Clean up // Clean up
for (entity_list_t::iterator it = g_entities.begin(); for (entity_list_t::iterator it = g_entities.begin();
it != g_entities.end(); it != g_entities.end();