X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=gcc%2Fgraph.c;h=d3513fde70b7b3278b0a31014d1074d82dd2a488;hp=04227a4b0586a6263b02efabc06c372551ac5beb;hb=f50b88830e71386da5ee62290eaeb204c551f818;hpb=06f9d6effbf8befe6fc6d6eee368256e79223707 diff --git a/gcc/graph.c b/gcc/graph.c index 04227a4b058..d3513fde70b 100644 --- a/gcc/graph.c +++ b/gcc/graph.c @@ -1,5 +1,5 @@ /* Output routines for graphical representation. - Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2007, 2008 + Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2007, 2008, 2010 Free Software Foundation, Inc. Contributed by Ulrich Drepper , 1998. @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see . */ -#include +#include "config.h" #include "system.h" #include "coretypes.h" #include "tm.h" @@ -30,7 +30,7 @@ along with GCC; see the file COPYING3. If not see #include "hard-reg-set.h" #include "obstack.h" #include "basic-block.h" -#include "toplev.h" +#include "diagnostic-core.h" #include "graph.h" #include "emit-rtl.h" @@ -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; @@ -399,7 +408,7 @@ clean_graph_dump_file (const char *base) fp = fopen (buf, "w"); if (fp == NULL) - fatal_error ("can't open %s: %m", buf); + fatal_error ("can%'t open %s: %m", buf); gcc_assert (graph_dump_format == vcg); fputs ("graph: {\nport_sharing: no\n", fp);