b230e1f1efc24afffb6ce46fbe59726e14aa083d
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
);
810 if (GLOBAL_IORD_P (DECL_ASSEMBLER_NAME (t
)))
811 dump_global_iord (DECL_ASSEMBLER_NAME (t
));
812 else if (! DECL_LANG_SPECIFIC (t
))
813 OB_PUTS ("{internal}");
815 dump_function_decl (t
, v
);
820 tree orig_args
= DECL_TEMPLATE_PARMS (t
);
823 for (args
= orig_args
= nreverse (orig_args
);
825 args
= TREE_CHAIN (args
))
827 int len
= TREE_VEC_LENGTH (TREE_VALUE (args
));
829 OB_PUTS ("template <");
830 for (i
= 0; i
< len
; i
++)
832 tree arg
= TREE_VEC_ELT (TREE_VALUE (args
), i
);
833 tree defval
= TREE_PURPOSE (arg
);
834 arg
= TREE_VALUE (arg
);
835 if (TREE_CODE (arg
) == TYPE_DECL
)
840 OB_PUTID (DECL_NAME (arg
));
851 if (TREE_CODE (arg
) == TYPE_DECL
852 || TREE_CODE (arg
) == TEMPLATE_DECL
)
853 dump_type (defval
, 1);
855 dump_expr (defval
, 1);
866 if (TREE_CODE (DECL_TEMPLATE_RESULT (t
)) == TYPE_DECL
)
867 dump_type (TREE_TYPE (t
), v
);
868 else if (TREE_CODE (DECL_TEMPLATE_RESULT (t
)) == VAR_DECL
)
869 dump_decl (DECL_TEMPLATE_RESULT (t
), v
);
870 else if (TREE_TYPE (t
) == NULL_TREE
)
871 my_friendly_abort (353);
872 else switch (NEXT_CODE (t
))
876 dump_function_decl (t
, v
);
880 /* This case can occur with some illegal code. */
881 dump_type (TREE_TYPE (t
), v
);
886 case TEMPLATE_ID_EXPR
:
889 tree name
= TREE_OPERAND (t
, 0);
890 if (is_overloaded_fn (name
))
891 name
= DECL_NAME (get_first_fn (name
));
894 for (args
= TREE_OPERAND (t
, 1); args
; args
= TREE_CHAIN (args
))
896 if (TREE_CODE_CLASS (TREE_CODE (TREE_VALUE (args
))) == 't'
897 || TREE_CODE (TREE_VALUE (args
)) == TEMPLATE_DECL
)
898 dump_type (TREE_VALUE (args
), 0);
900 dump_expr (TREE_VALUE (args
), 0);
901 if (TREE_CHAIN (args
))
909 dump_decl (TREE_OPERAND (t
, 0), v
);
913 OB_PUTID (DECL_NAME (t
));
917 if ((TREE_TYPE (t
) != NULL_TREE
&& NEXT_CODE (t
) == ENUMERAL_TYPE
)
918 || (DECL_INITIAL (t
) &&
919 TREE_CODE (DECL_INITIAL (t
)) == TEMPLATE_PARM_INDEX
))
920 dump_simple_decl (t
, TREE_TYPE (t
), v
);
921 else if (DECL_NAME (t
))
922 dump_decl (DECL_NAME (t
), v
);
923 else if (DECL_INITIAL (t
))
924 dump_expr (DECL_INITIAL (t
), 0);
926 OB_PUTS ("enumerator");
931 dump_type (DECL_INITIAL (t
), 0);
933 OB_PUTID (DECL_NAME (t
));
937 sorry ("`%s' not supported by dump_decl",
938 tree_code_name
[(int) TREE_CODE (t
)]);
942 /* Pretty print a function decl. There are several ways we want to print a
943 function declaration. We use V to tell us what.
949 As cp_error can only apply the '#' flag once to give 0 and 1 for V, there
950 is %D which doesn't print the throw specs, and %F which does. */
953 dump_function_decl (t
, v
)
960 tree cname
= NULL_TREE
;
962 if (TREE_CODE (t
) == TEMPLATE_DECL
)
963 t
= DECL_TEMPLATE_RESULT (t
);
965 name
= DECL_ASSEMBLER_NAME (t
);
966 fntype
= TREE_TYPE (t
);
967 parmtypes
= TYPE_ARG_TYPES (fntype
);
969 /* Friends have DECL_CLASS_CONTEXT set, but not DECL_CONTEXT. */
970 if (DECL_CLASS_SCOPE_P (t
))
971 cname
= DECL_CLASS_CONTEXT (t
);
972 /* this is for partially instantiated template methods */
973 else if (TREE_CODE (fntype
) == METHOD_TYPE
)
974 cname
= TREE_TYPE (TREE_VALUE (parmtypes
));
976 /* Print the return type. */
979 if (DECL_STATIC_FUNCTION_P (t
))
982 if (! DECL_CONV_FN_P (t
)
983 && ! DECL_CONSTRUCTOR_P (t
)
984 && ! DECL_DESTRUCTOR_P (t
))
986 dump_type_prefix (TREE_TYPE (fntype
), 1, 0);
991 /* Print the function name. */
994 dump_type (cname
, 0);
996 if (TREE_CODE (fntype
) == METHOD_TYPE
&& parmtypes
)
997 parmtypes
= TREE_CHAIN (parmtypes
);
998 if (DECL_CONSTRUCTOR_FOR_VBASE_P (t
))
999 /* Skip past "in_charge" identifier. */
1000 parmtypes
= TREE_CHAIN (parmtypes
);
1002 else if (CP_DECL_CONTEXT (t
) != global_namespace
)
1004 dump_decl (DECL_CONTEXT (t
), 0);
1008 if (DESTRUCTOR_NAME_P (name
) && DECL_LANGUAGE (t
) == lang_cplusplus
)
1009 parmtypes
= TREE_CHAIN (parmtypes
);
1011 dump_function_name (t
);
1013 /* If V is negative, we don't print the argument types. */
1017 dump_parameters (parmtypes
, v
& 1, 0);
1019 if (v
&& ! DECL_CONV_FN_P (t
))
1020 dump_type_suffix (TREE_TYPE (fntype
), 1, 0);
1022 if (TREE_CODE (fntype
) == METHOD_TYPE
)
1024 if (IS_SIGNATURE (cname
))
1025 /* We look at the type pointed to by the `optr' field of `this.' */
1027 (TREE_TYPE (TREE_TYPE (TYPE_FIELDS (TREE_VALUE (TYPE_ARG_TYPES (fntype
))))), before
);
1030 (TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (fntype
))), before
);
1034 dump_exception_spec (TYPE_RAISES_EXCEPTIONS (fntype
), 0);
1037 /* Print a parameter list. V indicates if we show default values or not. If
1038 these are for a member function, the member object ptr
1039 (and any other hidden args) should have already been removed. */
1042 dump_parameters (parmtypes
, v
, canonical_name
)
1050 for (first
= 1; parmtypes
!= void_list_node
;
1051 parmtypes
= TREE_CHAIN (parmtypes
))
1054 OB_PUTC2 (',', ' ');
1061 dump_type_real (TREE_VALUE (parmtypes
), 0, canonical_name
);
1063 if (TREE_PURPOSE (parmtypes
) && v
)
1066 dump_expr (TREE_PURPOSE (parmtypes
), 0);
1073 /* Print an exception specification. T is the exception specification. */
1076 dump_exception_spec (t
, canonical_name
)
1082 OB_PUTS (" throw (");
1083 if (TREE_VALUE (t
) != NULL_TREE
)
1086 dump_type_real (TREE_VALUE (t
), 0, canonical_name
);
1090 OB_PUTC2 (',', ' ');
1096 /* Handle the function name for a FUNCTION_DECL node, grokking operators
1097 and destructors properly. */
1100 dump_function_name (t
)
1103 tree name
= DECL_NAME (t
);
1105 if (DECL_DESTRUCTOR_P (t
))
1108 dump_decl (name
, 0);
1110 else if (DECL_CONV_FN_P (t
))
1112 /* This cannot use the hack that the operator's return
1113 type is stashed off of its name because it may be
1114 used for error reporting. In the case of conflicting
1115 declarations, both will have the same name, yet
1116 the types will be different, hence the TREE_TYPE field
1117 of the first name will be clobbered by the second. */
1118 OB_PUTS ("operator ");
1119 dump_type (TREE_TYPE (TREE_TYPE (t
)), 0);
1121 else if (IDENTIFIER_OPNAME_P (name
))
1123 char *name_string
= operator_name_string (name
);
1124 OB_PUTS ("operator ");
1125 OB_PUTCP (name_string
);
1128 dump_decl (name
, 0);
1130 if (DECL_LANG_SPECIFIC (t
) && DECL_USE_TEMPLATE (t
)
1131 && DECL_TEMPLATE_INFO (t
)
1132 && (DECL_TEMPLATE_SPECIALIZATION (t
)
1133 || TREE_CODE (DECL_TI_TEMPLATE (t
)) != TEMPLATE_DECL
1134 || DECL_TEMPLATE_SPECIALIZATION (DECL_TI_TEMPLATE (t
))
1135 || PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (t
))))
1137 tree args
= DECL_TEMPLATE_INFO (t
) ? DECL_TI_ARGS (t
) : NULL_TREE
;
1140 /* Be careful only to print things when we have them, so as not
1141 to crash producing error messages. */
1144 if (TREE_CODE (args
) == TREE_LIST
)
1149 for (arg
= args
; arg
; arg
= TREE_CHAIN (arg
))
1151 tree a
= TREE_VALUE (arg
);
1158 if (TREE_CODE_CLASS (TREE_CODE (a
)) == 't'
1159 || TREE_CODE (a
) == TEMPLATE_DECL
)
1168 else if (TREE_CODE (args
) == TREE_VEC
)
1173 if (TREE_VEC_LENGTH (args
) > 0
1174 && TREE_CODE (TREE_VEC_ELT (args
, 0)) == TREE_VEC
)
1175 args
= TREE_VEC_ELT (args
,
1176 TREE_VEC_LENGTH (args
) - 1);
1178 for (i
= 0; i
< TREE_VEC_LENGTH (args
); i
++)
1180 tree a
= TREE_VEC_ELT (args
, i
);
1187 if (TREE_CODE_CLASS (TREE_CODE (a
)) == 't'
1188 || TREE_CODE (a
) == TEMPLATE_DECL
)
1208 case TARGET_NEWLINE
:
1243 sprintf (digit_buffer
, "\\%03o", (int) c
);
1244 OB_PUTCP (digit_buffer
);
1249 /* Print out a list of initializers (subr of dump_expr) */
1257 dump_expr (TREE_VALUE (l
), 0);
1259 OB_PUTC2 (',', ' ');
1264 /* Print out an expression */
1269 int nop
; /* suppress parens */
1271 switch (TREE_CODE (t
))
1279 case NAMESPACE_DECL
:
1285 tree type
= TREE_TYPE (t
);
1286 my_friendly_assert (type
!= 0, 81);
1288 /* If it's an enum, output its tag, rather than its value. */
1289 if (TREE_CODE (type
) == ENUMERAL_TYPE
)
1291 char *p
= enum_name_string (t
, type
);
1294 else if (type
== boolean_type_node
)
1296 if (t
== boolean_false_node
1297 || (TREE_INT_CST_LOW (t
) == 0
1298 && TREE_INT_CST_HIGH (t
) == 0))
1300 else if (t
== boolean_true_node
)
1303 else if (type
== char_type_node
)
1306 dump_char (TREE_INT_CST_LOW (t
));
1309 else if (TREE_INT_CST_HIGH (t
)
1310 != (TREE_INT_CST_LOW (t
) >> (HOST_BITS_PER_WIDE_INT
- 1)))
1313 if (TREE_INT_CST_HIGH (val
) < 0)
1316 val
= build_int_2 (~TREE_INT_CST_LOW (val
),
1317 -TREE_INT_CST_HIGH (val
));
1319 /* Would "%x%0*x" or "%x%*0x" get zero-padding on all
1322 static char format
[10]; /* "%x%09999x\0" */
1324 sprintf (format
, "%%x%%0%dx", HOST_BITS_PER_INT
/ 4);
1325 sprintf (digit_buffer
, format
, TREE_INT_CST_HIGH (val
),
1326 TREE_INT_CST_LOW (val
));
1327 OB_PUTCP (digit_buffer
);
1331 OB_PUTI (TREE_INT_CST_LOW (t
));
1336 #ifndef REAL_IS_NOT_DOUBLE
1337 sprintf (digit_buffer
, "%g", TREE_REAL_CST (t
));
1340 unsigned char *p
= (unsigned char *) &TREE_REAL_CST (t
);
1342 strcpy (digit_buffer
, "0x");
1343 for (i
= 0; i
< sizeof TREE_REAL_CST (t
); i
++)
1344 sprintf (digit_buffer
+ 2 + 2*i
, "%02x", *p
++);
1347 OB_PUTCP (digit_buffer
);
1352 dump_type (PTRMEM_CST_CLASS (t
), 0);
1354 OB_PUTID (DECL_NAME (PTRMEM_CST_MEMBER (t
)));
1359 char *p
= TREE_STRING_POINTER (t
);
1360 int len
= TREE_STRING_LENGTH (t
) - 1;
1364 for (i
= 0; i
< len
; i
++)
1371 dump_binary_op (",", t
);
1376 dump_expr (TREE_OPERAND (t
, 0), 0);
1378 dump_expr (TREE_OPERAND (t
, 1), 0);
1380 dump_expr (TREE_OPERAND (t
, 2), 0);
1385 if (TREE_HAS_CONSTRUCTOR (t
))
1388 dump_type (TREE_TYPE (TREE_TYPE (t
)), 0);
1392 dump_expr (TREE_OPERAND (t
, 0), 0);
1396 case AGGR_INIT_EXPR
:
1397 OB_PUTID (TYPE_IDENTIFIER (TREE_TYPE (t
)));
1399 if (TREE_OPERAND (t
, 1))
1400 dump_expr_list (TREE_CHAIN (TREE_OPERAND (t
, 1)));
1406 tree fn
= TREE_OPERAND (t
, 0);
1407 tree args
= TREE_OPERAND (t
, 1);
1409 if (TREE_CODE (fn
) == ADDR_EXPR
)
1410 fn
= TREE_OPERAND (fn
, 0);
1412 if (TREE_TYPE (fn
) != NULL_TREE
&& NEXT_CODE (fn
) == METHOD_TYPE
)
1414 tree ob
= TREE_VALUE (args
);
1415 if (TREE_CODE (ob
) == ADDR_EXPR
)
1417 dump_expr (TREE_OPERAND (ob
, 0), 0);
1420 else if (TREE_CODE (ob
) != PARM_DECL
1421 || strcmp (IDENTIFIER_POINTER (DECL_NAME (ob
)), "this"))
1424 OB_PUTC2 ('-', '>');
1426 args
= TREE_CHAIN (args
);
1430 dump_expr_list (args
);
1437 tree type
= TREE_OPERAND (t
, 1);
1438 if (NEW_EXPR_USE_GLOBAL (t
))
1441 if (TREE_OPERAND (t
, 0))
1444 dump_expr_list (TREE_OPERAND (t
, 0));
1447 if (TREE_CODE (type
) == ARRAY_REF
)
1448 type
= build_cplus_array_type
1449 (TREE_OPERAND (type
, 0),
1450 build_index_type (size_binop (MINUS_EXPR
, TREE_OPERAND (type
, 1),
1451 integer_one_node
)));
1452 dump_type (type
, 0);
1453 if (TREE_OPERAND (t
, 2))
1456 dump_expr_list (TREE_OPERAND (t
, 2));
1463 /* Note that this only works for G++ target exprs. If somebody
1464 builds a general TARGET_EXPR, there's no way to represent that
1465 it initializes anything other that the parameter slot for the
1466 default argument. Note we may have cleared out the first
1467 operand in expand_expr, so don't go killing ourselves. */
1468 if (TREE_OPERAND (t
, 1))
1469 dump_expr (TREE_OPERAND (t
, 1), 0);
1476 case TRUNC_DIV_EXPR
:
1477 case TRUNC_MOD_EXPR
:
1485 case BIT_ANDTC_EXPR
:
1486 case TRUTH_ANDIF_EXPR
:
1487 case TRUTH_ORIF_EXPR
:
1494 dump_binary_op (opname_tab
[(int) TREE_CODE (t
)], t
);
1498 case FLOOR_DIV_EXPR
:
1499 case ROUND_DIV_EXPR
:
1500 dump_binary_op ("/", t
);
1504 case FLOOR_MOD_EXPR
:
1505 case ROUND_MOD_EXPR
:
1506 dump_binary_op ("%", t
);
1511 tree ob
= TREE_OPERAND (t
, 0);
1512 if (TREE_CODE (ob
) == INDIRECT_REF
)
1514 ob
= TREE_OPERAND (ob
, 0);
1515 if (TREE_CODE (ob
) != PARM_DECL
1516 || strcmp (IDENTIFIER_POINTER (DECL_NAME (ob
)), "this"))
1519 OB_PUTC2 ('-', '>');
1527 dump_expr (TREE_OPERAND (t
, 1), 1);
1532 dump_expr (TREE_OPERAND (t
, 0), 0);
1534 dump_expr (TREE_OPERAND (t
, 1), 0);
1539 dump_unary_op ("+", t
, nop
);
1543 if (TREE_CODE (TREE_OPERAND (t
, 0)) == FUNCTION_DECL
1544 || TREE_CODE (TREE_OPERAND (t
, 0)) == STRING_CST
)
1545 dump_expr (TREE_OPERAND (t
, 0), 0);
1547 dump_unary_op ("&", t
, nop
);
1551 if (TREE_HAS_CONSTRUCTOR (t
))
1553 t
= TREE_OPERAND (t
, 0);
1554 my_friendly_assert (TREE_CODE (t
) == CALL_EXPR
, 237);
1555 dump_expr (TREE_OPERAND (t
, 0), 0);
1557 dump_expr_list (TREE_CHAIN (TREE_OPERAND (t
, 1)));
1562 if (TREE_OPERAND (t
,0) != NULL_TREE
1563 && NEXT_CODE (TREE_OPERAND (t
, 0)) == REFERENCE_TYPE
)
1564 dump_expr (TREE_OPERAND (t
, 0), nop
);
1566 dump_unary_op ("*", t
, nop
);
1572 case TRUTH_NOT_EXPR
:
1573 case PREDECREMENT_EXPR
:
1574 case PREINCREMENT_EXPR
:
1575 dump_unary_op (opname_tab
[(int)TREE_CODE (t
)], t
, nop
);
1578 case POSTDECREMENT_EXPR
:
1579 case POSTINCREMENT_EXPR
:
1581 dump_expr (TREE_OPERAND (t
, 0), 0);
1582 OB_PUTCP (opname_tab
[(int)TREE_CODE (t
)]);
1586 case NON_LVALUE_EXPR
:
1587 /* FIXME: This is a KLUDGE workaround for a parsing problem. There
1588 should be another level of INDIRECT_REF so that I don't have to do
1590 if (TREE_TYPE (t
) != NULL_TREE
&& NEXT_CODE (t
) == POINTER_TYPE
)
1592 tree next
= TREE_TYPE (TREE_TYPE (t
));
1594 while (TREE_CODE (next
) == POINTER_TYPE
)
1595 next
= TREE_TYPE (next
);
1597 if (TREE_CODE (next
) == FUNCTION_TYPE
)
1599 if (!nop
) OB_PUTC ('(');
1601 dump_expr (TREE_OPERAND (t
, 0), 1);
1602 if (!nop
) OB_PUTC (')');
1607 dump_expr (TREE_OPERAND (t
, 0), 0);
1611 dump_expr (TREE_OPERAND (t
, 0), nop
);
1615 if (TREE_TYPE (t
) && TYPE_PTRMEMFUNC_P (TREE_TYPE (t
)))
1617 tree idx
= build_component_ref (t
, index_identifier
, NULL_TREE
, 0);
1619 if (integer_all_onesp (idx
))
1621 tree pfn
= PFN_FROM_PTRMEMFUNC (t
);
1622 dump_unary_op ("&", pfn
, 0);
1625 else if (TREE_CODE (idx
) == INTEGER_CST
1626 && tree_int_cst_equal (idx
, integer_zero_node
))
1628 /* A NULL pointer-to-member constant. */
1630 dump_type (TREE_TYPE (t
), 0);
1634 else if (TREE_CODE (idx
) == INTEGER_CST
1635 && TREE_INT_CST_HIGH (idx
) == 0)
1638 unsigned HOST_WIDE_INT n
;
1640 t
= TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (TREE_TYPE (t
)));
1641 t
= TYPE_METHOD_BASETYPE (t
);
1642 virtuals
= BINFO_VIRTUALS (TYPE_BINFO (TYPE_MAIN_VARIANT (t
)));
1644 n
= TREE_INT_CST_LOW (idx
);
1646 /* Map vtable index back one, to allow for the null pointer to
1650 while (n
> 0 && virtuals
)
1653 virtuals
= TREE_CHAIN (virtuals
);
1657 dump_expr (FNADDR_FROM_VTABLE_ENTRY (TREE_VALUE (virtuals
)), 0);
1663 dump_expr_list (CONSTRUCTOR_ELTS (t
));
1669 tree ob
= TREE_OPERAND (t
, 0);
1670 if (is_dummy_object (ob
))
1672 if (TREE_CODE (TREE_OPERAND (t
, 1)) == FUNCTION_DECL
)
1674 dump_expr (TREE_OPERAND (t
, 1), 0);
1676 dump_decl (TREE_OPERAND (t
, 1), 0);
1680 if (TREE_CODE (ob
) == INDIRECT_REF
)
1682 dump_expr (TREE_OPERAND (ob
, 0), 0);
1690 dump_expr (TREE_OPERAND (t
, 1), 0);
1695 case TEMPLATE_PARM_INDEX
:
1696 dump_decl (TEMPLATE_PARM_DECL (t
), -1);
1699 case IDENTIFIER_NODE
:
1704 dump_type (TREE_OPERAND (t
, 0), 0);
1706 dump_expr (TREE_OPERAND (t
, 1), 0);
1710 if (TREE_OPERAND (t
, 0) == NULL_TREE
1711 || TREE_CHAIN (TREE_OPERAND (t
, 0)))
1713 dump_type (TREE_TYPE (t
), 0);
1715 dump_expr_list (TREE_OPERAND (t
, 0));
1721 dump_type (TREE_TYPE (t
), 0);
1724 dump_expr_list (TREE_OPERAND (t
, 0));
1730 OB_PUTID (TREE_OPERAND (t
, 0));
1734 dump_expr (TREE_OPERAND (t
, 0), nop
);
1740 if (TREE_CODE (t
) == SIZEOF_EXPR
)
1741 OB_PUTS ("sizeof (");
1744 my_friendly_assert (TREE_CODE (t
) == ALIGNOF_EXPR
, 0);
1745 OB_PUTS ("__alignof__ (");
1747 if (TREE_CODE_CLASS (TREE_CODE (TREE_OPERAND (t
, 0))) == 't')
1748 dump_type (TREE_OPERAND (t
, 0), 0);
1750 dump_unary_op ("*", t
, 0);
1755 OB_PUTS ("{unparsed}");
1758 case TRY_CATCH_EXPR
:
1759 case WITH_CLEANUP_EXPR
:
1760 case CLEANUP_POINT_EXPR
:
1761 dump_expr (TREE_OPERAND (t
, 0), nop
);
1765 if (TREE_VALUE (t
) && TREE_CODE (TREE_VALUE (t
)) == FUNCTION_DECL
)
1767 OB_PUTID (DECL_NAME (TREE_VALUE (t
)));
1770 /* else fall through */
1772 /* This list is incomplete, but should suffice for now.
1773 It is very important that `sorry' does not call
1774 `report_error_function'. That could cause an infinite loop. */
1776 sorry ("`%s' not supported by dump_expr",
1777 tree_code_name
[(int) TREE_CODE (t
)]);
1779 /* fall through to ERROR_MARK... */
1781 OB_PUTCP ("{error}");
1787 dump_binary_op (opstring
, t
)
1792 dump_expr (TREE_OPERAND (t
, 0), 1);
1794 OB_PUTCP (opstring
);
1796 dump_expr (TREE_OPERAND (t
, 1), 1);
1801 dump_unary_op (opstring
, t
, nop
)
1806 if (!nop
) OB_PUTC ('(');
1807 OB_PUTCP (opstring
);
1808 dump_expr (TREE_OPERAND (t
, 0), 1);
1809 if (!nop
) OB_PUTC (')');
1812 /* Print a function decl with exception specification included. */
1815 fndecl_as_string (fndecl
, print_default_args_p
)
1817 int print_default_args_p
;
1821 dump_function_decl (fndecl
, 2 + print_default_args_p
);
1825 return (char *)obstack_base (&scratch_obstack
);
1828 /* Same, but handle a _TYPE.
1829 Called from convert_to_reference, mangle_class_name_for_template,
1830 build_unary_op, and GNU_xref_decl. If CANONICAL_NAME is non-zero,
1831 when describing a typedef, we use the name of the type described,
1832 rather than the name of the typedef. */
1835 type_as_string_real (typ
, v
, canonical_name
)
1842 dump_type_real (typ
, v
, canonical_name
);
1846 return (char *)obstack_base (&scratch_obstack
);
1851 type_as_string (typ
, v
)
1855 return type_as_string_real (typ
, v
, 0);
1859 expr_as_string (decl
, v
)
1861 int v ATTRIBUTE_UNUSED
;
1865 dump_expr (decl
, 1);
1869 return (char *)obstack_base (&scratch_obstack
);
1872 /* A cross between type_as_string and fndecl_as_string.
1873 Only called from substitute_nice_name. */
1876 decl_as_string (decl
, v
)
1882 dump_decl (decl
, v
);
1886 return (char *)obstack_base (&scratch_obstack
);
1889 /* Generate the three forms of printable names for lang_printable_name. */
1892 lang_decl_name (decl
, v
)
1897 return decl_as_string (decl
, 1);
1901 if (v
== 1 && DECL_CLASS_SCOPE_P (decl
))
1904 if (TREE_CODE (decl
) == FUNCTION_DECL
)
1905 cname
= DECL_CLASS_CONTEXT (decl
);
1907 cname
= DECL_CONTEXT (decl
);
1908 dump_type (cname
, 0);
1909 OB_PUTC2 (':', ':');
1912 if (TREE_CODE (decl
) == FUNCTION_DECL
)
1913 dump_function_name (decl
);
1915 dump_decl (DECL_NAME (decl
), 0);
1919 return (char *)obstack_base (&scratch_obstack
);
1927 if (TREE_CODE (t
) == PARM_DECL
&& DECL_CONTEXT (t
))
1928 return DECL_SOURCE_FILE (DECL_CONTEXT (t
));
1929 else if (TREE_CODE_CLASS (TREE_CODE (t
)) == 't')
1930 return DECL_SOURCE_FILE (TYPE_MAIN_DECL (t
));
1932 return DECL_SOURCE_FILE (t
);
1940 if (TREE_CODE (t
) == PARM_DECL
&& DECL_CONTEXT (t
))
1941 line
= DECL_SOURCE_LINE (DECL_CONTEXT (t
));
1942 if (TREE_CODE (t
) == TYPE_DECL
&& DECL_ARTIFICIAL (t
)
1943 && TYPE_MAIN_DECL (TREE_TYPE (t
)))
1946 if (TREE_CODE_CLASS (TREE_CODE (t
)) == 't')
1947 line
= DECL_SOURCE_LINE (TYPE_MAIN_DECL (t
));
1949 line
= DECL_SOURCE_LINE (t
);
1958 code_as_string (c
, v
)
1960 int v ATTRIBUTE_UNUSED
;
1962 return tree_code_name
[c
];
1966 language_as_string (c
, v
)
1968 int v ATTRIBUTE_UNUSED
;
1975 case lang_cplusplus
:
1982 my_friendly_abort (355);
1987 /* Return the proper printed version of a parameter to a C++ function. */
1990 parm_as_string (p
, v
)
1992 int v ATTRIBUTE_UNUSED
;
1997 sprintf (digit_buffer
, "%d", p
+1);
1998 return digit_buffer
;
2004 int v ATTRIBUTE_UNUSED
;
2006 static char buf
[] = "operator ";
2011 strcpy (buf
+ 9, opname_tab
[p
]);
2016 assop_as_string (p
, v
)
2018 int v ATTRIBUTE_UNUSED
;
2020 static char buf
[] = "operator ";
2025 strcpy (buf
+ 9, assignop_tab
[p
]);
2030 args_as_string (p
, v
)
2037 if (TREE_CODE_CLASS (TREE_CODE (TREE_VALUE (p
))) == 't')
2038 return type_as_string (p
, v
);
2041 for (; p
; p
= TREE_CHAIN (p
))
2043 if (TREE_VALUE (p
) == null_node
)
2046 dump_type (error_type (TREE_VALUE (p
)), v
);
2051 return (char *)obstack_base (&scratch_obstack
);
2057 int v ATTRIBUTE_UNUSED
;
2061 dump_qualifiers (p
, before
);
2065 return (char *)obstack_base (&scratch_obstack
);