diff options
author | David E. O'Brien <obrien@FreeBSD.org> | 2002-02-06 05:07:01 +0000 |
---|---|---|
committer | David E. O'Brien <obrien@FreeBSD.org> | 2002-02-06 05:07:01 +0000 |
commit | 34edb80c8028bec6791df5d3f6ced6ee39a75312 (patch) | |
tree | 7a3390bb3210efcd5aceed808c79611438d1edc6 /contrib/gcc/cp/ptree.c | |
parent | f4625df2087d9701b0cc810e33f9da4e4647978c (diff) |
Merge BDE's printf format error fixes (rev 1.2) into GCC 3.1-snap.
Notes
Notes:
svn path=/head/; revision=90290
Diffstat (limited to 'contrib/gcc/cp/ptree.c')
-rw-r--r-- | contrib/gcc/cp/ptree.c | 78 |
1 files changed, 49 insertions, 29 deletions
diff --git a/contrib/gcc/cp/ptree.c b/contrib/gcc/cp/ptree.c index 3920c3071505..80ea80a97a05 100644 --- a/contrib/gcc/cp/ptree.c +++ b/contrib/gcc/cp/ptree.c @@ -1,5 +1,6 @@ /* Prints out trees in human readable form. - Copyright (C) 1992, 93-96, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, + 1999 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GNU CC. @@ -28,34 +29,38 @@ Boston, MA 02111-1307, USA. */ #include "cp-tree.h" void -print_lang_decl (file, node, indent) +cxx_print_decl (file, node, indent) FILE *file; tree node; int indent; { - if (!DECL_LANG_SPECIFIC (node)) - return; - /* A FIELD_DECL only has the flags structure, which we aren't displaying - anyways. */ - if (DECL_MUTABLE_P (node)) + if (TREE_CODE (node) == FIELD_DECL) { - indent_to (file, indent + 3); - fprintf (file, " mutable "); + if (DECL_MUTABLE_P (node)) + { + indent_to (file, indent + 3); + fprintf (file, " mutable "); + } + return; } - if (TREE_CODE (node) == FIELD_DECL) + + if (!DECL_LANG_SPECIFIC (node)) return; indent_to (file, indent + 3); - if (DECL_MAIN_VARIANT (node)) - { - fprintf (file, " decl-main-variant "); - fprintf (file, HOST_PTR_PRINTF, (void *) DECL_MAIN_VARIANT (node)); - } - if (DECL_PENDING_INLINE_INFO (node)) + if (TREE_CODE (node) == FUNCTION_DECL + && DECL_PENDING_INLINE_INFO (node)) { fprintf (file, " pending-inline-info "); fprintf (file, HOST_PTR_PRINTF, (void *) DECL_PENDING_INLINE_INFO (node)); } - if (DECL_TEMPLATE_INFO (node)) + if (TREE_CODE (node) == TYPE_DECL + && DECL_SORTED_FIELDS (node)) + { + fprintf (file, " sorted-fields "); + fprintf (file, HOST_PTR_PRINTF, (void *) DECL_SORTED_FIELDS (node)); + } + if ((TREE_CODE (node) == FUNCTION_DECL || TREE_CODE (node) == VAR_DECL) + && DECL_TEMPLATE_INFO (node)) { fprintf (file, " template-info "); fprintf (file, HOST_PTR_PRINTF, (void *) DECL_TEMPLATE_INFO (node)); @@ -63,14 +68,16 @@ print_lang_decl (file, node, indent) } void -print_lang_type (file, node, indent) +cxx_print_type (file, node, indent) FILE *file; register tree node; int indent; { - if (TREE_CODE (node) == TEMPLATE_TYPE_PARM - || TREE_CODE (node) == TEMPLATE_TEMPLATE_PARM) + switch (TREE_CODE (node)) { + case TEMPLATE_TYPE_PARM: + case TEMPLATE_TEMPLATE_PARM: + case BOUND_TEMPLATE_TEMPLATE_PARM: indent_to (file, indent + 3); fputs ("index ", file); fprintf (file, HOST_WIDE_INT_PRINT_DEC, TEMPLATE_TYPE_IDX (node)); @@ -79,20 +86,33 @@ print_lang_type (file, node, indent) fputs (" orig_level ", file); fprintf (file, HOST_WIDE_INT_PRINT_DEC, TEMPLATE_TYPE_ORIG_LEVEL (node)); return; + + case FUNCTION_TYPE: + case METHOD_TYPE: + if (TYPE_RAISES_EXCEPTIONS (node)) + print_node (file, "throws", TYPE_RAISES_EXCEPTIONS (node), indent + 4); + return; + + case RECORD_TYPE: + case UNION_TYPE: + break; + + default: + return; } - if (! (TREE_CODE (node) == RECORD_TYPE - || TREE_CODE (node) == UNION_TYPE)) - return; + if (TYPE_PTRMEMFUNC_P (node)) + print_node (file, "ptrmemfunc fn type", TYPE_PTRMEMFUNC_FN_TYPE (node), + indent + 4); - if (!TYPE_LANG_SPECIFIC (node)) + if (! CLASS_TYPE_P (node)) return; indent_to (file, indent + 3); if (TYPE_NEEDS_CONSTRUCTING (node)) fputs ( "needs-constructor", file); - if (TYPE_NEEDS_DESTRUCTOR (node)) + if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (node)) fputs (" needs-destructor", file); if (TYPE_HAS_DESTRUCTOR (node)) fputs (" ~X()", file); @@ -107,9 +127,9 @@ print_lang_type (file, node, indent) else fputs (" X(X&)", file); } - if (TYPE_GETS_NEW (node) & 1) + if (TYPE_HAS_NEW_OPERATOR (node)) fputs (" new", file); - if (TYPE_GETS_NEW (node) & 2) + if (TYPE_HAS_ARRAY_NEW_OPERATOR (node)) fputs (" new[]", file); if (TYPE_GETS_DELETE (node) & 1) fputs (" delete", file); @@ -140,7 +160,7 @@ print_lang_type (file, node, indent) } void -print_lang_identifier (file, node, indent) +cxx_print_identifier (file, node, indent) FILE *file; tree node; int indent; @@ -155,7 +175,7 @@ print_lang_identifier (file, node, indent) } void -lang_print_xnode (file, node, indent) +cxx_print_xnode (file, node, indent) FILE *file; tree node; int indent; |