OSDN Git Service

* gdbinit.in: Update to reflect new identifier structure.
[pf3gnuchains/gcc-fork.git] / gcc / print-tree.c
index d9a5e41..bb1230d 100644 (file)
@@ -1,6 +1,6 @@
 /* Prints out tree in human readable form - GNU C-compiler
    Copyright (C) 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002 Free Software Foundation, Inc.
+   2001, 2002, 2003 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -22,7 +22,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include "config.h"
 #include "system.h"
+#include "coretypes.h"
+#include "tm.h"
 #include "tree.h"
+#include "real.h"
 #include "ggc.h"
 #include "langhooks.h"
 
@@ -47,8 +50,7 @@ void
 debug_tree (node)
      tree node;
 {
-  table = (struct bucket **) permalloc (HASH_SIZE * sizeof (struct bucket *));
-  memset ((char *) table, 0, HASH_SIZE * sizeof (struct bucket *));
+  table = (struct bucket **) xcalloc (HASH_SIZE, sizeof (struct bucket *));
   print_node (stderr, "", node, 0);
   table = 0;
   fprintf (stderr, "\n");
@@ -131,9 +133,8 @@ print_node_brief (file, prefix, node, indent)
        fprintf (file, " Nan");
       else
        {
-         char string[100];
-
-         REAL_VALUE_TO_DECIMAL (d, "%e", string);
+         char string[60];
+         real_to_decimal (string, &d, sizeof (string), 0, 1);
          fprintf (file, " %s", string);
        }
     }
@@ -194,7 +195,7 @@ print_node (file, prefix, node, indent)
       return;
     }
 
-  /* It is unsafe to look at any other filds of an ERROR_MARK node.  */
+  /* It is unsafe to look at any other fields of an ERROR_MARK node.  */
   if (TREE_CODE (node) == ERROR_MARK)
     {
       print_node_brief (file, prefix, node, indent);
@@ -212,7 +213,7 @@ print_node (file, prefix, node, indent)
       }
 
   /* Add this node to the table.  */
-  b = (struct bucket *) permalloc (sizeof (struct bucket));
+  b = (struct bucket *) xmalloc (sizeof (struct bucket));
   b->node = node;
   b->next = table[hash];
   table[hash] = b;
@@ -329,12 +330,12 @@ print_node (file, prefix, node, indent)
       if (TREE_CODE (node) == TYPE_DECL && TYPE_DECL_SUPPRESS_DEBUG (node))
        fputs (" suppress-debug", file);
 
-      if (TREE_CODE (node) == FUNCTION_DECL && DECL_INLINE (node))
+      if (TREE_CODE (node) == FUNCTION_DECL && DID_INLINE_FUNC (node))
+       fputs (" autoinline", file);
+      else if (TREE_CODE (node) == FUNCTION_DECL && DECL_INLINE (node))
        fputs (" inline", file);
       if (TREE_CODE (node) == FUNCTION_DECL && DECL_BUILT_IN (node))
        fputs (" built-in", file);
-      if (TREE_CODE (node) == FUNCTION_DECL && DECL_BUILT_IN_NONANSI (node))
-       fputs (" built-in-nonansi", file);
       if (TREE_CODE (node) == FUNCTION_DECL && DECL_NO_STATIC_CHAIN (node))
        fputs (" no-static-chain", file);
 
@@ -508,6 +509,9 @@ print_node (file, prefix, node, indent)
       if (TYPE_PACKED (node))
        fputs (" packed", file);
 
+      if (TYPE_RESTRICT (node))
+       fputs (" restrict", file);
+
       if (TYPE_LANG_FLAG_0 (node))
        fputs (" type_0", file);
       if (TYPE_LANG_FLAG_1 (node))
@@ -681,9 +685,8 @@ print_node (file, prefix, node, indent)
              fprintf (file, " Nan");
            else
              {
-               char string[100];
-
-               REAL_VALUE_TO_DECIMAL (d, "%e", string);
+               char string[64];
+               real_to_decimal (string, &d, sizeof (string), 0, 1);
                fprintf (file, " %s", string);
              }
          }
@@ -711,7 +714,20 @@ print_node (file, prefix, node, indent)
          break;
 
        case STRING_CST:
-         fprintf (file, " \"%s\"", TREE_STRING_POINTER (node));
+         {
+           const char *p = TREE_STRING_POINTER (node);
+           int i = TREE_STRING_LENGTH (node);
+           fputs (" \"", file);
+           while (--i >= 0)
+             {
+               char ch = *p++;
+               if (ch >= ' ' && ch < 127)
+                 putc (ch, file);
+               else
+                 fprintf(file, "\\%03o", ch & 0xFF);
+             }
+           fputc ('\"', file);
+         }
          /* Print the chain at second level.  */
          if (indent == 4)
            print_node (file, "chain", TREE_CHAIN (node), indent + 4);