Skip to content

Commit

Permalink
call dumping code of dump_toc_maker explicitly instead of using the d…
Browse files Browse the repository at this point in the history
…estructor (reason: errors thrown in the destructor may interfere with errors of the same type)

git-svn-id: https://pet.opendfki.de/repos/pet/main@582 4200e16c-5112-0410-ac55-d7fb557a720a
  • Loading branch information
pead01 committed Jul 6, 2009
1 parent b57b0a9 commit 292928e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cheap/cheap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ void dump_jxchg(string &surface, chart *ch) {
dmp.dump_int(0);
dmp.dump_int(0);
dmp.dump_int(0);

toc.dump();
}
catch (tError err) {
LOG(logAppl, WARN, "Can not open file " << yieldname);
Expand Down
3 changes: 2 additions & 1 deletion common/grammar-dump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ dump_toc_maker::start_section(sectiontype s)
_dump -> dump_int(s);
}

dump_toc_maker::~dump_toc_maker()
void
dump_toc_maker::dump()
{
if(_open)
throw tError("TOC still open");
Expand Down
4 changes: 3 additions & 1 deletion common/grammar-dump.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ class dump_toc_maker
public:
/** establish a table of contents for dumper \a dump */
dump_toc_maker(dumper *dump);
~dump_toc_maker();

/** \brief Add the section with type \a s to the table of contents. All
* sections have to be added before dumping of the data starts, because the
Expand All @@ -118,6 +117,9 @@ class dump_toc_maker
* dumper, and write this position to the table of contents.
*/
void start_section(sectiontype s);

/** Dump the toc. To be executed after all sections have been dumped. */
void dump();

private:
dumper *_dump;
Expand Down
2 changes: 2 additions & 0 deletions flop/dump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,4 +285,6 @@ dump_grammar(dumper *f, const char *desc)
dag_dump(f, types[rleaftype_order[i]]->thedag);
logkb(", types", f);

toc.dump();

}

0 comments on commit 292928e

Please sign in to comment.