1 /* Call-backs for C++ error reporting.
2 This code is non-reentrant.
3 Copyright (C) 1993, 94-97, 1998, 1999 Free Software Foundation, Inc.
5 This file is part of GNU CC.
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
29 typedef char* cp_printer ();
31 #define A args_as_string
32 #define C code_as_string
33 #define D decl_as_string
34 #define E expr_as_string
35 #define F fndecl_as_string
36 #define L language_as_string
37 #define O op_as_string
38 #define P parm_as_string
39 #define Q assop_as_string
40 #define T type_as_string
41 #define V cv_as_string
43 #define o (cp_printer *) 0
44 cp_printer
* cp_printers
[256] =
46 /*0 1 2 3 4 5 6 7 8 9 A B C D E F */
47 o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, /* 0x00 */
48 o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, /* 0x10 */
49 o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, /* 0x20 */
50 o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, /* 0x30 */
51 o
, A
, o
, C
, D
, E
, F
, o
, o
, o
, o
, o
, L
, o
, o
, O
, /* 0x40 */
52 P
, Q
, o
, o
, T
, o
, V
, o
, o
, o
, o
, o
, o
, o
, o
, o
, /* 0x50 */
53 o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, /* 0x60 */
54 o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, o
, /* 0x70 */
68 #define obstack_chunk_alloc xmalloc
69 #define obstack_chunk_free free
71 /* Obstack where we build text strings for overloading, etc. */
72 static struct obstack scratch_obstack
;
73 static char *scratch_firstobj
;
75 # define OB_INIT() (scratch_firstobj ? (obstack_free (&scratch_obstack, scratch_firstobj), 0) : 0)
76 # define OB_PUTC(C) (obstack_1grow (&scratch_obstack, (C)))
77 # define OB_PUTC2(C1,C2) \
78 (obstack_1grow (&scratch_obstack, (C1)), obstack_1grow (&scratch_obstack, (C2)))
79 # define OB_PUTS(S) (obstack_grow (&scratch_obstack, (S), sizeof (S) - 1))
80 # define OB_PUTID(ID) \
81 (obstack_grow (&scratch_obstack, IDENTIFIER_POINTER (ID), \
82 IDENTIFIER_LENGTH (ID)))
83 # define OB_PUTCP(S) (obstack_grow (&scratch_obstack, (S), strlen (S)))
84 # define OB_FINISH() (obstack_1grow (&scratch_obstack, '\0'))
85 # define OB_PUTI(CST) do { sprintf (digit_buffer, HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT)(CST)); \
86 OB_PUTCP (digit_buffer); } while (0)
87 # define OB_UNPUT(N) obstack_blank (&scratch_obstack, - (N));
89 # define NEXT_CODE(t) (TREE_CODE (TREE_TYPE (t)))
91 enum pad
{ none
, before
, after
};
93 static void dump_type
PROTO((tree
, int));
94 static void dump_type_real
PROTO((tree
, int, int));
95 static void dump_simple_decl
PROTO((tree
, tree
, int));
96 static void dump_decl
PROTO((tree
, int));
97 static void dump_function_decl
PROTO((tree
, int));
98 static void dump_expr
PROTO((tree
, int));
99 static void dump_unary_op
PROTO((char *, tree
, int));
100 static void dump_binary_op
PROTO((char *, tree
));
101 static void dump_aggr_type
PROTO((tree
, int, int));
102 static void dump_type_prefix
PROTO((tree
, int, int));
103 static void dump_type_suffix
PROTO((tree
, int, int));
104 static void dump_function_name
PROTO((tree
));
105 static void dump_expr_list
PROTO((tree
));
106 static void dump_global_iord
PROTO((tree
));
107 static void dump_qualifiers
PROTO((tree
, enum pad
));
108 static void dump_char
PROTO((int));
109 static void dump_parameters
PROTO((tree
, int, int));
110 static void dump_exception_spec
PROTO((tree
, int));
111 static char *aggr_variety
PROTO((tree
));
112 static tree ident_fndecl
PROTO((tree
));
113 static int interesting_scope_p
PROTO((tree
));
118 gcc_obstack_init (&scratch_obstack
);
119 scratch_firstobj
= (char *)obstack_alloc (&scratch_obstack
, 0);
122 /* Returns nonzero if SCOPE is something we want to print for random decls. */
125 interesting_scope_p (scope
)
128 if (scope
== NULL_TREE
129 || scope
== global_namespace
)
132 return (TREE_CODE (scope
) == NAMESPACE_DECL
133 || AGGREGATE_TYPE_P (scope
));
137 dump_qualifiers (t
, p
)
143 if (p
== before
) OB_PUTC (' ');
144 switch (TYPE_QUALS (t
))
146 case TYPE_QUAL_CONST
:
150 case TYPE_QUAL_VOLATILE
:
151 OB_PUTS ("volatile");
154 case TYPE_QUAL_RESTRICT
:
155 OB_PUTS ("__restrict");
158 case TYPE_QUAL_CONST
| TYPE_QUAL_VOLATILE
:
159 OB_PUTS ("const volatile");
162 case TYPE_QUAL_CONST
| TYPE_QUAL_RESTRICT
:
163 OB_PUTS ("const __restrict");
166 case TYPE_QUAL_VOLATILE
| TYPE_QUAL_RESTRICT
:
167 OB_PUTS ("volatile __restrict");
170 case TYPE_QUAL_CONST
| TYPE_QUAL_VOLATILE
| TYPE_QUAL_RESTRICT
:
171 OB_PUTS ("const volatile __restrict");
175 my_friendly_abort (0);
177 if (p
== after
) OB_PUTC (' ');
181 /* This must be large enough to hold any printed integer or floating-point
183 static char digit_buffer
[128];
185 /* Dump into the obstack a human-readable equivalent of TYPE. */
188 dump_type_real (t
, v
, canonical_name
)
190 int v
; /* verbose? */
196 if (TYPE_PTRMEMFUNC_P (t
))
199 switch (TREE_CODE (t
))
206 OB_PUTS ("{unknown type}");
209 case IDENTIFIER_NODE
:
214 dump_type_real (BINFO_TYPE (t
), v
, canonical_name
);
220 if (TYPE_LANG_SPECIFIC (t
)
221 && (IS_SIGNATURE_POINTER (t
) || IS_SIGNATURE_REFERENCE (t
)))
223 dump_qualifiers (t
, after
);
224 dump_type_real (SIGNATURE_TYPE (t
), v
, canonical_name
);
225 if (IS_SIGNATURE_POINTER (t
))
231 dump_aggr_type (t
, v
, canonical_name
);
241 OB_PUTS ("complex ");
242 dump_type_real (TREE_TYPE (t
), v
, canonical_name
);
246 if (!TREE_UNSIGNED (TYPE_MAIN_VARIANT (t
)) && TREE_UNSIGNED (t
))
247 OB_PUTS ("unsigned ");
248 else if (TREE_UNSIGNED (TYPE_MAIN_VARIANT (t
)) && !TREE_UNSIGNED (t
))
257 dump_qualifiers (t
, after
);
258 type
= canonical_name
? TYPE_MAIN_VARIANT (t
) : t
;
259 if (TYPE_NAME (type
) && TYPE_IDENTIFIER (type
))
260 OB_PUTID (TYPE_IDENTIFIER (type
));
262 /* Types like intQI_type_node and friends have no names.
263 These don't come up in user error messages, but it's nice
264 to be able to print them from the debugger. */
265 OB_PUTS ("{anonymous}");
269 case TEMPLATE_TEMPLATE_PARM
:
270 if (!TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (t
))
272 /* For parameters inside template signature. */
273 if (TYPE_IDENTIFIER (t
))
274 OB_PUTID (TYPE_IDENTIFIER (t
));
276 OB_PUTS ("{anonymous template template parm}");
281 tree args
= TYPE_TI_ARGS (t
);
282 OB_PUTID (TYPE_IDENTIFIER (t
));
284 for (i
= 0; i
< TREE_VEC_LENGTH (args
); i
++)
286 tree arg
= TREE_VEC_ELT (args
, i
);
287 if (TREE_CODE_CLASS (TREE_CODE (arg
)) == 't'
288 || TREE_CODE (arg
) == TEMPLATE_DECL
)
289 dump_type_real (arg
, 0, canonical_name
);
292 if (i
< TREE_VEC_LENGTH (args
)-1)
299 case TEMPLATE_TYPE_PARM
:
300 dump_qualifiers (t
, after
);
301 if (TYPE_IDENTIFIER (t
))
302 OB_PUTID (TYPE_IDENTIFIER (t
));
304 OB_PUTS ("{anonymous template type parm}");
307 /* This is not always necessary for pointers and such, but doing this
308 reduces code size. */
316 dump_type_prefix (t
, v
, canonical_name
);
317 dump_type_suffix (t
, v
, canonical_name
);
321 OB_PUTS ("typename ");
322 dump_type_real (TYPE_CONTEXT (t
), 0, canonical_name
);
324 OB_PUTID (TYPE_IDENTIFIER (t
));
328 OB_PUTS ("__typeof (");
329 dump_expr (TYPE_FIELDS (t
), 1);
334 sorry ("`%s' not supported by dump_type",
335 tree_code_name
[(int) TREE_CODE (t
)]);
343 if (TREE_CODE (t
) == ENUMERAL_TYPE
)
345 else if (TREE_CODE (t
) == UNION_TYPE
)
347 else if (TYPE_LANG_SPECIFIC (t
) && CLASSTYPE_DECLARED_CLASS (t
))
349 else if (TYPE_LANG_SPECIFIC (t
) && IS_SIGNATURE (t
))
358 int v
; /* verbose? */
360 dump_type_real (t
, v
, 0);
363 /* Print out a class declaration, in the form `class foo'. */
366 dump_aggr_type (t
, v
, canonical_name
)
368 int v
; /* verbose? */
372 char *variety
= aggr_variety (t
);
374 dump_qualifiers (t
, after
);
382 name
= TYPE_NAME (canonical_name
? TYPE_MAIN_VARIANT (t
) : t
);
384 if (name
&& CP_DECL_CONTEXT (name
) != global_namespace
)
386 /* FUNCTION_DECL or RECORD_TYPE */
387 dump_decl (DECL_CONTEXT (name
), 0);
391 /* kludge around weird behavior on g++.brendan/line1.C */
392 if (name
&& TREE_CODE (name
) != IDENTIFIER_NODE
)
393 name
= DECL_NAME (name
);
395 if (name
== 0 || ANON_AGGRNAME_P (name
))
397 OB_PUTS ("{anonymous");
409 /* Dump into the obstack the initial part of the output for a given type.
410 This is necessary when dealing with things like functions returning
413 return type of `int (* fee ())()': pointer -> function -> int. Both
414 pointer (and reference and offset) and function (and member) types must
415 deal with prefix and suffix.
417 Arrays must also do this for DECL nodes, like int a[], and for things like
421 dump_type_prefix (t
, v
, canonical_name
)
423 int v
; /* verbosity */
426 if (TYPE_PTRMEMFUNC_P (t
))
428 t
= TYPE_PTRMEMFUNC_FN_TYPE (t
);
432 switch (TREE_CODE (t
))
437 tree sub
= TREE_TYPE (t
);
439 dump_type_prefix (sub
, v
, canonical_name
);
440 /* A tree for a member pointer looks like pointer to offset,
441 so let the OFFSET_TYPE case handle it. */
442 if (!TYPE_PTRMEM_P (t
))
444 switch (TREE_CODE (sub
))
446 /* We don't want int ( *)() */
456 /* We don't want "char * *" */
457 if (TYPE_QUALS (sub
) == TYPE_UNQUALIFIED
)
459 /* But we do want "char *const *" */
464 if (TREE_CODE (t
) == POINTER_TYPE
)
468 dump_qualifiers (t
, none
);
475 dump_type_prefix (TREE_TYPE (t
), v
, canonical_name
);
476 if (TREE_CODE (t
) == OFFSET_TYPE
) /* pmfs deal with this in d_t_p */
479 dump_type_real (TYPE_OFFSET_BASETYPE (t
), 0, canonical_name
);
483 dump_qualifiers (t
, none
);
486 /* Can only be reached through function pointer -- this would not be
487 correct if FUNCTION_DECLs used it. */
489 dump_type_prefix (TREE_TYPE (t
), v
, canonical_name
);
494 dump_type_prefix (TREE_TYPE (t
), v
, canonical_name
);
496 dump_aggr_type (TYPE_METHOD_BASETYPE (t
), 0, canonical_name
);
501 dump_type_prefix (TREE_TYPE (t
), v
, canonical_name
);
506 case IDENTIFIER_NODE
:
511 case TEMPLATE_TYPE_PARM
:
512 case TEMPLATE_TEMPLATE_PARM
:
521 dump_type_real (t
, v
, canonical_name
);
525 sorry ("`%s' not supported by dump_type_prefix",
526 tree_code_name
[(int) TREE_CODE (t
)]);
531 dump_type_suffix (t
, v
, canonical_name
)
533 int v
; /* verbose? */
536 if (TYPE_PTRMEMFUNC_P (t
))
537 t
= TYPE_PTRMEMFUNC_FN_TYPE (t
);
539 switch (TREE_CODE (t
))
544 if (TREE_CODE (TREE_TYPE (t
)) == ARRAY_TYPE
)
546 dump_type_suffix (TREE_TYPE (t
), v
, canonical_name
);
549 /* Can only be reached through function pointer */
555 arg
= TYPE_ARG_TYPES (t
);
556 if (TREE_CODE (t
) == METHOD_TYPE
)
557 arg
= TREE_CHAIN (arg
);
559 /* Function pointers don't have default args. Not in standard C++,
560 anyway; they may in g++, but we'll just pretend otherwise. */
561 dump_parameters (arg
, 0, canonical_name
);
563 if (TREE_CODE (t
) == METHOD_TYPE
)
565 (TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (t
))), before
);
566 dump_type_suffix (TREE_TYPE (t
), v
, canonical_name
);
567 dump_exception_spec (TYPE_RAISES_EXCEPTIONS (t
), canonical_name
);
575 if (TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (t
))) == INTEGER_CST
)
576 OB_PUTI (TREE_INT_CST_LOW (TYPE_MAX_VALUE (TYPE_DOMAIN (t
))) + 1);
577 else if (TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (t
))) == MINUS_EXPR
)
578 dump_expr (TREE_OPERAND (TYPE_MAX_VALUE (TYPE_DOMAIN (t
)), 0), 0);
580 dump_expr (fold (build_binary_op
581 (PLUS_EXPR
, TYPE_MAX_VALUE (TYPE_DOMAIN (t
)),
582 integer_one_node
, 1)), 0);
585 dump_type_suffix (TREE_TYPE (t
), v
, canonical_name
);
590 case IDENTIFIER_NODE
:
595 case TEMPLATE_TYPE_PARM
:
596 case TEMPLATE_TEMPLATE_PARM
:
608 sorry ("`%s' not supported by dump_type_suffix",
609 tree_code_name
[(int) TREE_CODE (t
)]);
613 /* Return a function declaration which corresponds to the IDENTIFIER_NODE
620 tree n
= lookup_name (t
, 0);
625 if (TREE_CODE (n
) == FUNCTION_DECL
)
627 else if (TREE_CODE (n
) == TREE_LIST
628 && TREE_CODE (TREE_VALUE (n
)) == FUNCTION_DECL
)
629 return TREE_VALUE (n
);
631 my_friendly_abort (66);
635 #ifndef NO_DOLLAR_IN_LABEL
636 # define GLOBAL_THING "_GLOBAL_$"
638 # ifndef NO_DOT_IN_LABEL
639 # define GLOBAL_THING "_GLOBAL_."
641 # define GLOBAL_THING "_GLOBAL__"
645 #define GLOBAL_IORD_P(NODE) \
646 ! strncmp (IDENTIFIER_POINTER(NODE), GLOBAL_THING, sizeof (GLOBAL_THING) - 1)
652 char *name
= IDENTIFIER_POINTER (t
);
654 OB_PUTS ("(static ");
655 if (name
[sizeof (GLOBAL_THING
) - 1] == 'I')
656 OB_PUTS ("initializers");
657 else if (name
[sizeof (GLOBAL_THING
) - 1] == 'D')
658 OB_PUTS ("destructors");
660 my_friendly_abort (352);
663 OB_PUTCP (input_filename
);
668 dump_simple_decl (t
, type
, v
)
675 dump_type_prefix (type
, v
, 0);
678 if (interesting_scope_p (DECL_CONTEXT (t
)))
680 dump_decl (DECL_CONTEXT (t
), 0);
684 dump_decl (DECL_NAME (t
), v
);
688 dump_type_suffix (type
, v
, 0);
694 int v
; /* verbosity */
699 switch (TREE_CODE (t
))
702 OB_PUTS (" /* decl error */ ");
707 /* Don't say 'typedef class A' */
708 if (DECL_ARTIFICIAL (t
))
710 if (v
> 0 && TREE_CODE (TREE_TYPE (t
)) == TEMPLATE_TYPE_PARM
)
711 /* Say `class T' not just `T'. */
714 dump_type (TREE_TYPE (t
), v
);
719 OB_PUTS ("typedef ");
720 dump_simple_decl (t
, DECL_ORIGINAL_TYPE (t
)
721 ? DECL_ORIGINAL_TYPE (t
) : TREE_TYPE (t
), v
);
725 if (DECL_NAME (t
) && VTABLE_NAME_P (DECL_NAME (t
)))
727 OB_PUTS ("vtable for ");
728 if (TYPE_P (DECL_CONTEXT (t
)))
729 dump_type (DECL_CONTEXT (t
), v
);
731 /* This case can arise with -fno-vtable-thunks. See
732 expand_upcast_fixups. It's not clear what to print
734 OB_PUTS ("{unknown type}");
737 /* else fall through */
740 dump_simple_decl (t
, TREE_TYPE (t
), v
);
744 if (CP_DECL_CONTEXT (t
) != global_namespace
)
746 dump_decl (DECL_CONTEXT (t
), v
);
749 if (DECL_NAME (t
) == anonymous_namespace_name
)
750 OB_PUTS ("{anonymous}");
752 OB_PUTID (DECL_NAME (t
));
756 dump_decl (TREE_OPERAND (t
, 0), 0);
758 dump_decl (TREE_OPERAND (t
, 1), 0);
762 dump_decl (TREE_OPERAND (t
, 0), v
);
764 dump_decl (TREE_OPERAND (t
, 1), v
);
768 /* So that we can do dump_decl in dump_aggr_type and have it work for
769 both class and function scope. */
777 my_friendly_abort (69);
780 /* These special cases are duplicated here so that other functions
781 can feed identifiers to cp_error and get them demangled properly. */
782 case IDENTIFIER_NODE
:
784 if (DESTRUCTOR_NAME_P (t
)
785 && (f
= ident_fndecl (t
))
786 && DECL_LANGUAGE (f
) == lang_cplusplus
)
789 dump_decl (DECL_NAME (f
), 0);
791 else if (IDENTIFIER_TYPENAME_P (t
))
793 OB_PUTS ("operator ");
794 /* Not exactly IDENTIFIER_TYPE_VALUE. */
795 dump_type (TREE_TYPE (t
), 0);
798 else if (IDENTIFIER_OPNAME_P (t
))
800 char *name_string
= operator_name_string (t
);
801 OB_PUTS ("operator ");
802 OB_PUTCP (name_string
);
814 if (GLOBAL_IORD_P (DECL_ASSEMBLER_NAME (t
)))
815 dump_global_iord (DECL_ASSEMBLER_NAME (t
));
816 else if (! DECL_LANG_SPECIFIC (t
))
817 OB_PUTS ("{internal}");
819 dump_function_decl (t
, v
);
824 tree orig_args
= DECL_TEMPLATE_PARMS (t
);
827 for (args
= orig_args
= nreverse (orig_args
);
829 args
= TREE_CHAIN (args
))
831 int len
= TREE_VEC_LENGTH (TREE_VALUE (args
));
833 OB_PUTS ("template <");
834 for (i
= 0; i
< len
; i
++)
836 tree arg
= TREE_VEC_ELT (TREE_VALUE (args
), i
);
837 tree defval
= TREE_PURPOSE (arg
);
838 arg
= TREE_VALUE (arg
);
839 if (TREE_CODE (arg
) == TYPE_DECL
)
844 OB_PUTID (DECL_NAME (arg
));
855 if (TREE_CODE (arg
) == TYPE_DECL
856 || TREE_CODE (arg
) == TEMPLATE_DECL
)
857 dump_type (defval
, 1);
859 dump_expr (defval
, 1);
870 if (TREE_CODE (DECL_TEMPLATE_RESULT (t
)) == TYPE_DECL
)
871 dump_type (TREE_TYPE (t
), v
);
872 else if (TREE_CODE (DECL_TEMPLATE_RESULT (t
)) == VAR_DECL
)
873 dump_decl (DECL_TEMPLATE_RESULT (t
), v
);
874 else if (TREE_TYPE (t
) == NULL_TREE
)
875 my_friendly_abort (353);
876 else switch (NEXT_CODE (t
))
880 dump_function_decl (t
, v
);
884 /* This case can occur with some illegal code. */
885 dump_type (TREE_TYPE (t
), v
);
890 case TEMPLATE_ID_EXPR
:
893 tree name
= TREE_OPERAND (t
, 0);
894 if (is_overloaded_fn (name
))
895 name
= DECL_NAME (get_first_fn (name
));
898 for (args
= TREE_OPERAND (t
, 1); args
; args
= TREE_CHAIN (args
))
900 if (TREE_CODE_CLASS (TREE_CODE (TREE_VALUE (args
))) == 't'
901 || TREE_CODE (TREE_VALUE (args
)) == TEMPLATE_DECL
)
902 dump_type (TREE_VALUE (args
), 0);
904 dump_expr (TREE_VALUE (args
), 0);
905 if (TREE_CHAIN (args
))
913 dump_decl (TREE_OPERAND (t
, 0), v
);
917 OB_PUTID (DECL_NAME (t
));
921 if ((TREE_TYPE (t
) != NULL_TREE
&& NEXT_CODE (t
) == ENUMERAL_TYPE
)
922 || (DECL_INITIAL (t
) &&
923 TREE_CODE (DECL_INITIAL (t
)) == TEMPLATE_PARM_INDEX
))
924 dump_simple_decl (t
, TREE_TYPE (t
), v
);
925 else if (DECL_NAME (t
))
926 dump_decl (DECL_NAME (t
), v
);
927 else if (DECL_INITIAL (t
))
928 dump_expr (DECL_INITIAL (t
), 0);
930 OB_PUTS ("enumerator");
935 dump_type (DECL_INITIAL (t
), 0);
937 OB_PUTID (DECL_NAME (t
));
941 sorry ("`%s' not supported by dump_decl",
942 tree_code_name
[(int) TREE_CODE (t
)]);
946 /* Pretty print a function decl. There are several ways we want to print a
947 function declaration. We use V to tell us what.
953 As cp_error can only apply the '#' flag once to give 0 and 1 for V, there
954 is %D which doesn't print the throw specs, and %F which does. */
957 dump_function_decl (t
, v
)
964 tree cname
= NULL_TREE
;
966 if (TREE_CODE (t
) == TEMPLATE_DECL
)
967 t
= DECL_TEMPLATE_RESULT (t
);
969 name
= DECL_ASSEMBLER_NAME (t
);
970 fntype
= TREE_TYPE (t
);
971 parmtypes
= TYPE_ARG_TYPES (fntype
);
973 /* Friends have DECL_CLASS_CONTEXT set, but not DECL_CONTEXT. */
974 if (DECL_CLASS_SCOPE_P (t
))
975 cname
= DECL_CLASS_CONTEXT (t
);
976 /* this is for partially instantiated template methods */
977 else if (TREE_CODE (fntype
) == METHOD_TYPE
)
978 cname
= TREE_TYPE (TREE_VALUE (parmtypes
));
980 /* Print the return type. */
983 if (DECL_STATIC_FUNCTION_P (t
))
986 if (! DECL_CONV_FN_P (t
)
987 && ! DECL_CONSTRUCTOR_P (t
)
988 && ! DECL_DESTRUCTOR_P (t
))
990 dump_type_prefix (TREE_TYPE (fntype
), 1, 0);
995 /* Print the function name. */
998 dump_type (cname
, 0);
1000 if (TREE_CODE (fntype
) == METHOD_TYPE
&& parmtypes
)
1001 parmtypes
= TREE_CHAIN (parmtypes
);
1002 if (DECL_CONSTRUCTOR_FOR_VBASE_P (t
))
1003 /* Skip past "in_charge" identifier. */
1004 parmtypes
= TREE_CHAIN (parmtypes
);
1006 else if (CP_DECL_CONTEXT (t
) != global_namespace
)
1008 dump_decl (DECL_CONTEXT (t
), 0);
1012 if (DESTRUCTOR_NAME_P (name
) && DECL_LANGUAGE (t
) == lang_cplusplus
)
1013 parmtypes
= TREE_CHAIN (parmtypes
);
1015 dump_function_name (t
);
1017 /* If V is negative, we don't print the argument types. */
1021 dump_parameters (parmtypes
, v
& 1, 0);
1023 if (v
&& ! DECL_CONV_FN_P (t
))
1024 dump_type_suffix (TREE_TYPE (fntype
), 1, 0);
1026 if (TREE_CODE (fntype
) == METHOD_TYPE
)
1028 if (IS_SIGNATURE (cname
))
1029 /* We look at the type pointed to by the `optr' field of `this.' */
1031 (TREE_TYPE (TREE_TYPE (TYPE_FIELDS (TREE_VALUE (TYPE_ARG_TYPES (fntype
))))), before
);
1034 (TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (fntype
))), before
);
1038 dump_exception_spec (TYPE_RAISES_EXCEPTIONS (fntype
), 0);
1041 /* Print a parameter list. V indicates if we show default values or not. If
1042 these are for a member function, the member object ptr
1043 (and any other hidden args) should have already been removed. */
1046 dump_parameters (parmtypes
, v
, canonical_name
)
1054 for (first
= 1; parmtypes
!= void_list_node
;
1055 parmtypes
= TREE_CHAIN (parmtypes
))
1058 OB_PUTC2 (',', ' ');
1065 dump_type_real (TREE_VALUE (parmtypes
), 0, canonical_name
);
1067 if (TREE_PURPOSE (parmtypes
) && v
)
1070 dump_expr (TREE_PURPOSE (parmtypes
), 0);
1077 /* Print an exception specification. T is the exception specification. */
1080 dump_exception_spec (t
, canonical_name
)
1086 OB_PUTS (" throw (");
1087 if (TREE_VALUE (t
) != NULL_TREE
)
1090 dump_type_real (TREE_VALUE (t
), 0, canonical_name
);
1094 OB_PUTC2 (',', ' ');
1100 /* Handle the function name for a FUNCTION_DECL node, grokking operators
1101 and destructors properly. */
1104 dump_function_name (t
)
1107 tree name
= DECL_NAME (t
);
1109 if (DECL_DESTRUCTOR_P (t
))
1112 dump_decl (name
, 0);
1114 else if (DECL_CONV_FN_P (t
))
1116 /* This cannot use the hack that the operator's return
1117 type is stashed off of its name because it may be
1118 used for error reporting. In the case of conflicting
1119 declarations, both will have the same name, yet
1120 the types will be different, hence the TREE_TYPE field
1121 of the first name will be clobbered by the second. */
1122 OB_PUTS ("operator ");
1123 dump_type (TREE_TYPE (TREE_TYPE (t
)), 0);
1125 else if (IDENTIFIER_OPNAME_P (name
))
1127 char *name_string
= operator_name_string (name
);
1128 OB_PUTS ("operator ");
1129 OB_PUTCP (name_string
);
1132 dump_decl (name
, 0);
1134 if (DECL_LANG_SPECIFIC (t
) && DECL_USE_TEMPLATE (t
)
1135 && DECL_TEMPLATE_INFO (t
)
1136 && (DECL_TEMPLATE_SPECIALIZATION (t
)
1137 || TREE_CODE (DECL_TI_TEMPLATE (t
)) != TEMPLATE_DECL
1138 || DECL_TEMPLATE_SPECIALIZATION (DECL_TI_TEMPLATE (t
))
1139 || PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (t
))))
1141 tree args
= DECL_TEMPLATE_INFO (t
) ? DECL_TI_ARGS (t
) : NULL_TREE
;
1144 /* Be careful only to print things when we have them, so as not
1145 to crash producing error messages. */
1148 if (TREE_CODE (args
) == TREE_LIST
)
1153 for (arg
= args
; arg
; arg
= TREE_CHAIN (arg
))
1155 tree a
= TREE_VALUE (arg
);
1162 if (TREE_CODE_CLASS (TREE_CODE (a
)) == 't'
1163 || TREE_CODE (a
) == TEMPLATE_DECL
)
1172 else if (TREE_CODE (args
) == TREE_VEC
)
1177 if (TREE_VEC_LENGTH (args
) > 0
1178 && TREE_CODE (TREE_VEC_ELT (args
, 0)) == TREE_VEC
)
1179 args
= TREE_VEC_ELT (args
,
1180 TREE_VEC_LENGTH (args
) - 1);
1182 for (i
= 0; i
< TREE_VEC_LENGTH (args
); i
++)
1184 tree a
= TREE_VEC_ELT (args
, i
);
1191 if (TREE_CODE_CLASS (TREE_CODE (a
)) == 't'
1192 || TREE_CODE (a
) == TEMPLATE_DECL
)
1212 case TARGET_NEWLINE
:
1247 sprintf (digit_buffer
, "\\%03o", (int) c
);
1248 OB_PUTCP (digit_buffer
);
1253 /* Print out a list of initializers (subr of dump_expr) */
1261 dump_expr (TREE_VALUE (l
), 0);
1263 OB_PUTC2 (',', ' ');
1268 /* Print out an expression */
1273 int nop
; /* suppress parens */
1275 switch (TREE_CODE (t
))
1283 case NAMESPACE_DECL
:
1289 tree type
= TREE_TYPE (t
);
1290 my_friendly_assert (type
!= 0, 81);
1292 /* If it's an enum, output its tag, rather than its value. */
1293 if (TREE_CODE (type
) == ENUMERAL_TYPE
)
1295 char *p
= enum_name_string (t
, type
);
1298 else if (type
== boolean_type_node
)
1300 if (t
== boolean_false_node
1301 || (TREE_INT_CST_LOW (t
) == 0
1302 && TREE_INT_CST_HIGH (t
) == 0))
1304 else if (t
== boolean_true_node
)
1307 else if (type
== char_type_node
)
1310 dump_char (TREE_INT_CST_LOW (t
));
1313 else if (TREE_INT_CST_HIGH (t
)
1314 != (TREE_INT_CST_LOW (t
) >> (HOST_BITS_PER_WIDE_INT
- 1)))
1317 if (TREE_INT_CST_HIGH (val
) < 0)
1320 val
= build_int_2 (~TREE_INT_CST_LOW (val
),
1321 -TREE_INT_CST_HIGH (val
));
1323 /* Would "%x%0*x" or "%x%*0x" get zero-padding on all
1326 static char format
[10]; /* "%x%09999x\0" */
1328 sprintf (format
, "%%x%%0%dx", HOST_BITS_PER_INT
/ 4);
1329 sprintf (digit_buffer
, format
, TREE_INT_CST_HIGH (val
),
1330 TREE_INT_CST_LOW (val
));
1331 OB_PUTCP (digit_buffer
);
1335 OB_PUTI (TREE_INT_CST_LOW (t
));
1340 #ifndef REAL_IS_NOT_DOUBLE
1341 sprintf (digit_buffer
, "%g", TREE_REAL_CST (t
));
1344 unsigned char *p
= (unsigned char *) &TREE_REAL_CST (t
);
1346 strcpy (digit_buffer
, "0x");
1347 for (i
= 0; i
< sizeof TREE_REAL_CST (t
); i
++)
1348 sprintf (digit_buffer
+ 2 + 2*i
, "%02x", *p
++);
1351 OB_PUTCP (digit_buffer
);
1356 dump_type (PTRMEM_CST_CLASS (t
), 0);
1358 OB_PUTID (DECL_NAME (PTRMEM_CST_MEMBER (t
)));
1363 char *p
= TREE_STRING_POINTER (t
);
1364 int len
= TREE_STRING_LENGTH (t
) - 1;
1368 for (i
= 0; i
< len
; i
++)
1375 dump_binary_op (",", t
);
1380 dump_expr (TREE_OPERAND (t
, 0), 0);
1382 dump_expr (TREE_OPERAND (t
, 1), 0);
1384 dump_expr (TREE_OPERAND (t
, 2), 0);
1389 if (TREE_HAS_CONSTRUCTOR (t
))
1392 dump_type (TREE_TYPE (TREE_TYPE (t
)), 0);
1396 dump_expr (TREE_OPERAND (t
, 0), 0);
1400 case AGGR_INIT_EXPR
:
1401 OB_PUTID (TYPE_IDENTIFIER (TREE_TYPE (t
)));
1403 if (TREE_OPERAND (t
, 1))
1404 dump_expr_list (TREE_CHAIN (TREE_OPERAND (t
, 1)));
1410 tree fn
= TREE_OPERAND (t
, 0);
1411 tree args
= TREE_OPERAND (t
, 1);
1413 if (TREE_CODE (fn
) == ADDR_EXPR
)
1414 fn
= TREE_OPERAND (fn
, 0);
1416 if (TREE_TYPE (fn
) != NULL_TREE
&& NEXT_CODE (fn
) == METHOD_TYPE
)
1418 tree ob
= TREE_VALUE (args
);
1419 if (TREE_CODE (ob
) == ADDR_EXPR
)
1421 dump_expr (TREE_OPERAND (ob
, 0), 0);
1424 else if (TREE_CODE (ob
) != PARM_DECL
1425 || strcmp (IDENTIFIER_POINTER (DECL_NAME (ob
)), "this"))
1428 OB_PUTC2 ('-', '>');
1430 args
= TREE_CHAIN (args
);
1434 dump_expr_list (args
);
1441 tree type
= TREE_OPERAND (t
, 1);
1442 if (NEW_EXPR_USE_GLOBAL (t
))
1445 if (TREE_OPERAND (t
, 0))
1448 dump_expr_list (TREE_OPERAND (t
, 0));
1451 if (TREE_CODE (type
) == ARRAY_REF
)
1452 type
= build_cplus_array_type
1453 (TREE_OPERAND (type
, 0),
1454 build_index_type (size_binop (MINUS_EXPR
, TREE_OPERAND (type
, 1),
1455 integer_one_node
)));
1456 dump_type (type
, 0);
1457 if (TREE_OPERAND (t
, 2))
1460 dump_expr_list (TREE_OPERAND (t
, 2));
1467 /* Note that this only works for G++ target exprs. If somebody
1468 builds a general TARGET_EXPR, there's no way to represent that
1469 it initializes anything other that the parameter slot for the
1470 default argument. Note we may have cleared out the first
1471 operand in expand_expr, so don't go killing ourselves. */
1472 if (TREE_OPERAND (t
, 1))
1473 dump_expr (TREE_OPERAND (t
, 1), 0);
1480 case TRUNC_DIV_EXPR
:
1481 case TRUNC_MOD_EXPR
:
1489 case BIT_ANDTC_EXPR
:
1490 case TRUTH_ANDIF_EXPR
:
1491 case TRUTH_ORIF_EXPR
:
1498 dump_binary_op (opname_tab
[(int) TREE_CODE (t
)], t
);
1502 case FLOOR_DIV_EXPR
:
1503 case ROUND_DIV_EXPR
:
1504 dump_binary_op ("/", t
);
1508 case FLOOR_MOD_EXPR
:
1509 case ROUND_MOD_EXPR
:
1510 dump_binary_op ("%", t
);
1515 tree ob
= TREE_OPERAND (t
, 0);
1516 if (TREE_CODE (ob
) == INDIRECT_REF
)
1518 ob
= TREE_OPERAND (ob
, 0);
1519 if (TREE_CODE (ob
) != PARM_DECL
1520 || strcmp (IDENTIFIER_POINTER (DECL_NAME (ob
)), "this"))
1523 OB_PUTC2 ('-', '>');
1531 dump_expr (TREE_OPERAND (t
, 1), 1);
1536 dump_expr (TREE_OPERAND (t
, 0), 0);
1538 dump_expr (TREE_OPERAND (t
, 1), 0);
1543 dump_unary_op ("+", t
, nop
);
1547 if (TREE_CODE (TREE_OPERAND (t
, 0)) == FUNCTION_DECL
1548 || TREE_CODE (TREE_OPERAND (t
, 0)) == STRING_CST
)
1549 dump_expr (TREE_OPERAND (t
, 0), 0);
1551 dump_unary_op ("&", t
, nop
);
1555 if (TREE_HAS_CONSTRUCTOR (t
))
1557 t
= TREE_OPERAND (t
, 0);
1558 my_friendly_assert (TREE_CODE (t
) == CALL_EXPR
, 237);
1559 dump_expr (TREE_OPERAND (t
, 0), 0);
1561 dump_expr_list (TREE_CHAIN (TREE_OPERAND (t
, 1)));
1566 if (TREE_OPERAND (t
,0) != NULL_TREE
1567 && NEXT_CODE (TREE_OPERAND (t
, 0)) == REFERENCE_TYPE
)
1568 dump_expr (TREE_OPERAND (t
, 0), nop
);
1570 dump_unary_op ("*", t
, nop
);
1576 case TRUTH_NOT_EXPR
:
1577 case PREDECREMENT_EXPR
:
1578 case PREINCREMENT_EXPR
:
1579 dump_unary_op (opname_tab
[(int)TREE_CODE (t
)], t
, nop
);
1582 case POSTDECREMENT_EXPR
:
1583 case POSTINCREMENT_EXPR
:
1585 dump_expr (TREE_OPERAND (t
, 0), 0);
1586 OB_PUTCP (opname_tab
[(int)TREE_CODE (t
)]);
1590 case NON_LVALUE_EXPR
:
1591 /* FIXME: This is a KLUDGE workaround for a parsing problem. There
1592 should be another level of INDIRECT_REF so that I don't have to do
1594 if (TREE_TYPE (t
) != NULL_TREE
&& NEXT_CODE (t
) == POINTER_TYPE
)
1596 tree next
= TREE_TYPE (TREE_TYPE (t
));
1598 while (TREE_CODE (next
) == POINTER_TYPE
)
1599 next
= TREE_TYPE (next
);
1601 if (TREE_CODE (next
) == FUNCTION_TYPE
)
1603 if (!nop
) OB_PUTC ('(');
1605 dump_expr (TREE_OPERAND (t
, 0), 1);
1606 if (!nop
) OB_PUTC (')');
1611 dump_expr (TREE_OPERAND (t
, 0), 0);
1615 dump_expr (TREE_OPERAND (t
, 0), nop
);
1619 if (TREE_TYPE (t
) && TYPE_PTRMEMFUNC_P (TREE_TYPE (t
)))
1621 tree idx
= build_component_ref (t
, index_identifier
, NULL_TREE
, 0);
1623 if (integer_all_onesp (idx
))
1625 tree pfn
= PFN_FROM_PTRMEMFUNC (t
);
1626 dump_unary_op ("&", pfn
, 0);
1629 else if (TREE_CODE (idx
) == INTEGER_CST
1630 && tree_int_cst_equal (idx
, integer_zero_node
))
1632 /* A NULL pointer-to-member constant. */
1634 dump_type (TREE_TYPE (t
), 0);
1638 else if (TREE_CODE (idx
) == INTEGER_CST
1639 && TREE_INT_CST_HIGH (idx
) == 0)
1642 unsigned HOST_WIDE_INT n
;
1644 t
= TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (TREE_TYPE (t
)));
1645 t
= TYPE_METHOD_BASETYPE (t
);
1646 virtuals
= BINFO_VIRTUALS (TYPE_BINFO (TYPE_MAIN_VARIANT (t
)));
1648 n
= TREE_INT_CST_LOW (idx
);
1650 /* Map vtable index back one, to allow for the null pointer to
1654 while (n
> 0 && virtuals
)
1657 virtuals
= TREE_CHAIN (virtuals
);
1661 dump_expr (FNADDR_FROM_VTABLE_ENTRY (TREE_VALUE (virtuals
)), 0);
1667 dump_expr_list (CONSTRUCTOR_ELTS (t
));
1673 tree ob
= TREE_OPERAND (t
, 0);
1674 if (is_dummy_object (ob
))
1676 if (TREE_CODE (TREE_OPERAND (t
, 1)) == FUNCTION_DECL
)
1678 dump_expr (TREE_OPERAND (t
, 1), 0);
1680 dump_decl (TREE_OPERAND (t
, 1), 0);
1684 if (TREE_CODE (ob
) == INDIRECT_REF
)
1686 dump_expr (TREE_OPERAND (ob
, 0), 0);
1694 dump_expr (TREE_OPERAND (t
, 1), 0);
1699 case TEMPLATE_PARM_INDEX
:
1700 dump_decl (TEMPLATE_PARM_DECL (t
), -1);
1703 case IDENTIFIER_NODE
:
1708 dump_type (TREE_OPERAND (t
, 0), 0);
1710 dump_expr (TREE_OPERAND (t
, 1), 0);
1714 if (TREE_OPERAND (t
, 0) == NULL_TREE
1715 || TREE_CHAIN (TREE_OPERAND (t
, 0)))
1717 dump_type (TREE_TYPE (t
), 0);
1719 dump_expr_list (TREE_OPERAND (t
, 0));
1725 dump_type (TREE_TYPE (t
), 0);
1728 dump_expr_list (TREE_OPERAND (t
, 0));
1734 OB_PUTID (TREE_OPERAND (t
, 0));
1738 dump_expr (TREE_OPERAND (t
, 0), nop
);
1744 if (TREE_CODE (t
) == SIZEOF_EXPR
)
1745 OB_PUTS ("sizeof (");
1748 my_friendly_assert (TREE_CODE (t
) == ALIGNOF_EXPR
, 0);
1749 OB_PUTS ("__alignof__ (");
1751 if (TREE_CODE_CLASS (TREE_CODE (TREE_OPERAND (t
, 0))) == 't')
1752 dump_type (TREE_OPERAND (t
, 0), 0);
1754 dump_unary_op ("*", t
, 0);
1759 OB_PUTS ("{unparsed}");
1762 case TRY_CATCH_EXPR
:
1763 case WITH_CLEANUP_EXPR
:
1764 case CLEANUP_POINT_EXPR
:
1765 dump_expr (TREE_OPERAND (t
, 0), nop
);
1769 if (TREE_VALUE (t
) && TREE_CODE (TREE_VALUE (t
)) == FUNCTION_DECL
)
1771 OB_PUTID (DECL_NAME (TREE_VALUE (t
)));
1774 /* else fall through */
1776 /* This list is incomplete, but should suffice for now.
1777 It is very important that `sorry' does not call
1778 `report_error_function'. That could cause an infinite loop. */
1780 sorry ("`%s' not supported by dump_expr",
1781 tree_code_name
[(int) TREE_CODE (t
)]);
1783 /* fall through to ERROR_MARK... */
1785 OB_PUTCP ("{error}");
1791 dump_binary_op (opstring
, t
)
1796 dump_expr (TREE_OPERAND (t
, 0), 1);
1798 OB_PUTCP (opstring
);
1800 dump_expr (TREE_OPERAND (t
, 1), 1);
1805 dump_unary_op (opstring
, t
, nop
)
1810 if (!nop
) OB_PUTC ('(');
1811 OB_PUTCP (opstring
);
1812 dump_expr (TREE_OPERAND (t
, 0), 1);
1813 if (!nop
) OB_PUTC (')');
1816 /* Print a function decl with exception specification included. */
1819 fndecl_as_string (fndecl
, print_default_args_p
)
1821 int print_default_args_p
;
1825 dump_function_decl (fndecl
, 2 + print_default_args_p
);
1829 return (char *)obstack_base (&scratch_obstack
);
1832 /* Same, but handle a _TYPE.
1833 Called from convert_to_reference, mangle_class_name_for_template,
1834 build_unary_op, and GNU_xref_decl. If CANONICAL_NAME is non-zero,
1835 when describing a typedef, we use the name of the type described,
1836 rather than the name of the typedef. */
1839 type_as_string_real (typ
, v
, canonical_name
)
1846 dump_type_real (typ
, v
, canonical_name
);
1850 return (char *)obstack_base (&scratch_obstack
);
1855 type_as_string (typ
, v
)
1859 return type_as_string_real (typ
, v
, 0);
1863 expr_as_string (decl
, v
)
1865 int v ATTRIBUTE_UNUSED
;
1869 dump_expr (decl
, 1);
1873 return (char *)obstack_base (&scratch_obstack
);
1876 /* A cross between type_as_string and fndecl_as_string.
1877 Only called from substitute_nice_name. */
1880 decl_as_string (decl
, v
)
1886 dump_decl (decl
, v
);
1890 return (char *)obstack_base (&scratch_obstack
);
1893 /* Generate the three forms of printable names for lang_printable_name. */
1896 lang_decl_name (decl
, v
)
1901 return decl_as_string (decl
, 1);
1905 if (v
== 1 && DECL_CLASS_SCOPE_P (decl
))
1908 if (TREE_CODE (decl
) == FUNCTION_DECL
)
1909 cname
= DECL_CLASS_CONTEXT (decl
);
1911 cname
= DECL_CONTEXT (decl
);
1912 dump_type (cname
, 0);
1913 OB_PUTC2 (':', ':');
1916 if (TREE_CODE (decl
) == FUNCTION_DECL
)
1917 dump_function_name (decl
);
1919 dump_decl (DECL_NAME (decl
), 0);
1923 return (char *)obstack_base (&scratch_obstack
);
1931 if (TREE_CODE (t
) == PARM_DECL
&& DECL_CONTEXT (t
))
1932 return DECL_SOURCE_FILE (DECL_CONTEXT (t
));
1933 else if (TREE_CODE_CLASS (TREE_CODE (t
)) == 't')
1934 return DECL_SOURCE_FILE (TYPE_MAIN_DECL (t
));
1935 else if (TREE_CODE (t
) == OVERLOAD
)
1936 return DECL_SOURCE_FILE (OVL_FUNCTION (t
));
1938 return DECL_SOURCE_FILE (t
);
1946 if (TREE_CODE (t
) == PARM_DECL
&& DECL_CONTEXT (t
))
1947 line
= DECL_SOURCE_LINE (DECL_CONTEXT (t
));
1948 if (TREE_CODE (t
) == TYPE_DECL
&& DECL_ARTIFICIAL (t
)
1949 && TYPE_MAIN_DECL (TREE_TYPE (t
)))
1952 if (TREE_CODE_CLASS (TREE_CODE (t
)) == 't')
1953 line
= DECL_SOURCE_LINE (TYPE_MAIN_DECL (t
));
1954 else if (TREE_CODE (t
) == OVERLOAD
)
1955 line
= DECL_SOURCE_LINE (OVL_FUNCTION (t
));
1957 line
= DECL_SOURCE_LINE (t
);
1966 code_as_string (c
, v
)
1968 int v ATTRIBUTE_UNUSED
;
1970 return tree_code_name
[c
];
1974 language_as_string (c
, v
)
1976 int v ATTRIBUTE_UNUSED
;
1983 case lang_cplusplus
:
1990 my_friendly_abort (355);
1995 /* Return the proper printed version of a parameter to a C++ function. */
1998 parm_as_string (p
, v
)
2000 int v ATTRIBUTE_UNUSED
;
2005 sprintf (digit_buffer
, "%d", p
+1);
2006 return digit_buffer
;
2012 int v ATTRIBUTE_UNUSED
;
2014 static char buf
[] = "operator ";
2019 strcpy (buf
+ 9, opname_tab
[p
]);
2024 assop_as_string (p
, v
)
2026 int v ATTRIBUTE_UNUSED
;
2028 static char buf
[] = "operator ";
2033 strcpy (buf
+ 9, assignop_tab
[p
]);
2038 args_as_string (p
, v
)
2045 if (TREE_CODE_CLASS (TREE_CODE (TREE_VALUE (p
))) == 't')
2046 return type_as_string (p
, v
);
2049 for (; p
; p
= TREE_CHAIN (p
))
2051 if (TREE_VALUE (p
) == null_node
)
2054 dump_type (error_type (TREE_VALUE (p
)), v
);
2059 return (char *)obstack_base (&scratch_obstack
);
2065 int v ATTRIBUTE_UNUSED
;
2069 dump_qualifiers (p
, before
);
2073 return (char *)obstack_base (&scratch_obstack
);