OSDN Git Service

2004-02-17 Andrew Pinski <pinskia@physics.uc.edu>
[pf3gnuchains/gcc-fork.git] / gcc / graph.c
index 45788a7..e663f8e 100644 (file)
@@ -1,5 +1,6 @@
 /* Output routines for graphical representation.
-   Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004
+   Free Software Foundation, Inc.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
 This file is part of GCC.
@@ -55,7 +56,7 @@ start_fct (FILE *fp)
     case vcg:
       fprintf (fp, "\
 graph: { title: \"%s\"\nfolding: 1\nhidden: 2\nnode: { title: \"%s.0\" }\n",
-              current_function_name, current_function_name);
+              current_function_name (), current_function_name ());
       break;
     case no_graph:
       break;
@@ -71,7 +72,7 @@ start_bb (FILE *fp, int bb)
       fprintf (fp, "\
 graph: {\ntitle: \"%s.BB%d\"\nfolding: 1\ncolor: lightblue\n\
 label: \"basic block %d",
-              current_function_name, bb, bb);
+              current_function_name (), bb, bb);
       break;
     case no_graph:
       break;
@@ -113,8 +114,8 @@ node_data (FILE *fp, rtx tmp_rtx)
        case vcg:
          fprintf (fp, "\
 edge: { sourcename: \"%s.0\" targetname: \"%s.%d\" }\n",
-                  current_function_name,
-                  current_function_name, XINT (tmp_rtx, 0));
+                  current_function_name (),
+                  current_function_name (), XINT (tmp_rtx, 0));
          break;
        case no_graph:
          break;
@@ -126,7 +127,7 @@ edge: { sourcename: \"%s.0\" targetname: \"%s.%d\" }\n",
     case vcg:
       fprintf (fp, "node: {\n  title: \"%s.%d\"\n  color: %s\n  \
 label: \"%s %d\n",
-              current_function_name, XINT (tmp_rtx, 0),
+              current_function_name (), XINT (tmp_rtx, 0),
               GET_CODE (tmp_rtx) == NOTE ? "lightgrey"
               : GET_CODE (tmp_rtx) == INSN ? "green"
               : GET_CODE (tmp_rtx) == JUMP_INSN ? "darkgreen"
@@ -178,8 +179,8 @@ draw_edge (FILE *fp, int from, int to, int bb_edge, int class)
        color = "color: green ";
       fprintf (fp,
               "edge: { sourcename: \"%s.%d\" targetname: \"%s.%d\" %s",
-              current_function_name, from,
-              current_function_name, to, color);
+              current_function_name (), from,
+              current_function_name (), to, color);
       if (class)
        fprintf (fp, "class: %d ", class);
       fputs ("}\n", fp);
@@ -209,7 +210,7 @@ end_fct (FILE *fp)
     {
     case vcg:
       fprintf (fp, "node: { title: \"%s.999999\" label: \"END\" }\n}\n",
-              current_function_name);
+              current_function_name ());
       break;
     case no_graph:
       break;
@@ -225,7 +226,7 @@ print_rtl_graph_with_bb (const char *base, const char *suffix, rtx rtx_first)
   size_t namelen = strlen (base);
   size_t suffixlen = strlen (suffix);
   size_t extlen = strlen (graph_ext[graph_dump_format]) + 1;
-  char *buf = (char *) alloca (namelen + suffixlen + extlen);
+  char *buf = alloca (namelen + suffixlen + extlen);
   FILE *fp;
 
   if (basic_block_info == NULL)
@@ -245,10 +246,9 @@ print_rtl_graph_with_bb (const char *base, const char *suffix, rtx rtx_first)
     {
       enum bb_state { NOT_IN_BB, IN_ONE_BB, IN_MULTIPLE_BB };
       int max_uid = get_max_uid ();
-      int *start = (int *) xmalloc (max_uid * sizeof (int));
-      int *end = (int *) xmalloc (max_uid * sizeof (int));
-      enum bb_state *in_bb_p = (enum bb_state *)
-       xmalloc (max_uid * sizeof (enum bb_state));
+      int *start = xmalloc (max_uid * sizeof (int));
+      int *end = xmalloc (max_uid * sizeof (int));
+      enum bb_state *in_bb_p = xmalloc (max_uid * sizeof (enum bb_state));
       basic_block bb;
       int i;
 
@@ -261,14 +261,14 @@ print_rtl_graph_with_bb (const char *base, const char *suffix, rtx rtx_first)
       FOR_EACH_BB_REVERSE (bb)
        {
          rtx x;
-         start[INSN_UID (bb->head)] = bb->index;
-         end[INSN_UID (bb->end)] = bb->index;
-         for (x = bb->head; x != NULL_RTX; x = NEXT_INSN (x))
+         start[INSN_UID (BB_HEAD (bb))] = bb->index;
+         end[INSN_UID (BB_END (bb))] = bb->index;
+         for (x = BB_HEAD (bb); x != NULL_RTX; x = NEXT_INSN (x))
            {
              in_bb_p[INSN_UID (x)]
                = (in_bb_p[INSN_UID (x)] == NOT_IN_BB)
                 ? IN_ONE_BB : IN_MULTIPLE_BB;
-             if (x == bb->end)
+             if (x == BB_END (bb))
                break;
            }
        }
@@ -322,7 +322,7 @@ print_rtl_graph_with_bb (const char *base, const char *suffix, rtx rtx_first)
                {
                  if (e->dest != EXIT_BLOCK_PTR)
                    {
-                     rtx block_head = e->dest->head;
+                     rtx block_head = BB_HEAD (e->dest);
 
                      draw_edge (fp, INSN_UID (tmp_rtx),
                                 INSN_UID (block_head),
@@ -390,7 +390,7 @@ clean_graph_dump_file (const char *base, const char *suffix)
   size_t namelen = strlen (base);
   size_t suffixlen = strlen (suffix);
   size_t extlen = strlen (graph_ext[graph_dump_format]) + 1;
-  char *buf = (char *) alloca (namelen + extlen + suffixlen);
+  char *buf = alloca (namelen + extlen + suffixlen);
   FILE *fp;
 
   memcpy (buf, base, namelen);
@@ -422,7 +422,7 @@ finish_graph_dump_file (const char *base, const char *suffix)
   size_t namelen = strlen (base);
   size_t suffixlen = strlen (suffix);
   size_t extlen = strlen (graph_ext[graph_dump_format]) + 1;
-  char *buf = (char *) alloca (namelen + suffixlen + extlen);
+  char *buf = alloca (namelen + suffixlen + extlen);
   FILE *fp;
 
   memcpy (buf, base, namelen);