F^C the vcg dump bug.
authorTijs Wiebe Lefering <twlevo@gmail.com>
Thu, 14 Oct 2010 01:48:43 +0000 (01:48 +0000)
committerMingjie Xing <xmj@gcc.gnu.org>
Thu, 14 Oct 2010 01:48:43 +0000 (01:48 +0000)
From-SVN: r165444

gcc/ChangeLog
gcc/graph.c

index 3ad8dfd..ef565ce 100644 (file)
@@ -1,3 +1,9 @@
+2010-10-14  Tijs Wiebe Lefering  <twlevo@gmail.com>
+
+       * 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  <ebotcazou@adacore.com>
 
        PR rtl-optimization/45912
index 081dec8..7c2a570 100644 (file)
@@ -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;