+void vcg_open_name (const char *name) {
+ char *fname; /* filename to put the vcg information in */
+ int len;
+
+ /** open file for vcg graph */
+ len = strlen(name);
+ fname = malloc (len + 5);
+ strcpy (fname, name); /* copy the filename */
+ strcat (fname, ".vcg"); /* append the .vcg suffix */
+ F = fopen (fname, "w"); /* open file for writing */
+ if (!F) {
+ panic ("cannot open %s for writing (%m)", fname); /* not reached */
+ }
+
+ /* print header */
+ xfprintf (F,
+ "graph: { title: \"ir graph of %s\"\n"
+ "display_edge_labels: yes\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);
+
+ xfprintf (F, "\n"); /* a separator */
+}
+