irdump: Funcion to turn off labels for cvs edges
authorGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Mon, 12 Mar 2001 16:02:47 +0000 (16:02 +0000)
committerGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Mon, 12 Mar 2001 16:02:47 +0000 (16:02 +0000)
[r126]

ir/ir/irdump.c
ir/ir/irdump.h

index 45f4d03..b1200da 100644 (file)
@@ -54,6 +54,7 @@
 /* file to dump to */
 static FILE *F;
 
+int edge_label = 1;
 
 /*******************************************************************/
 /* routines to dump information about a single node                */
@@ -574,6 +575,7 @@ void vcg_open (ir_graph *irg, char *suffix) {
   const char *cp;
   ident *id;
   int len;
+  char label[4];
 
   /** open file for vcg graph */
   id    = get_entity_ld_name (get_irg_ent(irg));
@@ -598,16 +600,22 @@ void vcg_open (ir_graph *irg, char *suffix) {
     panic ("cannot open %s for writing (%m)", fname);  /* not reached */
   }
 
+  if (edge_label) {
+    strcpy(label, "yes");
+  } else {
+    strcpy (label, "no");
+  }
+
   /* print header */
   xfprintf (F,
            "graph: { title: \"ir graph of %s\"\n"
-           "display_edge_labels: yes\n"
+           "display_edge_labels: %s\n"
            "layoutalgorithm: mindepth\n"
            "manhattan_edges: yes\n"
            "port_sharing: no\n"
            "orientation: bottom_to_top\n"
            "classname 1: \"Data\"\n"
-           "classname 2: \"Block\"\n", cp);
+           "classname 2: \"Block\"\n", cp, label);
 
   xfprintf (F, "\n");          /* a separator */
 }
@@ -615,6 +623,7 @@ void vcg_open (ir_graph *irg, char *suffix) {
 void vcg_open_name (const char *name) {
   char *fname;  /* filename to put the vcg information in */
   int len;
+  char label[4];
 
   /** open file for vcg graph */
   len   = strlen(name);
@@ -626,16 +635,22 @@ void vcg_open_name (const char *name) {
     panic ("cannot open %s for writing (%m)", fname);  /* not reached */
   }
 
+  if (edge_label) {
+    strcpy(label, "yes");
+  } else {
+    strcpy (label, "no");
+  }
+
   /* print header */
   xfprintf (F,
            "graph: { title: \"ir graph of %s\"\n"
-           "display_edge_labels: yes\n"
+           "display_edge_labels: %s\n"
            "layoutalgorithm: mindepth\n"
            "manhattan_edges: yes\n"
            "port_sharing: no\n"
            "orientation: bottom_to_top\n"
            "classname 1: \"Data\"\n"
-           "classname 2: \"Block\"\n", name);
+           "classname 2: \"Block\"\n", name, label);
 
   xfprintf (F, "\n");          /* a separator */
 }
@@ -840,3 +855,10 @@ void dump_all_ir_graphs (void dump_graph(ir_graph*)) {
     dump_graph(get_irp_irg(i));
   }
 }
+
+
+/* To turn off display of edge labels.  Edge labels offen cause xvcg to
+   abort with a segmentation fault. */
+void turn_of_edge_labels() {
+  edge_label = 0;
+}
index f0dcb3b..15c7406 100644 (file)
@@ -45,4 +45,9 @@ void dump_ir_graph_w_types (ir_graph *irg);
  * dump_ir_graph_w_types                                            */
 void dump_all_ir_graphs (void dump_graph(ir_graph*));
 
+/* To turn off display of edge labels.  Edge labels offen cause xvcg to
+   abort with a segmentation fault. */
+void turn_of_edge_labels();
+
+
 # endif /* _IRDUMP_H_ */