diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3ad8dfd16a2..ef565ceae13 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-10-14 Tijs Wiebe Lefering + + * graph.c (inbb): New variable. + (start_bb): Set inbb to 1 if output is inside of a building block. + (end_bb): Check if output is inside of a building block. + 2010-10-13 Eric Botcazou PR rtl-optimization/45912 diff --git a/gcc/graph.c b/gcc/graph.c index 081dec852c5..7c2a5700f69 100644 --- a/gcc/graph.c +++ b/gcc/graph.c @@ -40,6 +40,9 @@ static const char *const graph_ext[] = /* vcg */ ".vcg", }; +/* The flag to indicate if output is inside of a building block. */ +static int inbb = 0; + static void start_fct (FILE *); static void start_bb (FILE *, int); static void node_data (FILE *, rtx); @@ -77,6 +80,7 @@ start_bb (FILE *fp, int bb) graph: {\ntitle: \"%s.BB%d\"\nfolding: 1\ncolor: lightblue\n\ label: \"basic block %d", current_function_name (), bb, bb); + inbb = 1; /* Now We are inside of a building block. */ break; case no_graph: break; @@ -198,7 +202,12 @@ end_bb (FILE *fp) switch (graph_dump_format) { case vcg: - fputs ("}\n", fp); + /* Check if we are inside of a building block. */ + if (inbb != 0) + { + fputs ("}\n", fp); + inbb = 0; /* Now we are outside of a building block. */ + } break; case no_graph: break;