*** emit.c.orig Sat Jan 19 04:44:45 2002 --- emit.c Sat Jan 19 05:20:50 2002 *************** *** 65,70 **** --- 65,72 ---- edge_t *e; int c; char *str; + node_t *nodes[10000]; + int nnodes = 0; emit_header(g); if (flags & EMIT_COLORS) { *************** *** 106,112 **** /* output all nodes, then all edges */ CodeGen->begin_nodes(); for (n = agfstnode(g); n; n = agnxtnode(g,n)) { ! emit_node(n); } CodeGen->end_nodes(); CodeGen->begin_edges(); --- 108,114 ---- /* output all nodes, then all edges */ CodeGen->begin_nodes(); for (n = agfstnode(g); n; n = agnxtnode(g,n)) { ! nodes[nnodes++] = n; } CodeGen->end_nodes(); CodeGen->begin_edges(); *************** *** 120,131 **** else { /* output in breadth first graph walk order */ for (n = agfstnode(g); n; n = agnxtnode(g,n)) { ! emit_node(n); for (e = agfstout(g,n); e; e = agnxtout(g,e)) { ! emit_node(e->head); emit_edge(e); } } } CodeGen->end_page(); } --- 122,139 ---- else { /* output in breadth first graph walk order */ for (n = agfstnode(g); n; n = agnxtnode(g,n)) { ! nodes[nnodes++] = n; for (e = agfstout(g,n); e; e = agnxtout(g,e)) { ! nodes[nnodes++] = n; emit_edge(e); } } + } + { + int i = 0; + for (i = 0; i < nnodes; i++) { + emit_node(nodes[i]); + } } CodeGen->end_page(); }