1 /* Prints out tree in human readable form - GCC
2 Copyright (C) 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
3 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to the Free
19 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
25 #include "coretypes.h"
30 #include "langhooks.h"
31 #include "tree-iterator.h"
33 /* Define the hash table of nodes already seen.
34 Such nodes are not repeated; brief cross-references are used. */
44 static struct bucket
**table
;
46 /* Print the node NODE on standard error, for debugging.
47 Most nodes referred to by this one are printed recursively
48 down to a depth of six. */
51 debug_tree (tree node
)
53 table
= XCNEWVEC (struct bucket
*, HASH_SIZE
);
54 print_node (stderr
, "", node
, 0);
60 /* Print a node in brief fashion, with just the code, address and name. */
63 print_node_brief (FILE *file
, const char *prefix
, tree node
, int indent
)
65 enum tree_code_class
class;
70 class = TREE_CODE_CLASS (TREE_CODE (node
));
72 /* Always print the slot this node is in, and its code, address and
76 fprintf (file
, "%s <%s %p",
77 prefix
, tree_code_name
[(int) TREE_CODE (node
)], (char *) node
);
79 if (class == tcc_declaration
)
82 fprintf (file
, " %s", IDENTIFIER_POINTER (DECL_NAME (node
)));
83 else if (TREE_CODE (node
) == LABEL_DECL
84 && LABEL_DECL_UID (node
) != -1)
85 fprintf (file
, " L." HOST_WIDE_INT_PRINT_DEC
, LABEL_DECL_UID (node
));
87 fprintf (file
, " %c.%u", TREE_CODE (node
) == CONST_DECL
? 'C' : 'D',
90 else if (class == tcc_type
)
94 if (TREE_CODE (TYPE_NAME (node
)) == IDENTIFIER_NODE
)
95 fprintf (file
, " %s", IDENTIFIER_POINTER (TYPE_NAME (node
)));
96 else if (TREE_CODE (TYPE_NAME (node
)) == TYPE_DECL
97 && DECL_NAME (TYPE_NAME (node
)))
99 IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (node
))));
102 if (TREE_CODE (node
) == IDENTIFIER_NODE
)
103 fprintf (file
, " %s", IDENTIFIER_POINTER (node
));
105 /* We might as well always print the value of an integer or real. */
106 if (TREE_CODE (node
) == INTEGER_CST
)
108 if (TREE_CONSTANT_OVERFLOW (node
))
109 fprintf (file
, " overflow");
112 if (TREE_INT_CST_HIGH (node
) == 0)
113 fprintf (file
, HOST_WIDE_INT_PRINT_UNSIGNED
, TREE_INT_CST_LOW (node
));
114 else if (TREE_INT_CST_HIGH (node
) == -1
115 && TREE_INT_CST_LOW (node
) != 0)
116 fprintf (file
, "-" HOST_WIDE_INT_PRINT_UNSIGNED
,
117 -TREE_INT_CST_LOW (node
));
119 fprintf (file
, HOST_WIDE_INT_PRINT_DOUBLE_HEX
,
120 TREE_INT_CST_HIGH (node
), TREE_INT_CST_LOW (node
));
122 if (TREE_CODE (node
) == REAL_CST
)
126 if (TREE_OVERFLOW (node
))
127 fprintf (file
, " overflow");
129 d
= TREE_REAL_CST (node
);
130 if (REAL_VALUE_ISINF (d
))
131 fprintf (file
, " Inf");
132 else if (REAL_VALUE_ISNAN (d
))
133 fprintf (file
, " Nan");
137 real_to_decimal (string
, &d
, sizeof (string
), 0, 1);
138 fprintf (file
, " %s", string
);
146 indent_to (FILE *file
, int column
)
150 /* Since this is the long way, indent to desired column. */
152 fprintf (file
, "\n");
153 for (i
= 0; i
< column
; i
++)
157 /* Print the node NODE in full on file FILE, preceded by PREFIX,
158 starting in column INDENT. */
161 print_node (FILE *file
, const char *prefix
, tree node
, int indent
)
165 enum machine_mode mode
;
166 enum tree_code_class
class;
169 expanded_location xloc
;
175 code
= TREE_CODE (node
);
176 class = TREE_CODE_CLASS (code
);
178 /* Don't get too deep in nesting. If the user wants to see deeper,
179 it is easy to use the address of a lowest-level node
180 as an argument in another call to debug_tree. */
184 print_node_brief (file
, prefix
, node
, indent
);
188 if (indent
> 8 && (class == tcc_type
|| class == tcc_declaration
))
190 print_node_brief (file
, prefix
, node
, indent
);
194 /* It is unsafe to look at any other fields of an ERROR_MARK node. */
195 if (TREE_CODE (node
) == ERROR_MARK
)
197 print_node_brief (file
, prefix
, node
, indent
);
201 hash
= ((unsigned long) node
) % HASH_SIZE
;
203 /* If node is in the table, just mention its address. */
204 for (b
= table
[hash
]; b
; b
= b
->next
)
207 print_node_brief (file
, prefix
, node
, indent
);
211 /* Add this node to the table. */
212 b
= XNEW (struct bucket
);
214 b
->next
= table
[hash
];
217 /* Indent to the specified column, since this is the long form. */
218 indent_to (file
, indent
);
220 /* Print the slot this node is in, and its code, and address. */
221 fprintf (file
, "%s <%s %p",
222 prefix
, tree_code_name
[(int) TREE_CODE (node
)], (void *) node
);
224 /* Print the name, if any. */
225 if (class == tcc_declaration
)
227 if (DECL_NAME (node
))
228 fprintf (file
, " %s", IDENTIFIER_POINTER (DECL_NAME (node
)));
229 else if (TREE_CODE (node
) == LABEL_DECL
230 && LABEL_DECL_UID (node
) != -1)
231 fprintf (file
, " L." HOST_WIDE_INT_PRINT_DEC
, LABEL_DECL_UID (node
));
233 fprintf (file
, " %c.%u", TREE_CODE (node
) == CONST_DECL
? 'C' : 'D',
236 else if (class == tcc_type
)
238 if (TYPE_NAME (node
))
240 if (TREE_CODE (TYPE_NAME (node
)) == IDENTIFIER_NODE
)
241 fprintf (file
, " %s", IDENTIFIER_POINTER (TYPE_NAME (node
)));
242 else if (TREE_CODE (TYPE_NAME (node
)) == TYPE_DECL
243 && DECL_NAME (TYPE_NAME (node
)))
244 fprintf (file
, " %s",
245 IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (node
))));
248 if (TREE_CODE (node
) == IDENTIFIER_NODE
)
249 fprintf (file
, " %s", IDENTIFIER_POINTER (node
));
251 if (TREE_CODE (node
) == INTEGER_CST
)
254 print_node_brief (file
, "type", TREE_TYPE (node
), indent
+ 4);
258 print_node (file
, "type", TREE_TYPE (node
), indent
+ 4);
259 if (TREE_TYPE (node
))
260 indent_to (file
, indent
+ 3);
263 if (!TYPE_P (node
) && TREE_SIDE_EFFECTS (node
))
264 fputs (" side-effects", file
);
266 if (TYPE_P (node
) ? TYPE_READONLY (node
) : TREE_READONLY (node
))
267 fputs (" readonly", file
);
268 if (!TYPE_P (node
) && TREE_CONSTANT (node
))
269 fputs (" constant", file
);
270 else if (TYPE_P (node
) && TYPE_SIZES_GIMPLIFIED (node
))
271 fputs (" sizes-gimplified", file
);
273 if (TREE_INVARIANT (node
))
274 fputs (" invariant", file
);
275 if (TREE_ADDRESSABLE (node
))
276 fputs (" addressable", file
);
277 if (TREE_THIS_VOLATILE (node
))
278 fputs (" volatile", file
);
279 if (TREE_ASM_WRITTEN (node
))
280 fputs (" asm_written", file
);
281 if (TREE_USED (node
))
282 fputs (" used", file
);
283 if (TREE_NOTHROW (node
))
284 fputs (TYPE_P (node
) ? " align-ok" : " nothrow", file
);
285 if (TREE_PUBLIC (node
))
286 fputs (" public", file
);
287 if (TREE_PRIVATE (node
))
288 fputs (" private", file
);
289 if (TREE_PROTECTED (node
))
290 fputs (" protected", file
);
291 if (TREE_STATIC (node
))
292 fputs (" static", file
);
293 if (TREE_DEPRECATED (node
))
294 fputs (" deprecated", file
);
295 if (TREE_VISITED (node
))
296 fputs (" visited", file
);
297 if (TREE_LANG_FLAG_0 (node
))
298 fputs (" tree_0", file
);
299 if (TREE_LANG_FLAG_1 (node
))
300 fputs (" tree_1", file
);
301 if (TREE_LANG_FLAG_2 (node
))
302 fputs (" tree_2", file
);
303 if (TREE_LANG_FLAG_3 (node
))
304 fputs (" tree_3", file
);
305 if (TREE_LANG_FLAG_4 (node
))
306 fputs (" tree_4", file
);
307 if (TREE_LANG_FLAG_5 (node
))
308 fputs (" tree_5", file
);
309 if (TREE_LANG_FLAG_6 (node
))
310 fputs (" tree_6", file
);
312 /* DECL_ nodes have additional attributes. */
314 switch (TREE_CODE_CLASS (TREE_CODE (node
)))
316 case tcc_declaration
:
317 if (CODE_CONTAINS_STRUCT (code
, TS_DECL_COMMON
))
319 if (DECL_UNSIGNED (node
))
320 fputs (" unsigned", file
);
321 if (DECL_IGNORED_P (node
))
322 fputs (" ignored", file
);
323 if (DECL_ABSTRACT (node
))
324 fputs (" abstract", file
);
325 if (DECL_EXTERNAL (node
))
326 fputs (" external", file
);
327 if (DECL_NONLOCAL (node
))
328 fputs (" nonlocal", file
);
330 if (CODE_CONTAINS_STRUCT (code
, TS_DECL_WITH_VIS
))
332 if (DECL_WEAK (node
))
333 fputs (" weak", file
);
334 if (DECL_IN_SYSTEM_HEADER (node
))
335 fputs (" in_system_header", file
);
337 if (CODE_CONTAINS_STRUCT (code
, TS_DECL_WRTL
)
338 && TREE_CODE (node
) != LABEL_DECL
339 && TREE_CODE (node
) != FUNCTION_DECL
340 && DECL_REGISTER (node
))
341 fputs (" regdecl", file
);
343 if (TREE_CODE (node
) == TYPE_DECL
&& TYPE_DECL_SUPPRESS_DEBUG (node
))
344 fputs (" suppress-debug", file
);
346 if (TREE_CODE (node
) == FUNCTION_DECL
&& DECL_INLINE (node
))
347 fputs (DECL_DECLARED_INLINE_P (node
) ? " inline" : " autoinline", file
);
348 if (TREE_CODE (node
) == FUNCTION_DECL
&& DECL_BUILT_IN (node
))
349 fputs (" built-in", file
);
350 if (TREE_CODE (node
) == FUNCTION_DECL
&& DECL_NO_STATIC_CHAIN (node
))
351 fputs (" no-static-chain", file
);
353 if (TREE_CODE (node
) == FIELD_DECL
&& DECL_PACKED (node
))
354 fputs (" packed", file
);
355 if (TREE_CODE (node
) == FIELD_DECL
&& DECL_BIT_FIELD (node
))
356 fputs (" bit-field", file
);
357 if (TREE_CODE (node
) == FIELD_DECL
&& DECL_NONADDRESSABLE_P (node
))
358 fputs (" nonaddressable", file
);
360 if (TREE_CODE (node
) == LABEL_DECL
&& DECL_ERROR_ISSUED (node
))
361 fputs (" error-issued", file
);
363 if (TREE_CODE (node
) == VAR_DECL
&& DECL_IN_TEXT_SECTION (node
))
364 fputs (" in-text-section", file
);
365 if (TREE_CODE (node
) == VAR_DECL
&& DECL_COMMON (node
))
366 fputs (" common", file
);
367 if (TREE_CODE (node
) == VAR_DECL
&& DECL_THREAD_LOCAL_P (node
))
369 enum tls_model kind
= DECL_TLS_MODEL (node
);
372 case TLS_MODEL_GLOBAL_DYNAMIC
:
373 fputs (" tls-global-dynamic", file
);
375 case TLS_MODEL_LOCAL_DYNAMIC
:
376 fputs (" tls-local-dynamic", file
);
378 case TLS_MODEL_INITIAL_EXEC
:
379 fputs (" tls-initial-exec", file
);
381 case TLS_MODEL_LOCAL_EXEC
:
382 fputs (" tls-local-exec", file
);
389 if (CODE_CONTAINS_STRUCT (code
, TS_DECL_COMMON
))
391 if (DECL_VIRTUAL_P (node
))
392 fputs (" virtual", file
);
393 if (DECL_PRESERVE_P (node
))
394 fputs (" preserve", file
);
395 if (DECL_LANG_FLAG_0 (node
))
396 fputs (" decl_0", file
);
397 if (DECL_LANG_FLAG_1 (node
))
398 fputs (" decl_1", file
);
399 if (DECL_LANG_FLAG_2 (node
))
400 fputs (" decl_2", file
);
401 if (DECL_LANG_FLAG_3 (node
))
402 fputs (" decl_3", file
);
403 if (DECL_LANG_FLAG_4 (node
))
404 fputs (" decl_4", file
);
405 if (DECL_LANG_FLAG_5 (node
))
406 fputs (" decl_5", file
);
407 if (DECL_LANG_FLAG_6 (node
))
408 fputs (" decl_6", file
);
409 if (DECL_LANG_FLAG_7 (node
))
410 fputs (" decl_7", file
);
412 mode
= DECL_MODE (node
);
413 fprintf (file
, " %s", GET_MODE_NAME (mode
));
416 if (CODE_CONTAINS_STRUCT (code
, TS_DECL_WITH_VIS
) && DECL_DEFER_OUTPUT (node
))
417 fputs (" defer-output", file
);
420 xloc
= expand_location (DECL_SOURCE_LOCATION (node
));
421 fprintf (file
, " file %s line %d", xloc
.file
, xloc
.line
);
423 if (CODE_CONTAINS_STRUCT (code
, TS_DECL_COMMON
))
425 print_node (file
, "size", DECL_SIZE (node
), indent
+ 4);
426 print_node (file
, "unit size", DECL_SIZE_UNIT (node
), indent
+ 4);
428 if (TREE_CODE (node
) != FUNCTION_DECL
429 || DECL_INLINE (node
) || DECL_BUILT_IN (node
))
430 indent_to (file
, indent
+ 3);
432 if (TREE_CODE (node
) != FUNCTION_DECL
)
434 if (DECL_USER_ALIGN (node
))
435 fprintf (file
, " user");
437 fprintf (file
, " align %d", DECL_ALIGN (node
));
438 if (TREE_CODE (node
) == FIELD_DECL
)
439 fprintf (file
, " offset_align " HOST_WIDE_INT_PRINT_UNSIGNED
,
440 DECL_OFFSET_ALIGN (node
));
442 else if (DECL_BUILT_IN (node
))
444 if (DECL_BUILT_IN_CLASS (node
) == BUILT_IN_MD
)
445 fprintf (file
, " built-in BUILT_IN_MD %d", DECL_FUNCTION_CODE (node
));
447 fprintf (file
, " built-in %s:%s",
448 built_in_class_names
[(int) DECL_BUILT_IN_CLASS (node
)],
449 built_in_names
[(int) DECL_FUNCTION_CODE (node
)]);
452 if (DECL_POINTER_ALIAS_SET_KNOWN_P (node
))
453 fprintf (file
, " alias set " HOST_WIDE_INT_PRINT_DEC
,
454 DECL_POINTER_ALIAS_SET (node
));
456 if (TREE_CODE (node
) == FIELD_DECL
)
458 print_node (file
, "offset", DECL_FIELD_OFFSET (node
), indent
+ 4);
459 print_node (file
, "bit offset", DECL_FIELD_BIT_OFFSET (node
),
463 print_node_brief (file
, "context", DECL_CONTEXT (node
), indent
+ 4);
465 if (CODE_CONTAINS_STRUCT (code
, TS_DECL_COMMON
))
467 print_node_brief (file
, "attributes",
468 DECL_ATTRIBUTES (node
), indent
+ 4);
469 print_node_brief (file
, "initial", DECL_INITIAL (node
), indent
+ 4);
471 if (CODE_CONTAINS_STRUCT (code
, TS_DECL_WRTL
))
473 print_node_brief (file
, "abstract_origin",
474 DECL_ABSTRACT_ORIGIN (node
), indent
+ 4);
476 if (CODE_CONTAINS_STRUCT (code
, TS_DECL_NON_COMMON
))
478 print_node (file
, "arguments", DECL_ARGUMENT_FLD (node
), indent
+ 4);
479 print_node (file
, "result", DECL_RESULT_FLD (node
), indent
+ 4);
482 lang_hooks
.print_decl (file
, node
, indent
);
484 if (DECL_RTL_SET_P (node
))
486 indent_to (file
, indent
+ 4);
487 print_rtl (file
, DECL_RTL (node
));
490 if (TREE_CODE (node
) == PARM_DECL
)
492 print_node (file
, "arg-type", DECL_ARG_TYPE (node
), indent
+ 4);
494 if (DECL_INCOMING_RTL (node
) != 0)
496 indent_to (file
, indent
+ 4);
497 fprintf (file
, "incoming-rtl ");
498 print_rtl (file
, DECL_INCOMING_RTL (node
));
501 else if (TREE_CODE (node
) == FUNCTION_DECL
502 && DECL_STRUCT_FUNCTION (node
) != 0)
504 indent_to (file
, indent
+ 4);
505 fprintf (file
, "saved-insns %p",
506 (void *) DECL_STRUCT_FUNCTION (node
));
509 if ((TREE_CODE (node
) == VAR_DECL
|| TREE_CODE (node
) == PARM_DECL
)
510 && DECL_HAS_VALUE_EXPR_P (node
))
511 print_node (file
, "value-expr", DECL_VALUE_EXPR (node
), indent
+ 4);
513 if (TREE_CODE (node
) == STRUCT_FIELD_TAG
)
515 fprintf (file
, " sft size " HOST_WIDE_INT_PRINT_DEC
,
517 fprintf (file
, " sft offset " HOST_WIDE_INT_PRINT_DEC
,
519 print_node_brief (file
, "parent var", SFT_PARENT_VAR (node
),
522 /* Print the decl chain only if decl is at second level. */
524 print_node (file
, "chain", TREE_CHAIN (node
), indent
+ 4);
526 print_node_brief (file
, "chain", TREE_CHAIN (node
), indent
+ 4);
530 if (TYPE_UNSIGNED (node
))
531 fputs (" unsigned", file
);
533 /* The no-force-blk flag is used for different things in
535 if ((TREE_CODE (node
) == RECORD_TYPE
536 || TREE_CODE (node
) == UNION_TYPE
537 || TREE_CODE (node
) == QUAL_UNION_TYPE
)
538 && TYPE_NO_FORCE_BLK (node
))
539 fputs (" no-force-blk", file
);
540 else if (TREE_CODE (node
) == INTEGER_TYPE
541 && TYPE_IS_SIZETYPE (node
))
542 fputs (" sizetype", file
);
543 else if (TREE_CODE (node
) == FUNCTION_TYPE
544 && TYPE_RETURNS_STACK_DEPRESSED (node
))
545 fputs (" returns-stack-depressed", file
);
547 if (TYPE_STRING_FLAG (node
))
548 fputs (" string-flag", file
);
549 if (TYPE_NEEDS_CONSTRUCTING (node
))
550 fputs (" needs-constructing", file
);
552 /* The transparent-union flag is used for different things in
554 if (TREE_CODE (node
) == UNION_TYPE
&& TYPE_TRANSPARENT_UNION (node
))
555 fputs (" transparent-union", file
);
556 else if (TREE_CODE (node
) == ARRAY_TYPE
557 && TYPE_NONALIASED_COMPONENT (node
))
558 fputs (" nonaliased-component", file
);
560 if (TYPE_PACKED (node
))
561 fputs (" packed", file
);
563 if (TYPE_RESTRICT (node
))
564 fputs (" restrict", file
);
566 if (TYPE_LANG_FLAG_0 (node
))
567 fputs (" type_0", file
);
568 if (TYPE_LANG_FLAG_1 (node
))
569 fputs (" type_1", file
);
570 if (TYPE_LANG_FLAG_2 (node
))
571 fputs (" type_2", file
);
572 if (TYPE_LANG_FLAG_3 (node
))
573 fputs (" type_3", file
);
574 if (TYPE_LANG_FLAG_4 (node
))
575 fputs (" type_4", file
);
576 if (TYPE_LANG_FLAG_5 (node
))
577 fputs (" type_5", file
);
578 if (TYPE_LANG_FLAG_6 (node
))
579 fputs (" type_6", file
);
581 mode
= TYPE_MODE (node
);
582 fprintf (file
, " %s", GET_MODE_NAME (mode
));
584 print_node (file
, "size", TYPE_SIZE (node
), indent
+ 4);
585 print_node (file
, "unit size", TYPE_SIZE_UNIT (node
), indent
+ 4);
586 indent_to (file
, indent
+ 3);
588 if (TYPE_USER_ALIGN (node
))
589 fprintf (file
, " user");
591 fprintf (file
, " align %d symtab %d alias set " HOST_WIDE_INT_PRINT_DEC
,
592 TYPE_ALIGN (node
), TYPE_SYMTAB_ADDRESS (node
),
593 TYPE_ALIAS_SET (node
));
595 print_node (file
, "attributes", TYPE_ATTRIBUTES (node
), indent
+ 4);
597 if (INTEGRAL_TYPE_P (node
) || TREE_CODE (node
) == REAL_TYPE
)
599 fprintf (file
, " precision %d", TYPE_PRECISION (node
));
600 print_node_brief (file
, "min", TYPE_MIN_VALUE (node
), indent
+ 4);
601 print_node_brief (file
, "max", TYPE_MAX_VALUE (node
), indent
+ 4);
604 if (TREE_CODE (node
) == ENUMERAL_TYPE
)
605 print_node (file
, "values", TYPE_VALUES (node
), indent
+ 4);
606 else if (TREE_CODE (node
) == ARRAY_TYPE
)
607 print_node (file
, "domain", TYPE_DOMAIN (node
), indent
+ 4);
608 else if (TREE_CODE (node
) == VECTOR_TYPE
)
609 fprintf (file
, " nunits %d", (int) TYPE_VECTOR_SUBPARTS (node
));
610 else if (TREE_CODE (node
) == RECORD_TYPE
611 || TREE_CODE (node
) == UNION_TYPE
612 || TREE_CODE (node
) == QUAL_UNION_TYPE
)
613 print_node (file
, "fields", TYPE_FIELDS (node
), indent
+ 4);
614 else if (TREE_CODE (node
) == FUNCTION_TYPE
615 || TREE_CODE (node
) == METHOD_TYPE
)
617 if (TYPE_METHOD_BASETYPE (node
))
618 print_node_brief (file
, "method basetype",
619 TYPE_METHOD_BASETYPE (node
), indent
+ 4);
620 print_node (file
, "arg-types", TYPE_ARG_TYPES (node
), indent
+ 4);
622 else if (TREE_CODE (node
) == OFFSET_TYPE
)
623 print_node_brief (file
, "basetype", TYPE_OFFSET_BASETYPE (node
),
626 if (TYPE_CONTEXT (node
))
627 print_node_brief (file
, "context", TYPE_CONTEXT (node
), indent
+ 4);
629 lang_hooks
.print_type (file
, node
, indent
);
631 if (TYPE_POINTER_TO (node
) || TREE_CHAIN (node
))
632 indent_to (file
, indent
+ 3);
634 print_node_brief (file
, "pointer_to_this", TYPE_POINTER_TO (node
),
636 print_node_brief (file
, "reference_to_this", TYPE_REFERENCE_TO (node
),
638 print_node_brief (file
, "chain", TREE_CHAIN (node
), indent
+ 4);
647 if (TREE_CODE (node
) == BIT_FIELD_REF
&& BIT_FIELD_REF_UNSIGNED (node
))
648 fputs (" unsigned", file
);
649 if (TREE_CODE (node
) == BIND_EXPR
)
651 print_node (file
, "vars", TREE_OPERAND (node
, 0), indent
+ 4);
652 print_node (file
, "body", TREE_OPERAND (node
, 1), indent
+ 4);
653 print_node (file
, "block", TREE_OPERAND (node
, 2), indent
+ 4);
657 len
= TREE_CODE_LENGTH (TREE_CODE (node
));
659 for (i
= 0; i
< len
; i
++)
663 sprintf (temp
, "arg %d", i
);
664 print_node (file
, temp
, TREE_OPERAND (node
, i
), indent
+ 4);
667 print_node (file
, "chain", TREE_CHAIN (node
), indent
+ 4);
671 case tcc_exceptional
:
672 switch (TREE_CODE (node
))
675 if (TREE_CONSTANT_OVERFLOW (node
))
676 fprintf (file
, " overflow");
679 if (TREE_INT_CST_HIGH (node
) == 0)
680 fprintf (file
, HOST_WIDE_INT_PRINT_UNSIGNED
,
681 TREE_INT_CST_LOW (node
));
682 else if (TREE_INT_CST_HIGH (node
) == -1
683 && TREE_INT_CST_LOW (node
) != 0)
684 fprintf (file
, "-" HOST_WIDE_INT_PRINT_UNSIGNED
,
685 -TREE_INT_CST_LOW (node
));
687 fprintf (file
, HOST_WIDE_INT_PRINT_DOUBLE_HEX
,
688 TREE_INT_CST_HIGH (node
), TREE_INT_CST_LOW (node
));
695 if (TREE_OVERFLOW (node
))
696 fprintf (file
, " overflow");
698 d
= TREE_REAL_CST (node
);
699 if (REAL_VALUE_ISINF (d
))
700 fprintf (file
, " Inf");
701 else if (REAL_VALUE_ISNAN (d
))
702 fprintf (file
, " Nan");
706 real_to_decimal (string
, &d
, sizeof (string
), 0, 1);
707 fprintf (file
, " %s", string
);
714 tree vals
= TREE_VECTOR_CST_ELTS (node
);
720 for (link
= vals
; link
; link
= TREE_CHAIN (link
), ++i
)
722 sprintf (buf
, "elt%d: ", i
);
723 print_node (file
, buf
, TREE_VALUE (link
), indent
+ 4);
729 print_node (file
, "real", TREE_REALPART (node
), indent
+ 4);
730 print_node (file
, "imag", TREE_IMAGPART (node
), indent
+ 4);
735 const char *p
= TREE_STRING_POINTER (node
);
736 int i
= TREE_STRING_LENGTH (node
);
741 if (ch
>= ' ' && ch
< 127)
744 fprintf(file
, "\\%03o", ch
& 0xFF);
748 /* Print the chain at second level. */
750 print_node (file
, "chain", TREE_CHAIN (node
), indent
+ 4);
752 print_node_brief (file
, "chain", TREE_CHAIN (node
), indent
+ 4);
755 case IDENTIFIER_NODE
:
756 lang_hooks
.print_identifier (file
, node
, indent
);
760 print_node (file
, "purpose", TREE_PURPOSE (node
), indent
+ 4);
761 print_node (file
, "value", TREE_VALUE (node
), indent
+ 4);
762 print_node (file
, "chain", TREE_CHAIN (node
), indent
+ 4);
766 len
= TREE_VEC_LENGTH (node
);
767 for (i
= 0; i
< len
; i
++)
768 if (TREE_VEC_ELT (node
, i
))
771 sprintf (temp
, "elt %d", i
);
772 indent_to (file
, indent
+ 4);
773 print_node_brief (file
, temp
, TREE_VEC_ELT (node
, i
), 0);
778 fprintf (file
, " head %p tail %p stmts",
779 (void *) node
->stmt_list
.head
, (void *) node
->stmt_list
.tail
);
781 tree_stmt_iterator i
;
782 for (i
= tsi_start (node
); !tsi_end_p (i
); tsi_next (&i
))
784 /* Not printing the addresses of the (not-a-tree)
785 'struct tree_stmt_list_node's. */
786 fprintf (file
, " %p", (void *)tsi_stmt (i
));
788 fprintf (file
, "\n");
789 for (i
= tsi_start (node
); !tsi_end_p (i
); tsi_next (&i
))
791 /* Not printing the addresses of the (not-a-tree)
792 'struct tree_stmt_list_node's. */
793 print_node (file
, "stmt", tsi_stmt (i
), indent
+ 4);
796 print_node (file
, "chain", TREE_CHAIN (node
), indent
+ 4);
800 print_node (file
, "vars", BLOCK_VARS (node
), indent
+ 4);
801 print_node (file
, "supercontext", BLOCK_SUPERCONTEXT (node
),
803 print_node (file
, "subblocks", BLOCK_SUBBLOCKS (node
), indent
+ 4);
804 print_node (file
, "chain", BLOCK_CHAIN (node
), indent
+ 4);
805 print_node (file
, "abstract_origin",
806 BLOCK_ABSTRACT_ORIGIN (node
), indent
+ 4);
810 print_node_brief (file
, "var", SSA_NAME_VAR (node
), indent
+ 4);
811 print_node_brief (file
, "def_stmt",
812 SSA_NAME_DEF_STMT (node
), indent
+ 4);
814 indent_to (file
, indent
+ 4);
815 fprintf (file
, "version %u", SSA_NAME_VERSION (node
));
816 if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (node
))
817 fprintf (file
, " in-abnormal-phi");
818 if (SSA_NAME_IN_FREE_LIST (node
))
819 fprintf (file
, " in-free-list");
821 if (SSA_NAME_PTR_INFO (node
)
822 || SSA_NAME_VALUE (node
)
823 || SSA_NAME_AUX (node
))
825 indent_to (file
, indent
+ 3);
826 if (SSA_NAME_PTR_INFO (node
))
827 fprintf (file
, " ptr-info %p",
828 (void *) SSA_NAME_PTR_INFO (node
));
829 if (SSA_NAME_VALUE (node
))
830 fprintf (file
, " value %p",
831 (void *) SSA_NAME_VALUE (node
));
832 if (SSA_NAME_AUX (node
))
833 fprintf (file
, " aux %p", SSA_NAME_AUX (node
));
840 fprintf (file
, " %s",
841 omp_clause_code_name
[OMP_CLAUSE_CODE (node
)]);
842 for (i
= 0; i
< omp_clause_num_ops
[OMP_CLAUSE_CODE (node
)]; i
++)
844 indent_to (file
, indent
+ 4);
845 fprintf (file
, "op %d:", i
);
846 print_node_brief (file
, "", OMP_CLAUSE_OPERAND (node
, i
), 0);
852 if (EXCEPTIONAL_CLASS_P (node
))
853 lang_hooks
.print_xnode (file
, node
, indent
);
860 if (EXPR_HAS_LOCATION (node
))
862 expanded_location xloc
= expand_location (EXPR_LOCATION (node
));
863 indent_to (file
, indent
+4);
864 fprintf (file
, "%s:%d", xloc
.file
, xloc
.line
);