aboutsummaryrefslogtreecommitdiff
path: root/contrib/gcc/cp/ptree.c
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>1999-09-19 11:00:01 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>1999-09-19 11:00:01 +0000
commitb6f18be1494b4331a3c90be60fd953a025625453 (patch)
tree89687b6282b50b560acc1f47ee1240edd954ec48 /contrib/gcc/cp/ptree.c
parent989e177ec24a60cd6b97d2847c2fbe160610abdf (diff)
Bring BDE's printf format error fixes into EGCS.
Notes
Notes: svn path=/head/; revision=51412
Diffstat (limited to 'contrib/gcc/cp/ptree.c')
-rw-r--r--contrib/gcc/cp/ptree.c63
1 files changed, 44 insertions, 19 deletions
diff --git a/contrib/gcc/cp/ptree.c b/contrib/gcc/cp/ptree.c
index 45244225aadc..6cbd08a9d2bc 100644
--- a/contrib/gcc/cp/ptree.c
+++ b/contrib/gcc/cp/ptree.c
@@ -19,10 +19,12 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* $FreeBSD$ */
+
#include "config.h"
+#include "system.h"
#include "tree.h"
-#include <stdio.h>
#include "cp-tree.h"
void
@@ -66,16 +68,16 @@ print_lang_type (file, node, indent)
register tree node;
int indent;
{
- if (TREE_CODE (node) == TEMPLATE_TYPE_PARM)
- {
- print_node (file, "tinfo", TYPE_VALUES (node), indent + 4);
- return;
- }
-
- if (TREE_CODE (node) == UNINSTANTIATED_P_TYPE)
+ if (TREE_CODE (node) == TEMPLATE_TYPE_PARM
+ || TREE_CODE (node) == TEMPLATE_TEMPLATE_PARM)
{
- print_node (file, "template", UPT_TEMPLATE (node), indent + 4);
- print_node (file, "parameters", UPT_PARMS (node), indent + 4);
+ indent_to (file, indent + 3);
+ fputs ("index ", file);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, TEMPLATE_TYPE_IDX (node));
+ fputs (" level ", file);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, TEMPLATE_TYPE_LEVEL (node));
+ fputs (" orig_level ", file);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, TEMPLATE_TYPE_ORIG_LEVEL (node));
return;
}
@@ -98,10 +100,6 @@ print_lang_type (file, node, indent)
fputs (" X()", file);
if (TYPE_HAS_CONVERSION (node))
fputs (" has-type-conversion", file);
- if (TYPE_HAS_INT_CONVERSION (node))
- fputs (" has-int-conversion", file);
- if (TYPE_HAS_REAL_CONVERSION (node))
- fputs (" has-float-conversion", file);
if (TYPE_HAS_INIT_REF (node))
{
if (TYPE_HAS_CONST_INIT_REF (node))
@@ -121,10 +119,6 @@ print_lang_type (file, node, indent)
fputs (" has=", file);
if (TYPE_HAS_ASSIGN_REF (node))
fputs (" this=(X&)", file);
- if (TYPE_OVERLOADS_METHOD_CALL_EXPR (node))
- fputs (" op->()", file);
- if (TYPE_GETS_INIT_AGGR (node))
- fputs (" gets X(X, ...)", file);
if (TYPE_OVERLOADS_CALL_EXPR (node))
fputs (" op()", file);
if (TYPE_OVERLOADS_ARRAY_REF (node))
@@ -158,7 +152,7 @@ print_lang_identifier (file, node, indent)
tree node;
int indent;
{
- print_node (file, "global", IDENTIFIER_GLOBAL_VALUE (node), indent + 4);
+ print_node (file, "bindings", IDENTIFIER_NAMESPACE_BINDINGS (node), indent + 4);
print_node (file, "class", IDENTIFIER_CLASS_VALUE (node), indent + 4);
print_node (file, "local", IDENTIFIER_LOCAL_VALUE (node), indent + 4);
print_node (file, "label", IDENTIFIER_LABEL_VALUE (node), indent + 4);
@@ -166,3 +160,34 @@ print_lang_identifier (file, node, indent)
print_node (file, "implicit", IDENTIFIER_IMPLICIT_DECL (node), indent + 4);
print_node (file, "error locus", IDENTIFIER_ERROR_LOCUS (node), indent + 4);
}
+
+void
+lang_print_xnode (file, node, indent)
+ FILE *file;
+ tree node;
+ int indent;
+{
+ switch (TREE_CODE (node))
+ {
+ case CPLUS_BINDING:
+ print_node (file, "scope", BINDING_SCOPE (node), indent+4);
+ print_node (file, "value", BINDING_VALUE (node), indent+4);
+ print_node (file, "chain", TREE_CHAIN (node), indent+4);
+ break;
+ case OVERLOAD:
+ print_node (file, "function", OVL_FUNCTION (node), indent+4);
+ print_node (file, "chain", TREE_CHAIN (node), indent+4);
+ break;
+ case TEMPLATE_PARM_INDEX:
+ indent_to (file, indent + 3);
+ fputs ("index ", file);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, TEMPLATE_PARM_IDX (node));
+ fputs (" level ", file);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, TEMPLATE_PARM_LEVEL (node));
+ fputs (" orig_level ", file);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, TEMPLATE_PARM_ORIG_LEVEL (node));
+ break;
+ default:
+ break;
+ }
+}