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, 2006, 2007, 2008, 2009
4 Free Software Foundation, Inc.
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 3, or (at your option) any later
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
25 #include "coretypes.h"
29 #include "fixed-value.h"
31 #include "langhooks.h"
32 #include "tree-iterator.h"
33 #include "diagnostic.h"
34 #include "tree-flow.h"
36 /* Define the hash table of nodes already seen.
37 Such nodes are not repeated; brief cross-references are used. */
47 static struct bucket **table;
49 /* Print the node NODE on standard error, for debugging.
50 Most nodes referred to by this one are printed recursively
51 down to a depth of six. */
54 debug_tree (tree node)
56 table = XCNEWVEC (struct bucket *, HASH_SIZE);
57 print_node (stderr, "", node, 0);
63 /* Print PREFIX and ADDR to FILE. */
65 dump_addr (FILE *file, const char *prefix, const void *addr)
67 if (flag_dump_noaddr || flag_dump_unnumbered)
68 fprintf (file, "%s#", prefix);
70 fprintf (file, "%s" HOST_PTR_PRINTF, prefix, addr);
73 /* Print a node in brief fashion, with just the code, address and name. */
76 print_node_brief (FILE *file, const char *prefix, const_tree node, int indent)
78 enum tree_code_class tclass;
83 tclass = TREE_CODE_CLASS (TREE_CODE (node));
85 /* Always print the slot this node is in, and its code, address and
89 fprintf (file, "%s <%s", prefix, tree_code_name[(int) TREE_CODE (node)]);
90 dump_addr (file, " ", node);
92 if (tclass == tcc_declaration)
95 fprintf (file, " %s", IDENTIFIER_POINTER (DECL_NAME (node)));
96 else if (TREE_CODE (node) == LABEL_DECL
97 && LABEL_DECL_UID (node) != -1)
98 fprintf (file, " L.%d", (int) LABEL_DECL_UID (node));
100 fprintf (file, " %c.%u", TREE_CODE (node) == CONST_DECL ? 'C' : 'D',
103 else if (tclass == tcc_type)
105 if (TYPE_NAME (node))
107 if (TREE_CODE (TYPE_NAME (node)) == IDENTIFIER_NODE)
108 fprintf (file, " %s", IDENTIFIER_POINTER (TYPE_NAME (node)));
109 else if (TREE_CODE (TYPE_NAME (node)) == TYPE_DECL
110 && DECL_NAME (TYPE_NAME (node)))
111 fprintf (file, " %s",
112 IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (node))));
115 if (TREE_CODE (node) == IDENTIFIER_NODE)
116 fprintf (file, " %s", IDENTIFIER_POINTER (node));
118 /* We might as well always print the value of an integer or real. */
119 if (TREE_CODE (node) == INTEGER_CST)
121 if (TREE_OVERFLOW (node))
122 fprintf (file, " overflow");
125 if (TREE_INT_CST_HIGH (node) == 0)
126 fprintf (file, HOST_WIDE_INT_PRINT_UNSIGNED, TREE_INT_CST_LOW (node));
127 else if (TREE_INT_CST_HIGH (node) == -1
128 && TREE_INT_CST_LOW (node) != 0)
129 fprintf (file, "-" HOST_WIDE_INT_PRINT_UNSIGNED,
130 -TREE_INT_CST_LOW (node));
132 fprintf (file, HOST_WIDE_INT_PRINT_DOUBLE_HEX,
133 (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (node),
134 (unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (node));
136 if (TREE_CODE (node) == REAL_CST)
140 if (TREE_OVERFLOW (node))
141 fprintf (file, " overflow");
143 d = TREE_REAL_CST (node);
144 if (REAL_VALUE_ISINF (d))
145 fprintf (file, REAL_VALUE_NEGATIVE (d) ? " -Inf" : " Inf");
146 else if (REAL_VALUE_ISNAN (d))
147 fprintf (file, " Nan");
151 real_to_decimal (string, &d, sizeof (string), 0, 1);
152 fprintf (file, " %s", string);
155 if (TREE_CODE (node) == FIXED_CST)
160 if (TREE_OVERFLOW (node))
161 fprintf (file, " overflow");
163 f = TREE_FIXED_CST (node);
164 fixed_to_decimal (string, &f, sizeof (string));
165 fprintf (file, " %s", string);
172 indent_to (FILE *file, int column)
176 /* Since this is the long way, indent to desired column. */
178 fprintf (file, "\n");
179 for (i = 0; i < column; i++)
183 /* Print the node NODE in full on file FILE, preceded by PREFIX,
184 starting in column INDENT. */
187 print_node (FILE *file, const char *prefix, tree node, int indent)
191 enum machine_mode mode;
192 enum tree_code_class tclass;
195 expanded_location xloc;
201 code = TREE_CODE (node);
202 tclass = TREE_CODE_CLASS (code);
204 /* Don't get too deep in nesting. If the user wants to see deeper,
205 it is easy to use the address of a lowest-level node
206 as an argument in another call to debug_tree. */
210 print_node_brief (file, prefix, node, indent);
214 if (indent > 8 && (tclass == tcc_type || tclass == tcc_declaration))
216 print_node_brief (file, prefix, node, indent);
220 /* It is unsafe to look at any other fields of an ERROR_MARK node. */
221 if (code == ERROR_MARK)
223 print_node_brief (file, prefix, node, indent);
227 /* Allow this function to be called if the table is not there. */
230 hash = ((unsigned long) node) % HASH_SIZE;
232 /* If node is in the table, just mention its address. */
233 for (b = table[hash]; b; b = b->next)
236 print_node_brief (file, prefix, node, indent);
240 /* Add this node to the table. */
241 b = XNEW (struct bucket);
243 b->next = table[hash];
247 /* Indent to the specified column, since this is the long form. */
248 indent_to (file, indent);
250 /* Print the slot this node is in, and its code, and address. */
251 fprintf (file, "%s <%s", prefix, tree_code_name[(int) code]);
252 dump_addr (file, " ", node);
254 /* Print the name, if any. */
255 if (tclass == tcc_declaration)
257 if (DECL_NAME (node))
258 fprintf (file, " %s", IDENTIFIER_POINTER (DECL_NAME (node)));
259 else if (code == LABEL_DECL
260 && LABEL_DECL_UID (node) != -1)
261 fprintf (file, " L.%d", (int) LABEL_DECL_UID (node));
263 fprintf (file, " %c.%u", code == CONST_DECL ? 'C' : 'D',
266 else if (tclass == tcc_type)
268 if (TYPE_NAME (node))
270 if (TREE_CODE (TYPE_NAME (node)) == IDENTIFIER_NODE)
271 fprintf (file, " %s", IDENTIFIER_POINTER (TYPE_NAME (node)));
272 else if (TREE_CODE (TYPE_NAME (node)) == TYPE_DECL
273 && DECL_NAME (TYPE_NAME (node)))
274 fprintf (file, " %s",
275 IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (node))));
278 if (code == IDENTIFIER_NODE)
279 fprintf (file, " %s", IDENTIFIER_POINTER (node));
281 if (code == INTEGER_CST)
284 print_node_brief (file, "type", TREE_TYPE (node), indent + 4);
288 print_node (file, "type", TREE_TYPE (node), indent + 4);
289 if (TREE_TYPE (node))
290 indent_to (file, indent + 3);
293 if (!TYPE_P (node) && TREE_SIDE_EFFECTS (node))
294 fputs (" side-effects", file);
296 if (TYPE_P (node) ? TYPE_READONLY (node) : TREE_READONLY (node))
297 fputs (" readonly", file);
298 if (!TYPE_P (node) && TREE_CONSTANT (node))
299 fputs (" constant", file);
300 else if (TYPE_P (node) && TYPE_SIZES_GIMPLIFIED (node))
301 fputs (" sizes-gimplified", file);
303 if (TREE_ADDRESSABLE (node))
304 fputs (" addressable", file);
305 if (TREE_THIS_VOLATILE (node))
306 fputs (" volatile", file);
307 if (TREE_ASM_WRITTEN (node))
308 fputs (" asm_written", file);
309 if (TREE_USED (node))
310 fputs (" used", file);
311 if (TREE_NOTHROW (node))
312 fputs (TYPE_P (node) ? " align-ok" : " nothrow", file);
313 if (TREE_PUBLIC (node))
314 fputs (" public", file);
315 if (TREE_PRIVATE (node))
316 fputs (" private", file);
317 if (TREE_PROTECTED (node))
318 fputs (" protected", file);
319 if (TREE_STATIC (node))
320 fputs (" static", file);
321 if (TREE_DEPRECATED (node))
322 fputs (" deprecated", file);
323 if (TREE_VISITED (node))
324 fputs (" visited", file);
325 if (TREE_LANG_FLAG_0 (node))
326 fputs (" tree_0", file);
327 if (TREE_LANG_FLAG_1 (node))
328 fputs (" tree_1", file);
329 if (TREE_LANG_FLAG_2 (node))
330 fputs (" tree_2", file);
331 if (TREE_LANG_FLAG_3 (node))
332 fputs (" tree_3", file);
333 if (TREE_LANG_FLAG_4 (node))
334 fputs (" tree_4", file);
335 if (TREE_LANG_FLAG_5 (node))
336 fputs (" tree_5", file);
337 if (TREE_LANG_FLAG_6 (node))
338 fputs (" tree_6", file);
340 /* DECL_ nodes have additional attributes. */
342 switch (TREE_CODE_CLASS (code))
344 case tcc_declaration:
345 if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
347 if (DECL_UNSIGNED (node))
348 fputs (" unsigned", file);
349 if (DECL_IGNORED_P (node))
350 fputs (" ignored", file);
351 if (DECL_ABSTRACT (node))
352 fputs (" abstract", file);
353 if (DECL_EXTERNAL (node))
354 fputs (" external", file);
355 if (DECL_NONLOCAL (node))
356 fputs (" nonlocal", file);
358 if (CODE_CONTAINS_STRUCT (code, TS_DECL_WITH_VIS))
360 if (DECL_WEAK (node))
361 fputs (" weak", file);
362 if (DECL_IN_SYSTEM_HEADER (node))
363 fputs (" in_system_header", file);
365 if (CODE_CONTAINS_STRUCT (code, TS_DECL_WRTL)
366 && code != LABEL_DECL
367 && code != FUNCTION_DECL
368 && DECL_REGISTER (node))
369 fputs (" regdecl", file);
371 if (code == TYPE_DECL && TYPE_DECL_SUPPRESS_DEBUG (node))
372 fputs (" suppress-debug", file);
374 if (code == FUNCTION_DECL
375 && DECL_FUNCTION_SPECIFIC_TARGET (node))
376 fputs (" function-specific-target", file);
377 if (code == FUNCTION_DECL
378 && DECL_FUNCTION_SPECIFIC_OPTIMIZATION (node))
379 fputs (" function-specific-opt", file);
380 if (code == FUNCTION_DECL && DECL_DECLARED_INLINE_P (node))
381 fputs (" autoinline", file);
382 if (code == FUNCTION_DECL && DECL_BUILT_IN (node))
383 fputs (" built-in", file);
384 if (code == FUNCTION_DECL && DECL_NO_STATIC_CHAIN (node))
385 fputs (" no-static-chain", file);
387 if (code == FIELD_DECL && DECL_PACKED (node))
388 fputs (" packed", file);
389 if (code == FIELD_DECL && DECL_BIT_FIELD (node))
390 fputs (" bit-field", file);
391 if (code == FIELD_DECL && DECL_NONADDRESSABLE_P (node))
392 fputs (" nonaddressable", file);
394 if (code == LABEL_DECL && DECL_ERROR_ISSUED (node))
395 fputs (" error-issued", file);
396 if (code == LABEL_DECL && EH_LANDING_PAD_NR (node))
397 fprintf (file, " landing-pad:%d", EH_LANDING_PAD_NR (node));
399 if (code == VAR_DECL && DECL_IN_TEXT_SECTION (node))
400 fputs (" in-text-section", file);
401 if (code == VAR_DECL && DECL_COMMON (node))
402 fputs (" common", file);
403 if (code == VAR_DECL && DECL_THREAD_LOCAL_P (node))
405 enum tls_model kind = DECL_TLS_MODEL (node);
408 case TLS_MODEL_GLOBAL_DYNAMIC:
409 fputs (" tls-global-dynamic", file);
411 case TLS_MODEL_LOCAL_DYNAMIC:
412 fputs (" tls-local-dynamic", file);
414 case TLS_MODEL_INITIAL_EXEC:
415 fputs (" tls-initial-exec", file);
417 case TLS_MODEL_LOCAL_EXEC:
418 fputs (" tls-local-exec", file);
425 if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
427 if (DECL_VIRTUAL_P (node))
428 fputs (" virtual", file);
429 if (DECL_PRESERVE_P (node))
430 fputs (" preserve", file);
431 if (DECL_LANG_FLAG_0 (node))
432 fputs (" decl_0", file);
433 if (DECL_LANG_FLAG_1 (node))
434 fputs (" decl_1", file);
435 if (DECL_LANG_FLAG_2 (node))
436 fputs (" decl_2", file);
437 if (DECL_LANG_FLAG_3 (node))
438 fputs (" decl_3", file);
439 if (DECL_LANG_FLAG_4 (node))
440 fputs (" decl_4", file);
441 if (DECL_LANG_FLAG_5 (node))
442 fputs (" decl_5", file);
443 if (DECL_LANG_FLAG_6 (node))
444 fputs (" decl_6", file);
445 if (DECL_LANG_FLAG_7 (node))
446 fputs (" decl_7", file);
448 mode = DECL_MODE (node);
449 fprintf (file, " %s", GET_MODE_NAME (mode));
452 if ((code == VAR_DECL || code == PARM_DECL || code == RESULT_DECL)
453 && DECL_BY_REFERENCE (node))
454 fputs (" passed-by-reference", file);
456 if (CODE_CONTAINS_STRUCT (code, TS_DECL_WITH_VIS) && DECL_DEFER_OUTPUT (node))
457 fputs (" defer-output", file);
460 xloc = expand_location (DECL_SOURCE_LOCATION (node));
461 fprintf (file, " file %s line %d col %d", xloc.file, xloc.line,
464 if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
466 print_node (file, "size", DECL_SIZE (node), indent + 4);
467 print_node (file, "unit size", DECL_SIZE_UNIT (node), indent + 4);
469 if (code != FUNCTION_DECL || DECL_BUILT_IN (node))
470 indent_to (file, indent + 3);
472 if (DECL_USER_ALIGN (node))
473 fprintf (file, " user");
475 fprintf (file, " align %d", DECL_ALIGN (node));
476 if (code == FIELD_DECL)
477 fprintf (file, " offset_align " HOST_WIDE_INT_PRINT_UNSIGNED,
478 DECL_OFFSET_ALIGN (node));
480 if (code == FUNCTION_DECL && DECL_BUILT_IN (node))
482 if (DECL_BUILT_IN_CLASS (node) == BUILT_IN_MD)
483 fprintf (file, " built-in BUILT_IN_MD %d", DECL_FUNCTION_CODE (node));
485 fprintf (file, " built-in %s:%s",
486 built_in_class_names[(int) DECL_BUILT_IN_CLASS (node)],
487 built_in_names[(int) DECL_FUNCTION_CODE (node)]);
490 if (code == FIELD_DECL)
492 print_node (file, "offset", DECL_FIELD_OFFSET (node), indent + 4);
493 print_node (file, "bit offset", DECL_FIELD_BIT_OFFSET (node),
495 if (DECL_BIT_FIELD_TYPE (node))
496 print_node (file, "bit_field_type", DECL_BIT_FIELD_TYPE (node),
500 print_node_brief (file, "context", DECL_CONTEXT (node), indent + 4);
502 if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
504 print_node_brief (file, "attributes",
505 DECL_ATTRIBUTES (node), indent + 4);
506 if (code != PARM_DECL)
507 print_node_brief (file, "initial", DECL_INITIAL (node),
510 if (CODE_CONTAINS_STRUCT (code, TS_DECL_WRTL))
512 print_node_brief (file, "abstract_origin",
513 DECL_ABSTRACT_ORIGIN (node), indent + 4);
515 if (CODE_CONTAINS_STRUCT (code, TS_DECL_NON_COMMON))
517 print_node (file, "arguments", DECL_ARGUMENT_FLD (node), indent + 4);
518 print_node (file, "result", DECL_RESULT_FLD (node), indent + 4);
521 lang_hooks.print_decl (file, node, indent);
523 if (DECL_RTL_SET_P (node))
525 indent_to (file, indent + 4);
526 print_rtl (file, DECL_RTL (node));
529 if (code == PARM_DECL)
531 print_node (file, "arg-type", DECL_ARG_TYPE (node), indent + 4);
533 if (DECL_INCOMING_RTL (node) != 0)
535 indent_to (file, indent + 4);
536 fprintf (file, "incoming-rtl ");
537 print_rtl (file, DECL_INCOMING_RTL (node));
540 else if (code == FUNCTION_DECL
541 && DECL_STRUCT_FUNCTION (node) != 0)
543 indent_to (file, indent + 4);
544 dump_addr (file, "saved-insns ", DECL_STRUCT_FUNCTION (node));
547 if ((code == VAR_DECL || code == PARM_DECL)
548 && DECL_HAS_VALUE_EXPR_P (node))
549 print_node (file, "value-expr", DECL_VALUE_EXPR (node), indent + 4);
551 /* Print the decl chain only if decl is at second level. */
553 print_node (file, "chain", TREE_CHAIN (node), indent + 4);
555 print_node_brief (file, "chain", TREE_CHAIN (node), indent + 4);
559 if (TYPE_UNSIGNED (node))
560 fputs (" unsigned", file);
562 /* The no-force-blk flag is used for different things in
564 if ((code == RECORD_TYPE
565 || code == UNION_TYPE
566 || code == QUAL_UNION_TYPE)
567 && TYPE_NO_FORCE_BLK (node))
568 fputs (" no-force-blk", file);
569 else if (code == INTEGER_TYPE
570 && TYPE_IS_SIZETYPE (node))
571 fputs (" sizetype", file);
573 if (TYPE_STRING_FLAG (node))
574 fputs (" string-flag", file);
575 if (TYPE_NEEDS_CONSTRUCTING (node))
576 fputs (" needs-constructing", file);
578 /* The transparent-union flag is used for different things in
580 if (code == UNION_TYPE && TYPE_TRANSPARENT_UNION (node))
581 fputs (" transparent-union", file);
582 else if (code == ARRAY_TYPE
583 && TYPE_NONALIASED_COMPONENT (node))
584 fputs (" nonaliased-component", file);
586 if (TYPE_PACKED (node))
587 fputs (" packed", file);
589 if (TYPE_RESTRICT (node))
590 fputs (" restrict", file);
592 if (TYPE_LANG_FLAG_0 (node))
593 fputs (" type_0", file);
594 if (TYPE_LANG_FLAG_1 (node))
595 fputs (" type_1", file);
596 if (TYPE_LANG_FLAG_2 (node))
597 fputs (" type_2", file);
598 if (TYPE_LANG_FLAG_3 (node))
599 fputs (" type_3", file);
600 if (TYPE_LANG_FLAG_4 (node))
601 fputs (" type_4", file);
602 if (TYPE_LANG_FLAG_5 (node))
603 fputs (" type_5", file);
604 if (TYPE_LANG_FLAG_6 (node))
605 fputs (" type_6", file);
607 mode = TYPE_MODE (node);
608 fprintf (file, " %s", GET_MODE_NAME (mode));
610 print_node (file, "size", TYPE_SIZE (node), indent + 4);
611 print_node (file, "unit size", TYPE_SIZE_UNIT (node), indent + 4);
612 indent_to (file, indent + 3);
614 if (TYPE_USER_ALIGN (node))
615 fprintf (file, " user");
617 fprintf (file, " align %d symtab %d alias set " HOST_WIDE_INT_PRINT_DEC,
618 TYPE_ALIGN (node), TYPE_SYMTAB_ADDRESS (node),
619 (HOST_WIDE_INT) TYPE_ALIAS_SET (node));
621 if (TYPE_STRUCTURAL_EQUALITY_P (node))
622 fprintf (file, " structural equality");
624 dump_addr (file, " canonical type ", TYPE_CANONICAL (node));
626 print_node (file, "attributes", TYPE_ATTRIBUTES (node), indent + 4);
628 if (INTEGRAL_TYPE_P (node) || code == REAL_TYPE
629 || code == FIXED_POINT_TYPE)
631 fprintf (file, " precision %d", TYPE_PRECISION (node));
632 print_node_brief (file, "min", TYPE_MIN_VALUE (node), indent + 4);
633 print_node_brief (file, "max", TYPE_MAX_VALUE (node), indent + 4);
636 if (code == ENUMERAL_TYPE)
637 print_node (file, "values", TYPE_VALUES (node), indent + 4);
638 else if (code == ARRAY_TYPE)
639 print_node (file, "domain", TYPE_DOMAIN (node), indent + 4);
640 else if (code == VECTOR_TYPE)
641 fprintf (file, " nunits %d", (int) TYPE_VECTOR_SUBPARTS (node));
642 else if (code == RECORD_TYPE
643 || code == UNION_TYPE
644 || code == QUAL_UNION_TYPE)
645 print_node (file, "fields", TYPE_FIELDS (node), indent + 4);
646 else if (code == FUNCTION_TYPE
647 || code == METHOD_TYPE)
649 if (TYPE_METHOD_BASETYPE (node))
650 print_node_brief (file, "method basetype",
651 TYPE_METHOD_BASETYPE (node), indent + 4);
652 print_node (file, "arg-types", TYPE_ARG_TYPES (node), indent + 4);
654 else if (code == OFFSET_TYPE)
655 print_node_brief (file, "basetype", TYPE_OFFSET_BASETYPE (node),
658 if (TYPE_CONTEXT (node))
659 print_node_brief (file, "context", TYPE_CONTEXT (node), indent + 4);
661 lang_hooks.print_type (file, node, indent);
663 if (TYPE_POINTER_TO (node) || TREE_CHAIN (node))
664 indent_to (file, indent + 3);
666 print_node_brief (file, "pointer_to_this", TYPE_POINTER_TO (node),
668 print_node_brief (file, "reference_to_this", TYPE_REFERENCE_TO (node),
670 print_node_brief (file, "chain", TREE_CHAIN (node), indent + 4);
680 if (code == BIND_EXPR)
682 print_node (file, "vars", TREE_OPERAND (node, 0), indent + 4);
683 print_node (file, "body", TREE_OPERAND (node, 1), indent + 4);
684 print_node (file, "block", TREE_OPERAND (node, 2), indent + 4);
687 if (code == CALL_EXPR)
689 call_expr_arg_iterator iter;
691 print_node (file, "fn", CALL_EXPR_FN (node), indent + 4);
692 print_node (file, "static_chain", CALL_EXPR_STATIC_CHAIN (node),
695 FOR_EACH_CALL_EXPR_ARG (arg, iter, node)
698 sprintf (temp, "arg %d", i);
699 print_node (file, temp, arg, indent + 4);
705 len = TREE_OPERAND_LENGTH (node);
707 for (i = 0; i < len; i++)
711 sprintf (temp, "arg %d", i);
712 print_node (file, temp, TREE_OPERAND (node, i), indent + 4);
715 print_node (file, "chain", TREE_CHAIN (node), indent + 4);
719 case tcc_exceptional:
723 if (TREE_OVERFLOW (node))
724 fprintf (file, " overflow");
727 if (TREE_INT_CST_HIGH (node) == 0)
728 fprintf (file, HOST_WIDE_INT_PRINT_UNSIGNED,
729 TREE_INT_CST_LOW (node));
730 else if (TREE_INT_CST_HIGH (node) == -1
731 && TREE_INT_CST_LOW (node) != 0)
732 fprintf (file, "-" HOST_WIDE_INT_PRINT_UNSIGNED,
733 -TREE_INT_CST_LOW (node));
735 fprintf (file, HOST_WIDE_INT_PRINT_DOUBLE_HEX,
736 (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (node),
737 (unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (node));
744 if (TREE_OVERFLOW (node))
745 fprintf (file, " overflow");
747 d = TREE_REAL_CST (node);
748 if (REAL_VALUE_ISINF (d))
749 fprintf (file, REAL_VALUE_NEGATIVE (d) ? " -Inf" : " Inf");
750 else if (REAL_VALUE_ISNAN (d))
751 fprintf (file, " Nan");
755 real_to_decimal (string, &d, sizeof (string), 0, 1);
756 fprintf (file, " %s", string);
766 if (TREE_OVERFLOW (node))
767 fprintf (file, " overflow");
769 f = TREE_FIXED_CST (node);
770 fixed_to_decimal (string, &f, sizeof (string));
771 fprintf (file, " %s", string);
777 tree vals = TREE_VECTOR_CST_ELTS (node);
783 for (link = vals; link; link = TREE_CHAIN (link), ++i)
785 sprintf (buf, "elt%d: ", i);
786 print_node (file, buf, TREE_VALUE (link), indent + 4);
792 print_node (file, "real", TREE_REALPART (node), indent + 4);
793 print_node (file, "imag", TREE_IMAGPART (node), indent + 4);
798 const char *p = TREE_STRING_POINTER (node);
799 int i = TREE_STRING_LENGTH (node);
804 if (ch >= ' ' && ch < 127)
807 fprintf(file, "\\%03o", ch & 0xFF);
811 /* Print the chain at second level. */
813 print_node (file, "chain", TREE_CHAIN (node), indent + 4);
815 print_node_brief (file, "chain", TREE_CHAIN (node), indent + 4);
818 case IDENTIFIER_NODE:
819 lang_hooks.print_identifier (file, node, indent);
823 print_node (file, "purpose", TREE_PURPOSE (node), indent + 4);
824 print_node (file, "value", TREE_VALUE (node), indent + 4);
825 print_node (file, "chain", TREE_CHAIN (node), indent + 4);
829 len = TREE_VEC_LENGTH (node);
830 for (i = 0; i < len; i++)
831 if (TREE_VEC_ELT (node, i))
834 sprintf (temp, "elt %d", i);
835 indent_to (file, indent + 4);
836 print_node_brief (file, temp, TREE_VEC_ELT (node, i), 0);
842 unsigned HOST_WIDE_INT cnt;
844 len = VEC_length (constructor_elt, CONSTRUCTOR_ELTS (node));
845 fprintf (file, " lngt %d", len);
846 FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (node),
849 print_node (file, "idx", index, indent + 4);
850 print_node (file, "val", value, indent + 4);
856 dump_addr (file, " head ", node->stmt_list.head);
857 dump_addr (file, " tail ", node->stmt_list.tail);
858 fprintf (file, " stmts");
860 tree_stmt_iterator i;
861 for (i = tsi_start (node); !tsi_end_p (i); tsi_next (&i))
863 /* Not printing the addresses of the (not-a-tree)
864 'struct tree_stmt_list_node's. */
865 dump_addr (file, " ", tsi_stmt (i));
867 fprintf (file, "\n");
868 for (i = tsi_start (node); !tsi_end_p (i); tsi_next (&i))
870 /* Not printing the addresses of the (not-a-tree)
871 'struct tree_stmt_list_node's. */
872 print_node (file, "stmt", tsi_stmt (i), indent + 4);
875 print_node (file, "chain", TREE_CHAIN (node), indent + 4);
879 print_node (file, "vars", BLOCK_VARS (node), indent + 4);
880 print_node (file, "supercontext", BLOCK_SUPERCONTEXT (node),
882 print_node (file, "subblocks", BLOCK_SUBBLOCKS (node), indent + 4);
883 print_node (file, "chain", BLOCK_CHAIN (node), indent + 4);
884 print_node (file, "abstract_origin",
885 BLOCK_ABSTRACT_ORIGIN (node), indent + 4);
889 print_node_brief (file, "var", SSA_NAME_VAR (node), indent + 4);
890 fprintf (file, "def_stmt ");
891 print_gimple_stmt (file, SSA_NAME_DEF_STMT (node), indent + 4, 0);
893 indent_to (file, indent + 4);
894 fprintf (file, "version %u", SSA_NAME_VERSION (node));
895 if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (node))
896 fprintf (file, " in-abnormal-phi");
897 if (SSA_NAME_IN_FREE_LIST (node))
898 fprintf (file, " in-free-list");
900 if (SSA_NAME_PTR_INFO (node))
902 indent_to (file, indent + 3);
903 if (SSA_NAME_PTR_INFO (node))
904 dump_addr (file, " ptr-info ", SSA_NAME_PTR_INFO (node));
911 fprintf (file, " %s",
912 omp_clause_code_name[OMP_CLAUSE_CODE (node)]);
913 for (i = 0; i < omp_clause_num_ops[OMP_CLAUSE_CODE (node)]; i++)
915 indent_to (file, indent + 4);
916 fprintf (file, "op %d:", i);
917 print_node_brief (file, "", OMP_CLAUSE_OPERAND (node, i), 0);
922 case OPTIMIZATION_NODE:
923 cl_optimization_print (file, indent + 4, TREE_OPTIMIZATION (node));
926 case TARGET_OPTION_NODE:
927 cl_target_option_print (file, indent + 4, TREE_TARGET_OPTION (node));
930 fprintf (file, " imported declaration");
931 print_node_brief (file, "associated declaration",
932 IMPORTED_DECL_ASSOCIATED_DECL (node),
937 if (EXCEPTIONAL_CLASS_P (node))
938 lang_hooks.print_xnode (file, node, indent);
945 if (EXPR_HAS_LOCATION (node))
947 expanded_location xloc = expand_location (EXPR_LOCATION (node));
948 indent_to (file, indent+4);
949 fprintf (file, "%s:%d:%d", xloc.file, xloc.line, xloc.column);