1 /* Tree-dumping functionality for intermediate representation.
2 Copyright (C) 1999, 2000 Free Software Foundation, Inc.
3 Written by Mark Mitchell <mark@codesourcery.com>
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. */
35 /* Figure out what kind of node this is. */
40 if (DECL_LANG_SPECIFIC (t) && DECL_LANGUAGE (t) != lang_cplusplus)
41 dump_string (di, language_to_string (DECL_LANGUAGE (t), 0));
47 if (IDENTIFIER_OPNAME_P (t))
49 dump_string (di, "operator");
52 else if (IDENTIFIER_TYPENAME_P (t))
54 dump_child ("tynm", TREE_TYPE (t));
57 else if (t == anonymous_namespace_name)
59 dump_string (di, "unnamed");
65 if (TYPE_PTRMEM_P (t))
67 dump_string (di, "ptrmem");
68 dump_child ("ptd", TYPE_PTRMEM_POINTED_TO_TYPE (t));
69 dump_child ("cls", TYPE_PTRMEM_CLASS_TYPE (t));
76 if (TYPE_PTRMEMFUNC_P (t))
78 dump_string (di, "ptrmem");
79 dump_child ("ptd", TYPE_PTRMEM_POINTED_TO_TYPE (t));
80 dump_child ("cls", TYPE_PTRMEM_CLASS_TYPE (t));
84 dump_child ("vfld", TYPE_VFIELD (t));
88 if (!DECL_THUNK_P (t))
90 if (DECL_FUNCTION_MEMBER_P (t))
91 dump_string (di, "member");
92 if (DECL_CONSTRUCTOR_P (t))
93 dump_string (di, "constructor");
94 if (DECL_DESTRUCTOR_P (t))
95 dump_string (di, "destructor");
96 if (DECL_OVERLOADED_OPERATOR_P (t))
97 dump_string (di, "operator");
98 if (DECL_CONV_FN_P (t))
99 dump_string (di, "conversion");
100 if (DECL_GLOBAL_CTOR_P (t) || DECL_GLOBAL_DTOR_P (t))
102 if (DECL_GLOBAL_CTOR_P (t))
103 dump_string (di, "global init");
104 if (DECL_GLOBAL_DTOR_P (t))
105 dump_string (di, "global fini");
106 dump_int (di, "prio", GLOBAL_INIT_PRIORITY (t));
108 if (DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (t))
109 dump_string (di, "pseudo tmpl");
113 dump_string (di, "thunk");
114 dump_int (di, "dlta", THUNK_DELTA (t));
115 dump_child ("vcll", THUNK_VCALL_OFFSET (t));
116 dump_child ("fn", DECL_INITIAL (t));
121 /* The fake `::std' namespace does not have DECL_LANG_SPECIFIC,
122 and therefore many other macros do not work on it. */
123 if (t == fake_std_node)
125 if (DECL_NAMESPACE_ALIAS (t))
126 dump_child ("alis", DECL_NAMESPACE_ALIAS (t));
128 dump_child ("dcls", cp_namespace_decls (t));
132 dump_child ("rslt", DECL_TEMPLATE_RESULT (t));
133 dump_child ("inst", DECL_TEMPLATE_INSTANTIATIONS (t));
134 dump_child ("spcs", DECL_TEMPLATE_SPECIALIZATIONS (t));
138 dump_child ("crnt", OVL_CURRENT (t));
139 dump_child ("chan", OVL_CHAIN (t));
145 dump_string (di, "cleanup");
146 dump_child ("body", TRY_STMTS (t));
147 dump_child ("hdlr", TRY_HANDLERS (t));
148 dump_next_stmt (di, t);
152 dump_child ("clas", PTRMEM_CST_CLASS (t));
153 dump_child ("mbr", PTRMEM_CST_MEMBER (t));
157 /* These nodes are unary, but do not have code class `1'. */
158 dump_child ("op 0", TREE_OPERAND (t, 0));
162 dump_int (di, "ctor", AGGR_INIT_VIA_CTOR_P (t));
163 dump_child ("fn", TREE_OPERAND (t, 0));
164 dump_child ("args", TREE_OPERAND (t, 1));
165 dump_child ("decl", TREE_OPERAND (t, 2));
170 dump_child ("decl", CLEANUP_DECL (t));
171 dump_child ("expr", CLEANUP_EXPR (t));
172 dump_next_stmt (di, t);
177 if (CTOR_BEGIN_P (t))
178 dump_string (di, "begn");
180 dump_string (di, "end");
181 dump_next_stmt (di, t);
186 dump_child ("body", HANDLER_BODY (t));
187 dump_next_stmt (di, t);
192 dump_child ("clnp", TREE_OPERAND (t, 0));
193 dump_next_stmt (di, t);
196 case START_CATCH_STMT:
198 queue_and_dump_type (di, t);
199 dump_next_stmt (di, t);