1 /* Pretty formatting of GENERIC trees in C syntax.
2 Copyright (C) 2001-2018 Free Software Foundation, Inc.
3 Adapted from c-pretty-print.c by Diego Novillo <dnovillo@redhat.com>
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 3, 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 COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
23 #include "coretypes.h"
29 #include "tree-pretty-print.h"
30 #include "stor-layout.h"
31 #include "langhooks.h"
32 #include "tree-iterator.h"
34 #include "internal-fn.h"
35 #include "gomp-constants.h"
38 /* Local functions, macros and variables. */
39 static const char *op_symbol (const_tree
);
40 static void pretty_print_string (pretty_printer
*, const char*, unsigned);
41 static void newline_and_indent (pretty_printer
*, int);
42 static void maybe_init_pretty_print (FILE *);
43 static void print_struct_decl (pretty_printer
*, const_tree
, int, dump_flags_t
);
44 static void do_niy (pretty_printer
*, const_tree
, dump_flags_t
);
46 #define INDENT(SPACE) do { \
47 int i; for (i = 0; i<SPACE; i++) pp_space (pp); } while (0)
49 #define NIY do_niy (pp, node, flags)
51 static pretty_printer
*tree_pp
;
53 /* Try to print something for an unknown tree code. */
56 do_niy (pretty_printer
*pp
, const_tree node
, dump_flags_t flags
)
60 pp_string (pp
, "<<< Unknown tree: ");
61 pp_string (pp
, get_tree_code_name (TREE_CODE (node
)));
65 len
= TREE_OPERAND_LENGTH (node
);
66 for (i
= 0; i
< len
; ++i
)
68 newline_and_indent (pp
, 2);
69 dump_generic_node (pp
, TREE_OPERAND (node
, i
), 2, flags
, false);
73 pp_string (pp
, " >>>");
76 /* Debugging function to print out a generic expression. */
79 debug_generic_expr (tree t
)
81 print_generic_expr (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
);
82 fprintf (stderr
, "\n");
85 /* Debugging function to print out a generic statement. */
88 debug_generic_stmt (tree t
)
90 print_generic_stmt (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
);
91 fprintf (stderr
, "\n");
94 /* Debugging function to print out a chain of trees . */
97 debug_tree_chain (tree t
)
103 print_generic_expr (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
|TDF_UID
);
104 fprintf (stderr
, " ");
108 fprintf (stderr
, "... [cycled back to ");
109 print_generic_expr (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
|TDF_UID
);
110 fprintf (stderr
, "]");
114 fprintf (stderr
, "\n");
117 /* Prints declaration DECL to the FILE with details specified by FLAGS. */
119 print_generic_decl (FILE *file
, tree decl
, dump_flags_t flags
)
121 maybe_init_pretty_print (file
);
122 print_declaration (tree_pp
, decl
, 2, flags
);
123 pp_write_text_to_stream (tree_pp
);
126 /* Print tree T, and its successors, on file FILE. FLAGS specifies details
127 to show in the dump. See TDF_* in dumpfile.h. */
130 print_generic_stmt (FILE *file
, tree t
, dump_flags_t flags
)
132 maybe_init_pretty_print (file
);
133 dump_generic_node (tree_pp
, t
, 0, flags
, true);
134 pp_newline_and_flush (tree_pp
);
137 /* Print tree T, and its successors, on file FILE. FLAGS specifies details
138 to show in the dump. See TDF_* in dumpfile.h. The output is indented by
142 print_generic_stmt_indented (FILE *file
, tree t
, dump_flags_t flags
, int indent
)
146 maybe_init_pretty_print (file
);
148 for (i
= 0; i
< indent
; i
++)
150 dump_generic_node (tree_pp
, t
, indent
, flags
, true);
151 pp_newline_and_flush (tree_pp
);
154 /* Print a single expression T on file FILE. FLAGS specifies details to show
155 in the dump. See TDF_* in dumpfile.h. */
158 print_generic_expr (FILE *file
, tree t
, dump_flags_t flags
)
160 maybe_init_pretty_print (file
);
161 dump_generic_node (tree_pp
, t
, 0, flags
, false);
165 /* Dump NAME, an IDENTIFIER_POINTER, sanitized so that D<num> sequences
166 in it are replaced with Dxxxx, as long as they are at the start or
167 preceded by $ and at the end or followed by $. See make_fancy_name
171 dump_fancy_name (pretty_printer
*pp
, tree name
)
174 int length
= IDENTIFIER_LENGTH (name
);
175 const char *n
= IDENTIFIER_POINTER (name
);
182 && (n
== IDENTIFIER_POINTER (name
) || n
[-1] == '$'))
185 while (ISDIGIT (n
[l
]))
187 if (n
[l
] == '\0' || n
[l
] == '$')
200 pp_tree_identifier (pp
, name
);
204 char *str
= XNEWVEC (char, length
+ 1);
207 q
= n
= IDENTIFIER_POINTER (name
);
214 && (q
== IDENTIFIER_POINTER (name
) || q
[-1] == '$'))
217 while (ISDIGIT (q
[l
]))
219 if (q
[l
] == '\0' || q
[l
] == '$')
221 memcpy (p
, n
, q
- n
);
222 memcpy (p
+ (q
- n
), "Dxxxx", 5);
232 memcpy (p
, n
, IDENTIFIER_LENGTH (name
) - (n
- IDENTIFIER_POINTER (name
)));
234 if (pp_translate_identifiers (pp
))
236 const char *text
= identifier_to_locale (str
);
237 pp_append_text (pp
, text
, text
+ strlen (text
));
240 pp_append_text (pp
, str
, str
+ length
);
244 /* Dump the name of a _DECL node and its DECL_UID if TDF_UID is set
248 dump_decl_name (pretty_printer
*pp
, tree node
, dump_flags_t flags
)
250 tree name
= DECL_NAME (node
);
253 if ((flags
& TDF_ASMNAME
)
254 && HAS_DECL_ASSEMBLER_NAME_P (node
)
255 && DECL_ASSEMBLER_NAME_SET_P (node
))
256 pp_tree_identifier (pp
, DECL_ASSEMBLER_NAME_RAW (node
));
257 /* For -fcompare-debug don't dump DECL_NAMELESS names at all,
258 -g might have created more fancy names and their indexes
259 could get out of sync. Usually those should be DECL_IGNORED_P
260 too, SRA can create even non-DECL_IGNORED_P DECL_NAMELESS fancy
261 names, let's hope those never get out of sync after doing the
262 dump_fancy_name sanitization. */
263 else if ((flags
& TDF_COMPARE_DEBUG
)
264 && DECL_NAMELESS (node
)
265 && DECL_IGNORED_P (node
))
267 /* For DECL_NAMELESS names look for embedded uids in the
268 names and sanitize them for TDF_NOUID. */
269 else if ((flags
& TDF_NOUID
) && DECL_NAMELESS (node
))
270 dump_fancy_name (pp
, name
);
272 pp_tree_identifier (pp
, name
);
274 char uid_sep
= (flags
& TDF_GIMPLE
) ? '_' : '.';
275 if ((flags
& TDF_UID
) || name
== NULL_TREE
)
277 if (TREE_CODE (node
) == LABEL_DECL
&& LABEL_DECL_UID (node
) != -1)
278 pp_printf (pp
, "L%c%d", uid_sep
, (int) LABEL_DECL_UID (node
));
279 else if (TREE_CODE (node
) == DEBUG_EXPR_DECL
)
281 if (flags
& TDF_NOUID
)
282 pp_string (pp
, "D#xxxx");
284 pp_printf (pp
, "D#%i", DEBUG_TEMP_UID (node
));
288 char c
= TREE_CODE (node
) == CONST_DECL
? 'C' : 'D';
289 if (flags
& TDF_NOUID
)
290 pp_printf (pp
, "%c.xxxx", c
);
292 pp_printf (pp
, "%c%c%u", c
, uid_sep
, DECL_UID (node
));
295 if ((flags
& TDF_ALIAS
) && DECL_PT_UID (node
) != DECL_UID (node
))
297 if (flags
& TDF_NOUID
)
298 pp_printf (pp
, "ptD.xxxx");
300 pp_printf (pp
, "ptD.%u", DECL_PT_UID (node
));
304 /* Like the above, but used for pretty printing function calls. */
307 dump_function_name (pretty_printer
*pp
, tree node
, dump_flags_t flags
)
309 if (CONVERT_EXPR_P (node
))
310 node
= TREE_OPERAND (node
, 0);
311 if (DECL_NAME (node
) && (flags
& TDF_ASMNAME
) == 0)
312 pp_string (pp
, lang_hooks
.decl_printable_name (node
, 1));
314 dump_decl_name (pp
, node
, flags
);
317 /* Dump a function declaration. NODE is the FUNCTION_TYPE. PP, SPC and
318 FLAGS are as in dump_generic_node. */
321 dump_function_declaration (pretty_printer
*pp
, tree node
,
322 int spc
, dump_flags_t flags
)
324 bool wrote_arg
= false;
330 /* Print the argument types. */
331 arg
= TYPE_ARG_TYPES (node
);
332 while (arg
&& arg
!= void_list_node
&& arg
!= error_mark_node
)
340 dump_generic_node (pp
, TREE_VALUE (arg
), spc
, flags
, false);
341 arg
= TREE_CHAIN (arg
);
344 /* Drop the trailing void_type_node if we had any previous argument. */
345 if (arg
== void_list_node
&& !wrote_arg
)
346 pp_string (pp
, "void");
347 /* Properly dump vararg function types. */
348 else if (!arg
&& wrote_arg
)
349 pp_string (pp
, ", ...");
350 /* Avoid printing any arg for unprototyped functions. */
355 /* Dump the domain associated with an array. */
358 dump_array_domain (pretty_printer
*pp
, tree domain
, int spc
, dump_flags_t flags
)
360 pp_left_bracket (pp
);
363 tree min
= TYPE_MIN_VALUE (domain
);
364 tree max
= TYPE_MAX_VALUE (domain
);
367 && integer_zerop (min
)
368 && tree_fits_shwi_p (max
))
369 pp_wide_integer (pp
, tree_to_shwi (max
) + 1);
373 dump_generic_node (pp
, min
, spc
, flags
, false);
376 dump_generic_node (pp
, max
, spc
, flags
, false);
380 pp_string (pp
, "<unknown>");
381 pp_right_bracket (pp
);
385 /* Dump OpenMP clause CLAUSE. PP, CLAUSE, SPC and FLAGS are as in
386 dump_generic_node. */
389 dump_omp_clause (pretty_printer
*pp
, tree clause
, int spc
, dump_flags_t flags
)
393 switch (OMP_CLAUSE_CODE (clause
))
395 case OMP_CLAUSE_PRIVATE
:
398 case OMP_CLAUSE_SHARED
:
401 case OMP_CLAUSE_FIRSTPRIVATE
:
402 name
= "firstprivate";
404 case OMP_CLAUSE_LASTPRIVATE
:
405 name
= "lastprivate";
407 case OMP_CLAUSE_COPYIN
:
410 case OMP_CLAUSE_COPYPRIVATE
:
411 name
= "copyprivate";
413 case OMP_CLAUSE_UNIFORM
:
416 case OMP_CLAUSE_USE_DEVICE_PTR
:
417 name
= "use_device_ptr";
419 case OMP_CLAUSE_IS_DEVICE_PTR
:
420 name
= "is_device_ptr";
422 case OMP_CLAUSE__LOOPTEMP_
:
425 case OMP_CLAUSE_TO_DECLARE
:
428 case OMP_CLAUSE_LINK
:
432 pp_string (pp
, name
);
434 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
439 case OMP_CLAUSE_REDUCTION
:
440 pp_string (pp
, "reduction(");
441 if (OMP_CLAUSE_REDUCTION_CODE (clause
) != ERROR_MARK
)
444 op_symbol_code (OMP_CLAUSE_REDUCTION_CODE (clause
)));
447 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
453 pp_string (pp
, "if(");
454 switch (OMP_CLAUSE_IF_MODIFIER (clause
))
456 case ERROR_MARK
: break;
457 case OMP_PARALLEL
: pp_string (pp
, "parallel:"); break;
458 case OMP_TASK
: pp_string (pp
, "task:"); break;
459 case OMP_TASKLOOP
: pp_string (pp
, "taskloop:"); break;
460 case OMP_TARGET_DATA
: pp_string (pp
, "target data:"); break;
461 case OMP_TARGET
: pp_string (pp
, "target:"); break;
462 case OMP_TARGET_UPDATE
: pp_string (pp
, "target update:"); break;
463 case OMP_TARGET_ENTER_DATA
:
464 pp_string (pp
, "target enter data:"); break;
465 case OMP_TARGET_EXIT_DATA
: pp_string (pp
, "target exit data:"); break;
466 default: gcc_unreachable ();
468 dump_generic_node (pp
, OMP_CLAUSE_IF_EXPR (clause
),
473 case OMP_CLAUSE_NUM_THREADS
:
474 pp_string (pp
, "num_threads(");
475 dump_generic_node (pp
, OMP_CLAUSE_NUM_THREADS_EXPR (clause
),
480 case OMP_CLAUSE_NOWAIT
:
481 pp_string (pp
, "nowait");
483 case OMP_CLAUSE_ORDERED
:
484 pp_string (pp
, "ordered");
485 if (OMP_CLAUSE_ORDERED_EXPR (clause
))
488 dump_generic_node (pp
, OMP_CLAUSE_ORDERED_EXPR (clause
),
494 case OMP_CLAUSE_DEFAULT
:
495 pp_string (pp
, "default(");
496 switch (OMP_CLAUSE_DEFAULT_KIND (clause
))
498 case OMP_CLAUSE_DEFAULT_UNSPECIFIED
:
500 case OMP_CLAUSE_DEFAULT_SHARED
:
501 pp_string (pp
, "shared");
503 case OMP_CLAUSE_DEFAULT_NONE
:
504 pp_string (pp
, "none");
506 case OMP_CLAUSE_DEFAULT_PRIVATE
:
507 pp_string (pp
, "private");
509 case OMP_CLAUSE_DEFAULT_FIRSTPRIVATE
:
510 pp_string (pp
, "firstprivate");
512 case OMP_CLAUSE_DEFAULT_PRESENT
:
513 pp_string (pp
, "present");
521 case OMP_CLAUSE_SCHEDULE
:
522 pp_string (pp
, "schedule(");
523 if (OMP_CLAUSE_SCHEDULE_KIND (clause
)
524 & (OMP_CLAUSE_SCHEDULE_MONOTONIC
525 | OMP_CLAUSE_SCHEDULE_NONMONOTONIC
))
527 if (OMP_CLAUSE_SCHEDULE_KIND (clause
)
528 & OMP_CLAUSE_SCHEDULE_MONOTONIC
)
529 pp_string (pp
, "monotonic");
531 pp_string (pp
, "nonmonotonic");
532 if (OMP_CLAUSE_SCHEDULE_SIMD (clause
))
537 if (OMP_CLAUSE_SCHEDULE_SIMD (clause
))
538 pp_string (pp
, "simd:");
540 switch (OMP_CLAUSE_SCHEDULE_KIND (clause
) & OMP_CLAUSE_SCHEDULE_MASK
)
542 case OMP_CLAUSE_SCHEDULE_STATIC
:
543 pp_string (pp
, "static");
545 case OMP_CLAUSE_SCHEDULE_DYNAMIC
:
546 pp_string (pp
, "dynamic");
548 case OMP_CLAUSE_SCHEDULE_GUIDED
:
549 pp_string (pp
, "guided");
551 case OMP_CLAUSE_SCHEDULE_RUNTIME
:
552 pp_string (pp
, "runtime");
554 case OMP_CLAUSE_SCHEDULE_AUTO
:
555 pp_string (pp
, "auto");
560 if (OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (clause
))
563 dump_generic_node (pp
, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (clause
),
569 case OMP_CLAUSE_UNTIED
:
570 pp_string (pp
, "untied");
573 case OMP_CLAUSE_COLLAPSE
:
574 pp_string (pp
, "collapse(");
575 dump_generic_node (pp
, OMP_CLAUSE_COLLAPSE_EXPR (clause
),
580 case OMP_CLAUSE_FINAL
:
581 pp_string (pp
, "final(");
582 dump_generic_node (pp
, OMP_CLAUSE_FINAL_EXPR (clause
),
587 case OMP_CLAUSE_MERGEABLE
:
588 pp_string (pp
, "mergeable");
591 case OMP_CLAUSE_LINEAR
:
592 pp_string (pp
, "linear(");
593 switch (OMP_CLAUSE_LINEAR_KIND (clause
))
595 case OMP_CLAUSE_LINEAR_DEFAULT
:
597 case OMP_CLAUSE_LINEAR_REF
:
598 pp_string (pp
, "ref(");
600 case OMP_CLAUSE_LINEAR_VAL
:
601 pp_string (pp
, "val(");
603 case OMP_CLAUSE_LINEAR_UVAL
:
604 pp_string (pp
, "uval(");
609 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
611 if (OMP_CLAUSE_LINEAR_KIND (clause
) != OMP_CLAUSE_LINEAR_DEFAULT
)
614 dump_generic_node (pp
, OMP_CLAUSE_LINEAR_STEP (clause
),
619 case OMP_CLAUSE_ALIGNED
:
620 pp_string (pp
, "aligned(");
621 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
623 if (OMP_CLAUSE_ALIGNED_ALIGNMENT (clause
))
626 dump_generic_node (pp
, OMP_CLAUSE_ALIGNED_ALIGNMENT (clause
),
632 case OMP_CLAUSE_DEPEND
:
633 pp_string (pp
, "depend(");
634 switch (OMP_CLAUSE_DEPEND_KIND (clause
))
636 case OMP_CLAUSE_DEPEND_IN
:
637 pp_string (pp
, "in");
639 case OMP_CLAUSE_DEPEND_OUT
:
640 pp_string (pp
, "out");
642 case OMP_CLAUSE_DEPEND_INOUT
:
643 pp_string (pp
, "inout");
645 case OMP_CLAUSE_DEPEND_SOURCE
:
646 pp_string (pp
, "source)");
648 case OMP_CLAUSE_DEPEND_SINK
:
649 pp_string (pp
, "sink:");
650 for (tree t
= OMP_CLAUSE_DECL (clause
); t
; t
= TREE_CHAIN (t
))
651 if (TREE_CODE (t
) == TREE_LIST
)
653 dump_generic_node (pp
, TREE_VALUE (t
), spc
, flags
, false);
654 if (TREE_PURPOSE (t
) != integer_zero_node
)
656 if (OMP_CLAUSE_DEPEND_SINK_NEGATIVE (t
))
660 dump_generic_node (pp
, TREE_PURPOSE (t
), spc
, flags
,
674 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
680 pp_string (pp
, "map(");
681 switch (OMP_CLAUSE_MAP_KIND (clause
))
684 case GOMP_MAP_POINTER
:
685 pp_string (pp
, "alloc");
688 case GOMP_MAP_TO_PSET
:
689 pp_string (pp
, "to");
692 pp_string (pp
, "from");
694 case GOMP_MAP_TOFROM
:
695 pp_string (pp
, "tofrom");
697 case GOMP_MAP_FORCE_ALLOC
:
698 pp_string (pp
, "force_alloc");
700 case GOMP_MAP_FORCE_TO
:
701 pp_string (pp
, "force_to");
703 case GOMP_MAP_FORCE_FROM
:
704 pp_string (pp
, "force_from");
706 case GOMP_MAP_FORCE_TOFROM
:
707 pp_string (pp
, "force_tofrom");
709 case GOMP_MAP_FORCE_PRESENT
:
710 pp_string (pp
, "force_present");
712 case GOMP_MAP_DELETE
:
713 pp_string (pp
, "delete");
715 case GOMP_MAP_FORCE_DEVICEPTR
:
716 pp_string (pp
, "force_deviceptr");
718 case GOMP_MAP_ALWAYS_TO
:
719 pp_string (pp
, "always,to");
721 case GOMP_MAP_ALWAYS_FROM
:
722 pp_string (pp
, "always,from");
724 case GOMP_MAP_ALWAYS_TOFROM
:
725 pp_string (pp
, "always,tofrom");
727 case GOMP_MAP_RELEASE
:
728 pp_string (pp
, "release");
730 case GOMP_MAP_FIRSTPRIVATE_POINTER
:
731 pp_string (pp
, "firstprivate");
733 case GOMP_MAP_FIRSTPRIVATE_REFERENCE
:
734 pp_string (pp
, "firstprivate ref");
736 case GOMP_MAP_STRUCT
:
737 pp_string (pp
, "struct");
739 case GOMP_MAP_ALWAYS_POINTER
:
740 pp_string (pp
, "always_pointer");
742 case GOMP_MAP_DEVICE_RESIDENT
:
743 pp_string (pp
, "device_resident");
746 pp_string (pp
, "link");
752 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
755 if (OMP_CLAUSE_SIZE (clause
))
757 switch (OMP_CLAUSE_CODE (clause
) == OMP_CLAUSE_MAP
758 ? OMP_CLAUSE_MAP_KIND (clause
) : GOMP_MAP_TO
)
760 case GOMP_MAP_POINTER
:
761 case GOMP_MAP_FIRSTPRIVATE_POINTER
:
762 case GOMP_MAP_FIRSTPRIVATE_REFERENCE
:
763 case GOMP_MAP_ALWAYS_POINTER
:
764 pp_string (pp
, " [pointer assign, bias: ");
766 case GOMP_MAP_TO_PSET
:
767 pp_string (pp
, " [pointer set, len: ");
770 pp_string (pp
, " [len: ");
773 dump_generic_node (pp
, OMP_CLAUSE_SIZE (clause
),
775 pp_right_bracket (pp
);
780 case OMP_CLAUSE_FROM
:
781 pp_string (pp
, "from(");
782 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
784 goto print_clause_size
;
787 pp_string (pp
, "to(");
788 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
790 goto print_clause_size
;
792 case OMP_CLAUSE__CACHE_
:
794 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
796 goto print_clause_size
;
798 case OMP_CLAUSE_NUM_TEAMS
:
799 pp_string (pp
, "num_teams(");
800 dump_generic_node (pp
, OMP_CLAUSE_NUM_TEAMS_EXPR (clause
),
805 case OMP_CLAUSE_THREAD_LIMIT
:
806 pp_string (pp
, "thread_limit(");
807 dump_generic_node (pp
, OMP_CLAUSE_THREAD_LIMIT_EXPR (clause
),
812 case OMP_CLAUSE_DEVICE
:
813 pp_string (pp
, "device(");
814 dump_generic_node (pp
, OMP_CLAUSE_DEVICE_ID (clause
),
819 case OMP_CLAUSE_DIST_SCHEDULE
:
820 pp_string (pp
, "dist_schedule(static");
821 if (OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR (clause
))
824 dump_generic_node (pp
,
825 OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR (clause
),
831 case OMP_CLAUSE_PROC_BIND
:
832 pp_string (pp
, "proc_bind(");
833 switch (OMP_CLAUSE_PROC_BIND_KIND (clause
))
835 case OMP_CLAUSE_PROC_BIND_MASTER
:
836 pp_string (pp
, "master");
838 case OMP_CLAUSE_PROC_BIND_CLOSE
:
839 pp_string (pp
, "close");
841 case OMP_CLAUSE_PROC_BIND_SPREAD
:
842 pp_string (pp
, "spread");
850 case OMP_CLAUSE_SAFELEN
:
851 pp_string (pp
, "safelen(");
852 dump_generic_node (pp
, OMP_CLAUSE_SAFELEN_EXPR (clause
),
857 case OMP_CLAUSE_SIMDLEN
:
858 pp_string (pp
, "simdlen(");
859 dump_generic_node (pp
, OMP_CLAUSE_SIMDLEN_EXPR (clause
),
864 case OMP_CLAUSE_PRIORITY
:
865 pp_string (pp
, "priority(");
866 dump_generic_node (pp
, OMP_CLAUSE_PRIORITY_EXPR (clause
),
871 case OMP_CLAUSE_GRAINSIZE
:
872 pp_string (pp
, "grainsize(");
873 dump_generic_node (pp
, OMP_CLAUSE_GRAINSIZE_EXPR (clause
),
878 case OMP_CLAUSE_NUM_TASKS
:
879 pp_string (pp
, "num_tasks(");
880 dump_generic_node (pp
, OMP_CLAUSE_NUM_TASKS_EXPR (clause
),
885 case OMP_CLAUSE_HINT
:
886 pp_string (pp
, "hint(");
887 dump_generic_node (pp
, OMP_CLAUSE_HINT_EXPR (clause
),
892 case OMP_CLAUSE_DEFAULTMAP
:
893 pp_string (pp
, "defaultmap(tofrom:scalar)");
896 case OMP_CLAUSE__SIMDUID_
:
897 pp_string (pp
, "_simduid_(");
898 dump_generic_node (pp
, OMP_CLAUSE__SIMDUID__DECL (clause
),
903 case OMP_CLAUSE__SIMT_
:
904 pp_string (pp
, "_simt_");
907 case OMP_CLAUSE_GANG
:
908 pp_string (pp
, "gang");
909 if (OMP_CLAUSE_GANG_EXPR (clause
) != NULL_TREE
)
911 pp_string (pp
, "(num: ");
912 dump_generic_node (pp
, OMP_CLAUSE_GANG_EXPR (clause
),
915 if (OMP_CLAUSE_GANG_STATIC_EXPR (clause
) != NULL_TREE
)
917 if (OMP_CLAUSE_GANG_EXPR (clause
) == NULL_TREE
)
921 pp_string (pp
, "static:");
922 if (OMP_CLAUSE_GANG_STATIC_EXPR (clause
)
923 == integer_minus_one_node
)
924 pp_character (pp
, '*');
926 dump_generic_node (pp
, OMP_CLAUSE_GANG_STATIC_EXPR (clause
),
929 if (OMP_CLAUSE_GANG_EXPR (clause
) != NULL_TREE
930 || OMP_CLAUSE_GANG_STATIC_EXPR (clause
) != NULL_TREE
)
934 case OMP_CLAUSE_ASYNC
:
935 pp_string (pp
, "async");
936 if (OMP_CLAUSE_ASYNC_EXPR (clause
))
938 pp_character(pp
, '(');
939 dump_generic_node (pp
, OMP_CLAUSE_ASYNC_EXPR (clause
),
941 pp_character(pp
, ')');
945 case OMP_CLAUSE_AUTO
:
947 pp_string (pp
, omp_clause_code_name
[OMP_CLAUSE_CODE (clause
)]);
950 case OMP_CLAUSE_WAIT
:
951 pp_string (pp
, "wait(");
952 dump_generic_node (pp
, OMP_CLAUSE_WAIT_EXPR (clause
),
954 pp_character(pp
, ')');
957 case OMP_CLAUSE_WORKER
:
958 pp_string (pp
, "worker");
959 if (OMP_CLAUSE_WORKER_EXPR (clause
) != NULL_TREE
)
962 dump_generic_node (pp
, OMP_CLAUSE_WORKER_EXPR (clause
),
968 case OMP_CLAUSE_VECTOR
:
969 pp_string (pp
, "vector");
970 if (OMP_CLAUSE_VECTOR_EXPR (clause
) != NULL_TREE
)
973 dump_generic_node (pp
, OMP_CLAUSE_VECTOR_EXPR (clause
),
979 case OMP_CLAUSE_NUM_GANGS
:
980 pp_string (pp
, "num_gangs(");
981 dump_generic_node (pp
, OMP_CLAUSE_NUM_GANGS_EXPR (clause
),
983 pp_character (pp
, ')');
986 case OMP_CLAUSE_NUM_WORKERS
:
987 pp_string (pp
, "num_workers(");
988 dump_generic_node (pp
, OMP_CLAUSE_NUM_WORKERS_EXPR (clause
),
990 pp_character (pp
, ')');
993 case OMP_CLAUSE_VECTOR_LENGTH
:
994 pp_string (pp
, "vector_length(");
995 dump_generic_node (pp
, OMP_CLAUSE_VECTOR_LENGTH_EXPR (clause
),
997 pp_character (pp
, ')');
1000 case OMP_CLAUSE_INBRANCH
:
1001 pp_string (pp
, "inbranch");
1003 case OMP_CLAUSE_NOTINBRANCH
:
1004 pp_string (pp
, "notinbranch");
1006 case OMP_CLAUSE_FOR
:
1007 pp_string (pp
, "for");
1009 case OMP_CLAUSE_PARALLEL
:
1010 pp_string (pp
, "parallel");
1012 case OMP_CLAUSE_SECTIONS
:
1013 pp_string (pp
, "sections");
1015 case OMP_CLAUSE_TASKGROUP
:
1016 pp_string (pp
, "taskgroup");
1018 case OMP_CLAUSE_NOGROUP
:
1019 pp_string (pp
, "nogroup");
1021 case OMP_CLAUSE_THREADS
:
1022 pp_string (pp
, "threads");
1024 case OMP_CLAUSE_SIMD
:
1025 pp_string (pp
, "simd");
1027 case OMP_CLAUSE_INDEPENDENT
:
1028 pp_string (pp
, "independent");
1030 case OMP_CLAUSE_TILE
:
1031 pp_string (pp
, "tile(");
1032 dump_generic_node (pp
, OMP_CLAUSE_TILE_LIST (clause
),
1034 pp_right_paren (pp
);
1037 case OMP_CLAUSE__GRIDDIM_
:
1038 pp_string (pp
, "_griddim_(");
1039 pp_unsigned_wide_integer (pp
, OMP_CLAUSE__GRIDDIM__DIMENSION (clause
));
1041 dump_generic_node (pp
, OMP_CLAUSE__GRIDDIM__SIZE (clause
), spc
, flags
,
1044 dump_generic_node (pp
, OMP_CLAUSE__GRIDDIM__GROUP (clause
), spc
, flags
,
1046 pp_right_paren (pp
);
1048 case OMP_CLAUSE_IF_PRESENT
:
1049 pp_string (pp
, "if_present");
1051 case OMP_CLAUSE_FINALIZE
:
1052 pp_string (pp
, "finalize");
1056 /* Should never happen. */
1057 dump_generic_node (pp
, clause
, spc
, flags
, false);
1063 /* Dump the list of OpenMP clauses. PP, SPC and FLAGS are as in
1064 dump_generic_node. */
1067 dump_omp_clauses (pretty_printer
*pp
, tree clause
, int spc
, dump_flags_t flags
)
1075 dump_omp_clause (pp
, clause
, spc
, flags
);
1076 clause
= OMP_CLAUSE_CHAIN (clause
);
1084 /* Dump location LOC to PP. */
1087 dump_location (pretty_printer
*pp
, location_t loc
)
1089 expanded_location xloc
= expand_location (loc
);
1091 pp_left_bracket (pp
);
1094 pp_string (pp
, xloc
.file
);
1095 pp_string (pp
, ":");
1097 pp_decimal_int (pp
, xloc
.line
);
1099 pp_decimal_int (pp
, xloc
.column
);
1100 pp_string (pp
, "] ");
1104 /* Dump lexical block BLOCK. PP, SPC and FLAGS are as in
1105 dump_generic_node. */
1108 dump_block_node (pretty_printer
*pp
, tree block
, int spc
, dump_flags_t flags
)
1112 pp_printf (pp
, "BLOCK #%d ", BLOCK_NUMBER (block
));
1114 if (flags
& TDF_ADDRESS
)
1115 pp_printf (pp
, "[%p] ", (void *) block
);
1117 if (BLOCK_ABSTRACT (block
))
1118 pp_string (pp
, "[abstract] ");
1120 if (TREE_ASM_WRITTEN (block
))
1121 pp_string (pp
, "[written] ");
1123 if (flags
& TDF_SLIM
)
1126 if (BLOCK_SOURCE_LOCATION (block
))
1127 dump_location (pp
, BLOCK_SOURCE_LOCATION (block
));
1129 newline_and_indent (pp
, spc
+ 2);
1131 if (BLOCK_SUPERCONTEXT (block
))
1133 pp_string (pp
, "SUPERCONTEXT: ");
1134 dump_generic_node (pp
, BLOCK_SUPERCONTEXT (block
), 0,
1135 flags
| TDF_SLIM
, false);
1136 newline_and_indent (pp
, spc
+ 2);
1139 if (BLOCK_SUBBLOCKS (block
))
1141 pp_string (pp
, "SUBBLOCKS: ");
1142 for (t
= BLOCK_SUBBLOCKS (block
); t
; t
= BLOCK_CHAIN (t
))
1144 dump_generic_node (pp
, t
, 0, flags
| TDF_SLIM
, false);
1147 newline_and_indent (pp
, spc
+ 2);
1150 if (BLOCK_CHAIN (block
))
1152 pp_string (pp
, "SIBLINGS: ");
1153 for (t
= BLOCK_CHAIN (block
); t
; t
= BLOCK_CHAIN (t
))
1155 dump_generic_node (pp
, t
, 0, flags
| TDF_SLIM
, false);
1158 newline_and_indent (pp
, spc
+ 2);
1161 if (BLOCK_VARS (block
))
1163 pp_string (pp
, "VARS: ");
1164 for (t
= BLOCK_VARS (block
); t
; t
= TREE_CHAIN (t
))
1166 dump_generic_node (pp
, t
, 0, flags
, false);
1169 newline_and_indent (pp
, spc
+ 2);
1172 if (vec_safe_length (BLOCK_NONLOCALIZED_VARS (block
)) > 0)
1175 vec
<tree
, va_gc
> *nlv
= BLOCK_NONLOCALIZED_VARS (block
);
1177 pp_string (pp
, "NONLOCALIZED_VARS: ");
1178 FOR_EACH_VEC_ELT (*nlv
, i
, t
)
1180 dump_generic_node (pp
, t
, 0, flags
, false);
1183 newline_and_indent (pp
, spc
+ 2);
1186 if (BLOCK_ABSTRACT_ORIGIN (block
))
1188 pp_string (pp
, "ABSTRACT_ORIGIN: ");
1189 dump_generic_node (pp
, BLOCK_ABSTRACT_ORIGIN (block
), 0,
1190 flags
| TDF_SLIM
, false);
1191 newline_and_indent (pp
, spc
+ 2);
1194 if (BLOCK_FRAGMENT_ORIGIN (block
))
1196 pp_string (pp
, "FRAGMENT_ORIGIN: ");
1197 dump_generic_node (pp
, BLOCK_FRAGMENT_ORIGIN (block
), 0,
1198 flags
| TDF_SLIM
, false);
1199 newline_and_indent (pp
, spc
+ 2);
1202 if (BLOCK_FRAGMENT_CHAIN (block
))
1204 pp_string (pp
, "FRAGMENT_CHAIN: ");
1205 for (t
= BLOCK_FRAGMENT_CHAIN (block
); t
; t
= BLOCK_FRAGMENT_CHAIN (t
))
1207 dump_generic_node (pp
, t
, 0, flags
| TDF_SLIM
, false);
1210 newline_and_indent (pp
, spc
+ 2);
1215 /* Dump the node NODE on the pretty_printer PP, SPC spaces of
1216 indent. FLAGS specifies details to show in the dump (see TDF_* in
1217 dumpfile.h). If IS_STMT is true, the object printed is considered
1218 to be a statement and it is terminated by ';' if appropriate. */
1221 dump_generic_node (pretty_printer
*pp
, tree node
, int spc
, dump_flags_t flags
,
1228 enum tree_code code
;
1230 if (node
== NULL_TREE
)
1233 is_expr
= EXPR_P (node
);
1235 if (is_stmt
&& (flags
& TDF_STMTADDR
))
1236 pp_printf (pp
, "<&%p> ", (void *)node
);
1238 if ((flags
& TDF_LINENO
) && EXPR_HAS_LOCATION (node
))
1239 dump_location (pp
, EXPR_LOCATION (node
));
1241 code
= TREE_CODE (node
);
1245 pp_string (pp
, "<<< error >>>");
1248 case IDENTIFIER_NODE
:
1249 pp_tree_identifier (pp
, node
);
1253 while (node
&& node
!= error_mark_node
)
1255 if (TREE_PURPOSE (node
))
1257 dump_generic_node (pp
, TREE_PURPOSE (node
), spc
, flags
, false);
1260 dump_generic_node (pp
, TREE_VALUE (node
), spc
, flags
, false);
1261 node
= TREE_CHAIN (node
);
1262 if (node
&& TREE_CODE (node
) == TREE_LIST
)
1271 dump_generic_node (pp
, BINFO_TYPE (node
), spc
, flags
, false);
1277 if (TREE_VEC_LENGTH (node
) > 0)
1279 size_t len
= TREE_VEC_LENGTH (node
);
1280 for (i
= 0; i
< len
- 1; i
++)
1282 dump_generic_node (pp
, TREE_VEC_ELT (node
, i
), spc
, flags
,
1287 dump_generic_node (pp
, TREE_VEC_ELT (node
, len
- 1), spc
,
1296 case FIXED_POINT_TYPE
:
1302 unsigned int quals
= TYPE_QUALS (node
);
1303 enum tree_code_class tclass
;
1305 if (quals
& TYPE_QUAL_ATOMIC
)
1306 pp_string (pp
, "atomic ");
1307 if (quals
& TYPE_QUAL_CONST
)
1308 pp_string (pp
, "const ");
1309 else if (quals
& TYPE_QUAL_VOLATILE
)
1310 pp_string (pp
, "volatile ");
1311 else if (quals
& TYPE_QUAL_RESTRICT
)
1312 pp_string (pp
, "restrict ");
1314 if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node
)))
1316 pp_string (pp
, "<address-space-");
1317 pp_decimal_int (pp
, TYPE_ADDR_SPACE (node
));
1318 pp_string (pp
, "> ");
1321 tclass
= TREE_CODE_CLASS (TREE_CODE (node
));
1323 if (tclass
== tcc_declaration
)
1325 if (DECL_NAME (node
))
1326 dump_decl_name (pp
, node
, flags
);
1328 pp_string (pp
, "<unnamed type decl>");
1330 else if (tclass
== tcc_type
)
1332 if (TYPE_NAME (node
))
1334 if (TREE_CODE (TYPE_NAME (node
)) == IDENTIFIER_NODE
)
1335 pp_tree_identifier (pp
, TYPE_NAME (node
));
1336 else if (TREE_CODE (TYPE_NAME (node
)) == TYPE_DECL
1337 && DECL_NAME (TYPE_NAME (node
)))
1338 dump_decl_name (pp
, TYPE_NAME (node
), flags
);
1340 pp_string (pp
, "<unnamed type>");
1342 else if (TREE_CODE (node
) == VECTOR_TYPE
)
1344 pp_string (pp
, "vector");
1346 pp_wide_integer (pp
, TYPE_VECTOR_SUBPARTS (node
));
1347 pp_string (pp
, ") ");
1348 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1350 else if (TREE_CODE (node
) == INTEGER_TYPE
)
1352 if (TYPE_PRECISION (node
) == CHAR_TYPE_SIZE
)
1353 pp_string (pp
, (TYPE_UNSIGNED (node
)
1356 else if (TYPE_PRECISION (node
) == SHORT_TYPE_SIZE
)
1357 pp_string (pp
, (TYPE_UNSIGNED (node
)
1360 else if (TYPE_PRECISION (node
) == INT_TYPE_SIZE
)
1361 pp_string (pp
, (TYPE_UNSIGNED (node
)
1364 else if (TYPE_PRECISION (node
) == LONG_TYPE_SIZE
)
1365 pp_string (pp
, (TYPE_UNSIGNED (node
)
1368 else if (TYPE_PRECISION (node
) == LONG_LONG_TYPE_SIZE
)
1369 pp_string (pp
, (TYPE_UNSIGNED (node
)
1370 ? "unsigned long long"
1371 : "signed long long"));
1372 else if (TYPE_PRECISION (node
) >= CHAR_TYPE_SIZE
1373 && pow2p_hwi (TYPE_PRECISION (node
)))
1375 pp_string (pp
, (TYPE_UNSIGNED (node
) ? "uint" : "int"));
1376 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1377 pp_string (pp
, "_t");
1381 pp_string (pp
, (TYPE_UNSIGNED (node
)
1382 ? "<unnamed-unsigned:"
1383 : "<unnamed-signed:"));
1384 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1388 else if (TREE_CODE (node
) == COMPLEX_TYPE
)
1390 pp_string (pp
, "__complex__ ");
1391 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1393 else if (TREE_CODE (node
) == REAL_TYPE
)
1395 pp_string (pp
, "<float:");
1396 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1399 else if (TREE_CODE (node
) == FIXED_POINT_TYPE
)
1401 pp_string (pp
, "<fixed-point-");
1402 pp_string (pp
, TYPE_SATURATING (node
) ? "sat:" : "nonsat:");
1403 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1406 else if (TREE_CODE (node
) == VOID_TYPE
)
1407 pp_string (pp
, "void");
1409 pp_string (pp
, "<unnamed type>");
1415 case REFERENCE_TYPE
:
1416 str
= (TREE_CODE (node
) == POINTER_TYPE
? "*" : "&");
1418 if (TREE_TYPE (node
) == NULL
)
1420 pp_string (pp
, str
);
1421 pp_string (pp
, "<null type>");
1423 else if (TREE_CODE (TREE_TYPE (node
)) == FUNCTION_TYPE
)
1425 tree fnode
= TREE_TYPE (node
);
1427 dump_generic_node (pp
, TREE_TYPE (fnode
), spc
, flags
, false);
1430 pp_string (pp
, str
);
1431 if (TYPE_IDENTIFIER (node
))
1432 dump_generic_node (pp
, TYPE_NAME (node
), spc
, flags
, false);
1433 else if (flags
& TDF_NOUID
)
1434 pp_printf (pp
, "<Txxxx>");
1436 pp_printf (pp
, "<T%x>", TYPE_UID (node
));
1438 pp_right_paren (pp
);
1439 dump_function_declaration (pp
, fnode
, spc
, flags
);
1443 unsigned int quals
= TYPE_QUALS (node
);
1445 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1447 pp_string (pp
, str
);
1449 if (quals
& TYPE_QUAL_CONST
)
1450 pp_string (pp
, " const");
1451 if (quals
& TYPE_QUAL_VOLATILE
)
1452 pp_string (pp
, " volatile");
1453 if (quals
& TYPE_QUAL_RESTRICT
)
1454 pp_string (pp
, " restrict");
1456 if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node
)))
1458 pp_string (pp
, " <address-space-");
1459 pp_decimal_int (pp
, TYPE_ADDR_SPACE (node
));
1463 if (TYPE_REF_CAN_ALIAS_ALL (node
))
1464 pp_string (pp
, " {ref-all}");
1474 if (flags
& TDF_GIMPLE
)
1476 pp_string (pp
, "__MEM <");
1477 dump_generic_node (pp
, TREE_TYPE (node
),
1478 spc
, flags
| TDF_SLIM
, false);
1479 if (TYPE_ALIGN (TREE_TYPE (node
))
1480 != TYPE_ALIGN (TYPE_MAIN_VARIANT (TREE_TYPE (node
))))
1482 pp_string (pp
, ", ");
1483 pp_decimal_int (pp
, TYPE_ALIGN (TREE_TYPE (node
)));
1486 pp_string (pp
, " (");
1487 if (TREE_TYPE (TREE_OPERAND (node
, 0))
1488 != TREE_TYPE (TREE_OPERAND (node
, 1)))
1491 dump_generic_node (pp
, TREE_TYPE (TREE_OPERAND (node
, 1)),
1492 spc
, flags
| TDF_SLIM
, false);
1493 pp_right_paren (pp
);
1495 dump_generic_node (pp
, TREE_OPERAND (node
, 0),
1496 spc
, flags
| TDF_SLIM
, false);
1497 if (! integer_zerop (TREE_OPERAND (node
, 1)))
1499 pp_string (pp
, " + ");
1500 dump_generic_node (pp
, TREE_OPERAND (node
, 1),
1501 spc
, flags
| TDF_SLIM
, false);
1503 pp_right_paren (pp
);
1505 else if (integer_zerop (TREE_OPERAND (node
, 1))
1506 /* Dump the types of INTEGER_CSTs explicitly, for we can't
1507 infer them and MEM_ATTR caching will share MEM_REFs
1508 with differently-typed op0s. */
1509 && TREE_CODE (TREE_OPERAND (node
, 0)) != INTEGER_CST
1510 /* Released SSA_NAMES have no TREE_TYPE. */
1511 && TREE_TYPE (TREE_OPERAND (node
, 0)) != NULL_TREE
1512 /* Same pointer types, but ignoring POINTER_TYPE vs.
1514 && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node
, 0)))
1515 == TREE_TYPE (TREE_TYPE (TREE_OPERAND (node
, 1))))
1516 && (TYPE_MODE (TREE_TYPE (TREE_OPERAND (node
, 0)))
1517 == TYPE_MODE (TREE_TYPE (TREE_OPERAND (node
, 1))))
1518 && (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node
, 0)))
1519 == TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node
, 1))))
1520 /* Same value types ignoring qualifiers. */
1521 && (TYPE_MAIN_VARIANT (TREE_TYPE (node
))
1522 == TYPE_MAIN_VARIANT
1523 (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node
, 1)))))
1524 && (!(flags
& TDF_ALIAS
)
1525 || MR_DEPENDENCE_CLIQUE (node
) == 0))
1527 if (TREE_CODE (TREE_OPERAND (node
, 0)) != ADDR_EXPR
)
1530 dump_generic_node (pp
, TREE_OPERAND (node
, 0),
1534 dump_generic_node (pp
,
1535 TREE_OPERAND (TREE_OPERAND (node
, 0), 0),
1542 pp_string (pp
, "MEM[");
1544 ptype
= TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (node
, 1)));
1545 dump_generic_node (pp
, ptype
,
1546 spc
, flags
| TDF_SLIM
, false);
1547 pp_right_paren (pp
);
1548 dump_generic_node (pp
, TREE_OPERAND (node
, 0),
1550 if (!integer_zerop (TREE_OPERAND (node
, 1)))
1552 pp_string (pp
, " + ");
1553 dump_generic_node (pp
, TREE_OPERAND (node
, 1),
1556 if ((flags
& TDF_ALIAS
)
1557 && MR_DEPENDENCE_CLIQUE (node
) != 0)
1559 pp_string (pp
, " clique ");
1560 pp_unsigned_wide_integer (pp
, MR_DEPENDENCE_CLIQUE (node
));
1561 pp_string (pp
, " base ");
1562 pp_unsigned_wide_integer (pp
, MR_DEPENDENCE_BASE (node
));
1564 pp_right_bracket (pp
);
1569 case TARGET_MEM_REF
:
1571 const char *sep
= "";
1574 pp_string (pp
, "MEM[");
1576 if (TREE_CODE (TMR_BASE (node
)) == ADDR_EXPR
)
1578 pp_string (pp
, sep
);
1580 pp_string (pp
, "symbol: ");
1581 dump_generic_node (pp
, TREE_OPERAND (TMR_BASE (node
), 0),
1586 pp_string (pp
, sep
);
1588 pp_string (pp
, "base: ");
1589 dump_generic_node (pp
, TMR_BASE (node
), spc
, flags
, false);
1591 tmp
= TMR_INDEX2 (node
);
1594 pp_string (pp
, sep
);
1596 pp_string (pp
, "base: ");
1597 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1599 tmp
= TMR_INDEX (node
);
1602 pp_string (pp
, sep
);
1604 pp_string (pp
, "index: ");
1605 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1607 tmp
= TMR_STEP (node
);
1610 pp_string (pp
, sep
);
1612 pp_string (pp
, "step: ");
1613 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1615 tmp
= TMR_OFFSET (node
);
1618 pp_string (pp
, sep
);
1620 pp_string (pp
, "offset: ");
1621 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1623 pp_right_bracket (pp
);
1631 /* Print the innermost component type. */
1632 for (tmp
= TREE_TYPE (node
); TREE_CODE (tmp
) == ARRAY_TYPE
;
1633 tmp
= TREE_TYPE (tmp
))
1635 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1637 /* Print the dimensions. */
1638 for (tmp
= node
; TREE_CODE (tmp
) == ARRAY_TYPE
; tmp
= TREE_TYPE (tmp
))
1639 dump_array_domain (pp
, TYPE_DOMAIN (tmp
), spc
, flags
);
1645 case QUAL_UNION_TYPE
:
1647 unsigned int quals
= TYPE_QUALS (node
);
1649 if (quals
& TYPE_QUAL_ATOMIC
)
1650 pp_string (pp
, "atomic ");
1651 if (quals
& TYPE_QUAL_CONST
)
1652 pp_string (pp
, "const ");
1653 if (quals
& TYPE_QUAL_VOLATILE
)
1654 pp_string (pp
, "volatile ");
1656 /* Print the name of the structure. */
1657 if (TREE_CODE (node
) == RECORD_TYPE
)
1658 pp_string (pp
, "struct ");
1659 else if (TREE_CODE (node
) == UNION_TYPE
)
1660 pp_string (pp
, "union ");
1662 if (TYPE_NAME (node
))
1663 dump_generic_node (pp
, TYPE_NAME (node
), spc
, flags
, false);
1664 else if (!(flags
& TDF_SLIM
))
1665 /* FIXME: If we eliminate the 'else' above and attempt
1666 to show the fields for named types, we may get stuck
1667 following a cycle of pointers to structs. The alleged
1668 self-reference check in print_struct_decl will not detect
1669 cycles involving more than one pointer or struct type. */
1670 print_struct_decl (pp
, node
, spc
, flags
);
1679 if (flags
& TDF_GIMPLE
1680 && (POINTER_TYPE_P (TREE_TYPE (node
))
1681 || (TYPE_PRECISION (TREE_TYPE (node
))
1682 < TYPE_PRECISION (integer_type_node
))
1683 || exact_log2 (TYPE_PRECISION (TREE_TYPE (node
))) == -1))
1685 pp_string (pp
, "_Literal (");
1686 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1687 pp_string (pp
, ") ");
1689 if (TREE_CODE (TREE_TYPE (node
)) == POINTER_TYPE
1690 && ! (flags
& TDF_GIMPLE
))
1692 /* In the case of a pointer, one may want to divide by the
1693 size of the pointed-to type. Unfortunately, this not
1694 straightforward. The C front-end maps expressions
1699 in such a way that the two INTEGER_CST nodes for "5" have
1700 different values but identical types. In the latter
1701 case, the 5 is multiplied by sizeof (int) in c-common.c
1702 (pointer_int_sum) to convert it to a byte address, and
1703 yet the type of the node is left unchanged. Argh. What
1704 is consistent though is that the number value corresponds
1705 to bytes (UNITS) offset.
1707 NB: Neither of the following divisors can be trivially
1708 used to recover the original literal:
1710 TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (node)))
1711 TYPE_PRECISION (TREE_TYPE (TREE_TYPE (node))) */
1712 pp_wide_integer (pp
, TREE_INT_CST_LOW (node
));
1713 pp_string (pp
, "B"); /* pseudo-unit */
1715 else if (tree_fits_shwi_p (node
))
1716 pp_wide_integer (pp
, tree_to_shwi (node
));
1717 else if (tree_fits_uhwi_p (node
))
1718 pp_unsigned_wide_integer (pp
, tree_to_uhwi (node
));
1721 wide_int val
= wi::to_wide (node
);
1723 if (wi::neg_p (val
, TYPE_SIGN (TREE_TYPE (node
))))
1728 print_hex (val
, pp_buffer (pp
)->digit_buffer
);
1729 pp_string (pp
, pp_buffer (pp
)->digit_buffer
);
1731 if ((flags
& TDF_GIMPLE
)
1732 && ! (POINTER_TYPE_P (TREE_TYPE (node
))
1733 || (TYPE_PRECISION (TREE_TYPE (node
))
1734 < TYPE_PRECISION (integer_type_node
))
1735 || exact_log2 (TYPE_PRECISION (TREE_TYPE (node
))) == -1))
1737 if (TYPE_UNSIGNED (TREE_TYPE (node
)))
1738 pp_character (pp
, 'u');
1739 if (TYPE_PRECISION (TREE_TYPE (node
))
1740 == TYPE_PRECISION (unsigned_type_node
))
1742 else if (TYPE_PRECISION (TREE_TYPE (node
))
1743 == TYPE_PRECISION (long_unsigned_type_node
))
1744 pp_character (pp
, 'l');
1745 else if (TYPE_PRECISION (TREE_TYPE (node
))
1746 == TYPE_PRECISION (long_long_unsigned_type_node
))
1747 pp_string (pp
, "ll");
1749 if (TREE_OVERFLOW (node
))
1750 pp_string (pp
, "(OVF)");
1754 pp_string (pp
, "POLY_INT_CST [");
1755 dump_generic_node (pp
, POLY_INT_CST_COEFF (node
, 0), spc
, flags
, false);
1756 for (unsigned int i
= 1; i
< NUM_POLY_INT_COEFFS
; ++i
)
1758 pp_string (pp
, ", ");
1759 dump_generic_node (pp
, POLY_INT_CST_COEFF (node
, i
),
1762 pp_string (pp
, "]");
1766 /* Code copied from print_node. */
1769 if (TREE_OVERFLOW (node
))
1770 pp_string (pp
, " overflow");
1772 d
= TREE_REAL_CST (node
);
1773 if (REAL_VALUE_ISINF (d
))
1774 pp_string (pp
, REAL_VALUE_NEGATIVE (d
) ? " -Inf" : " Inf");
1775 else if (REAL_VALUE_ISNAN (d
))
1776 pp_string (pp
, " Nan");
1780 real_to_decimal (string
, &d
, sizeof (string
), 0, 1);
1781 pp_string (pp
, string
);
1789 fixed_to_decimal (string
, TREE_FIXED_CST_PTR (node
), sizeof (string
));
1790 pp_string (pp
, string
);
1795 pp_string (pp
, "__complex__ (");
1796 dump_generic_node (pp
, TREE_REALPART (node
), spc
, flags
, false);
1797 pp_string (pp
, ", ");
1798 dump_generic_node (pp
, TREE_IMAGPART (node
), spc
, flags
, false);
1799 pp_right_paren (pp
);
1804 pp_string (pp
, "\"");
1805 if (unsigned nbytes
= TREE_STRING_LENGTH (node
))
1806 pretty_print_string (pp
, TREE_STRING_POINTER (node
), nbytes
);
1807 pp_string (pp
, "\"");
1814 pp_string (pp
, "{ ");
1815 unsigned HOST_WIDE_INT nunits
;
1816 if (!VECTOR_CST_NELTS (node
).is_constant (&nunits
))
1817 nunits
= vector_cst_encoded_nelts (node
);
1818 for (i
= 0; i
< nunits
; ++i
)
1821 pp_string (pp
, ", ");
1822 dump_generic_node (pp
, VECTOR_CST_ELT (node
, i
),
1825 if (!VECTOR_CST_NELTS (node
).is_constant ())
1826 pp_string (pp
, ", ...");
1827 pp_string (pp
, " }");
1833 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1835 if (TREE_CODE (node
) == METHOD_TYPE
)
1837 if (TYPE_METHOD_BASETYPE (node
))
1838 dump_generic_node (pp
, TYPE_NAME (TYPE_METHOD_BASETYPE (node
)),
1841 pp_string (pp
, "<null method basetype>");
1842 pp_colon_colon (pp
);
1844 if (TYPE_IDENTIFIER (node
))
1845 dump_generic_node (pp
, TYPE_NAME (node
), spc
, flags
, false);
1846 else if (TYPE_NAME (node
) && DECL_NAME (TYPE_NAME (node
)))
1847 dump_decl_name (pp
, TYPE_NAME (node
), flags
);
1848 else if (flags
& TDF_NOUID
)
1849 pp_printf (pp
, "<Txxxx>");
1851 pp_printf (pp
, "<T%x>", TYPE_UID (node
));
1852 dump_function_declaration (pp
, node
, spc
, flags
);
1857 dump_decl_name (pp
, node
, flags
);
1861 if (DECL_NAME (node
))
1862 dump_decl_name (pp
, node
, flags
);
1863 else if (LABEL_DECL_UID (node
) != -1)
1865 if (flags
& TDF_GIMPLE
)
1866 pp_printf (pp
, "L%d", (int) LABEL_DECL_UID (node
));
1868 pp_printf (pp
, "<L%d>", (int) LABEL_DECL_UID (node
));
1872 if (flags
& TDF_NOUID
)
1873 pp_string (pp
, "<D.xxxx>");
1876 if (flags
& TDF_GIMPLE
)
1877 pp_printf (pp
, "<D%u>", DECL_UID (node
));
1879 pp_printf (pp
, "<D.%u>", DECL_UID (node
));
1885 if (DECL_IS_BUILTIN (node
))
1887 /* Don't print the declaration of built-in types. */
1890 if (DECL_NAME (node
))
1891 dump_decl_name (pp
, node
, flags
);
1892 else if (TYPE_NAME (TREE_TYPE (node
)) != node
)
1894 pp_string (pp
, (TREE_CODE (TREE_TYPE (node
)) == UNION_TYPE
1895 ? "union" : "struct "));
1896 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1899 pp_string (pp
, "<anon>");
1905 case DEBUG_EXPR_DECL
:
1906 case NAMESPACE_DECL
:
1908 dump_decl_name (pp
, node
, flags
);
1912 pp_string (pp
, "<retval>");
1916 op0
= TREE_OPERAND (node
, 0);
1919 && (TREE_CODE (op0
) == INDIRECT_REF
1920 || (TREE_CODE (op0
) == MEM_REF
1921 && TREE_CODE (TREE_OPERAND (op0
, 0)) != ADDR_EXPR
1922 && integer_zerop (TREE_OPERAND (op0
, 1))
1923 /* Dump the types of INTEGER_CSTs explicitly, for we
1924 can't infer them and MEM_ATTR caching will share
1925 MEM_REFs with differently-typed op0s. */
1926 && TREE_CODE (TREE_OPERAND (op0
, 0)) != INTEGER_CST
1927 /* Released SSA_NAMES have no TREE_TYPE. */
1928 && TREE_TYPE (TREE_OPERAND (op0
, 0)) != NULL_TREE
1929 /* Same pointer types, but ignoring POINTER_TYPE vs.
1931 && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 0)))
1932 == TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 1))))
1933 && (TYPE_MODE (TREE_TYPE (TREE_OPERAND (op0
, 0)))
1934 == TYPE_MODE (TREE_TYPE (TREE_OPERAND (op0
, 1))))
1935 && (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (op0
, 0)))
1936 == TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (op0
, 1))))
1937 /* Same value types ignoring qualifiers. */
1938 && (TYPE_MAIN_VARIANT (TREE_TYPE (op0
))
1939 == TYPE_MAIN_VARIANT
1940 (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 1)))))
1941 && MR_DEPENDENCE_CLIQUE (op0
) == 0)))
1943 op0
= TREE_OPERAND (op0
, 0);
1946 if (op_prio (op0
) < op_prio (node
))
1948 dump_generic_node (pp
, op0
, spc
, flags
, false);
1949 if (op_prio (op0
) < op_prio (node
))
1950 pp_right_paren (pp
);
1951 pp_string (pp
, str
);
1952 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1953 op0
= component_ref_field_offset (node
);
1954 if (op0
&& TREE_CODE (op0
) != INTEGER_CST
)
1956 pp_string (pp
, "{off: ");
1957 dump_generic_node (pp
, op0
, spc
, flags
, false);
1958 pp_right_brace (pp
);
1963 pp_string (pp
, "BIT_FIELD_REF <");
1964 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1965 pp_string (pp
, ", ");
1966 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1967 pp_string (pp
, ", ");
1968 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
1972 case BIT_INSERT_EXPR
:
1973 pp_string (pp
, "BIT_INSERT_EXPR <");
1974 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1975 pp_string (pp
, ", ");
1976 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1977 pp_string (pp
, ", ");
1978 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
1979 pp_string (pp
, " (");
1980 if (INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (node
, 1))))
1982 TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (node
, 1))));
1984 dump_generic_node (pp
, TYPE_SIZE (TREE_TYPE (TREE_OPERAND (node
, 1))),
1986 pp_string (pp
, " bits)>");
1990 case ARRAY_RANGE_REF
:
1991 op0
= TREE_OPERAND (node
, 0);
1992 if (op_prio (op0
) < op_prio (node
))
1994 dump_generic_node (pp
, op0
, spc
, flags
, false);
1995 if (op_prio (op0
) < op_prio (node
))
1996 pp_right_paren (pp
);
1997 pp_left_bracket (pp
);
1998 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1999 if (TREE_CODE (node
) == ARRAY_RANGE_REF
)
2000 pp_string (pp
, " ...");
2001 pp_right_bracket (pp
);
2003 op0
= array_ref_low_bound (node
);
2004 op1
= array_ref_element_size (node
);
2006 if (!integer_zerop (op0
)
2007 || TREE_OPERAND (node
, 2)
2008 || TREE_OPERAND (node
, 3))
2010 pp_string (pp
, "{lb: ");
2011 dump_generic_node (pp
, op0
, spc
, flags
, false);
2012 pp_string (pp
, " sz: ");
2013 dump_generic_node (pp
, op1
, spc
, flags
, false);
2014 pp_right_brace (pp
);
2020 unsigned HOST_WIDE_INT ix
;
2022 bool is_struct_init
= false;
2023 bool is_array_init
= false;
2026 if (TREE_CLOBBER_P (node
))
2027 pp_string (pp
, "CLOBBER");
2028 else if (TREE_CODE (TREE_TYPE (node
)) == RECORD_TYPE
2029 || TREE_CODE (TREE_TYPE (node
)) == UNION_TYPE
)
2030 is_struct_init
= true;
2031 else if (TREE_CODE (TREE_TYPE (node
)) == ARRAY_TYPE
2032 && TYPE_DOMAIN (TREE_TYPE (node
))
2033 && TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
)))
2034 && TREE_CODE (TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
))))
2037 tree minv
= TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
)));
2038 is_array_init
= true;
2039 curidx
= wi::to_widest (minv
);
2041 FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (node
), ix
, field
, val
)
2048 dump_generic_node (pp
, field
, spc
, flags
, false);
2051 else if (is_array_init
2052 && (TREE_CODE (field
) != INTEGER_CST
2053 || curidx
!= wi::to_widest (field
)))
2055 pp_left_bracket (pp
);
2056 if (TREE_CODE (field
) == RANGE_EXPR
)
2058 dump_generic_node (pp
, TREE_OPERAND (field
, 0), spc
,
2060 pp_string (pp
, " ... ");
2061 dump_generic_node (pp
, TREE_OPERAND (field
, 1), spc
,
2063 if (TREE_CODE (TREE_OPERAND (field
, 1)) == INTEGER_CST
)
2064 curidx
= wi::to_widest (TREE_OPERAND (field
, 1));
2067 dump_generic_node (pp
, field
, spc
, flags
, false);
2068 if (TREE_CODE (field
) == INTEGER_CST
)
2069 curidx
= wi::to_widest (field
);
2070 pp_string (pp
, "]=");
2075 if (val
&& TREE_CODE (val
) == ADDR_EXPR
)
2076 if (TREE_CODE (TREE_OPERAND (val
, 0)) == FUNCTION_DECL
)
2077 val
= TREE_OPERAND (val
, 0);
2078 if (val
&& TREE_CODE (val
) == FUNCTION_DECL
)
2079 dump_decl_name (pp
, val
, flags
);
2081 dump_generic_node (pp
, val
, spc
, flags
, false);
2082 if (ix
!= CONSTRUCTOR_NELTS (node
) - 1)
2088 pp_right_brace (pp
);
2095 if (flags
& TDF_SLIM
)
2097 pp_string (pp
, "<COMPOUND_EXPR>");
2101 dump_generic_node (pp
, TREE_OPERAND (node
, 0),
2102 spc
, flags
, !(flags
& TDF_SLIM
));
2103 if (flags
& TDF_SLIM
)
2104 newline_and_indent (pp
, spc
);
2111 for (tp
= &TREE_OPERAND (node
, 1);
2112 TREE_CODE (*tp
) == COMPOUND_EXPR
;
2113 tp
= &TREE_OPERAND (*tp
, 1))
2115 dump_generic_node (pp
, TREE_OPERAND (*tp
, 0),
2116 spc
, flags
, !(flags
& TDF_SLIM
));
2117 if (flags
& TDF_SLIM
)
2118 newline_and_indent (pp
, spc
);
2126 dump_generic_node (pp
, *tp
, spc
, flags
, !(flags
& TDF_SLIM
));
2130 case STATEMENT_LIST
:
2132 tree_stmt_iterator si
;
2135 if (flags
& TDF_SLIM
)
2137 pp_string (pp
, "<STATEMENT_LIST>");
2141 for (si
= tsi_start (node
); !tsi_end_p (si
); tsi_next (&si
))
2144 newline_and_indent (pp
, spc
);
2147 dump_generic_node (pp
, tsi_stmt (si
), spc
, flags
, true);
2154 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
,
2159 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
,
2164 pp_string (pp
, "TARGET_EXPR <");
2165 dump_generic_node (pp
, TARGET_EXPR_SLOT (node
), spc
, flags
, false);
2168 dump_generic_node (pp
, TARGET_EXPR_INITIAL (node
), spc
, flags
, false);
2173 print_declaration (pp
, DECL_EXPR_DECL (node
), spc
, flags
);
2178 if (TREE_TYPE (node
) == NULL
|| TREE_TYPE (node
) == void_type_node
)
2180 pp_string (pp
, "if (");
2181 dump_generic_node (pp
, COND_EXPR_COND (node
), spc
, flags
, false);
2182 pp_right_paren (pp
);
2183 /* The lowered cond_exprs should always be printed in full. */
2184 if (COND_EXPR_THEN (node
)
2185 && (IS_EMPTY_STMT (COND_EXPR_THEN (node
))
2186 || TREE_CODE (COND_EXPR_THEN (node
)) == GOTO_EXPR
)
2187 && COND_EXPR_ELSE (node
)
2188 && (IS_EMPTY_STMT (COND_EXPR_ELSE (node
))
2189 || TREE_CODE (COND_EXPR_ELSE (node
)) == GOTO_EXPR
))
2192 dump_generic_node (pp
, COND_EXPR_THEN (node
),
2194 if (!IS_EMPTY_STMT (COND_EXPR_ELSE (node
)))
2196 pp_string (pp
, " else ");
2197 dump_generic_node (pp
, COND_EXPR_ELSE (node
),
2201 else if (!(flags
& TDF_SLIM
))
2203 /* Output COND_EXPR_THEN. */
2204 if (COND_EXPR_THEN (node
))
2206 newline_and_indent (pp
, spc
+2);
2208 newline_and_indent (pp
, spc
+4);
2209 dump_generic_node (pp
, COND_EXPR_THEN (node
), spc
+4,
2211 newline_and_indent (pp
, spc
+2);
2212 pp_right_brace (pp
);
2215 /* Output COND_EXPR_ELSE. */
2216 if (COND_EXPR_ELSE (node
)
2217 && !IS_EMPTY_STMT (COND_EXPR_ELSE (node
)))
2219 newline_and_indent (pp
, spc
);
2220 pp_string (pp
, "else");
2221 newline_and_indent (pp
, spc
+2);
2223 newline_and_indent (pp
, spc
+4);
2224 dump_generic_node (pp
, COND_EXPR_ELSE (node
), spc
+4,
2226 newline_and_indent (pp
, spc
+2);
2227 pp_right_brace (pp
);
2234 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2238 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2242 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2248 if (!(flags
& TDF_SLIM
))
2250 if (BIND_EXPR_VARS (node
))
2254 for (op0
= BIND_EXPR_VARS (node
); op0
; op0
= DECL_CHAIN (op0
))
2256 print_declaration (pp
, op0
, spc
+2, flags
);
2261 newline_and_indent (pp
, spc
+2);
2262 dump_generic_node (pp
, BIND_EXPR_BODY (node
), spc
+2, flags
, true);
2263 newline_and_indent (pp
, spc
);
2264 pp_right_brace (pp
);
2270 if (CALL_EXPR_FN (node
) != NULL_TREE
)
2271 print_call_name (pp
, CALL_EXPR_FN (node
), flags
);
2275 pp_string (pp
, internal_fn_name (CALL_EXPR_IFN (node
)));
2278 /* Print parameters. */
2283 call_expr_arg_iterator iter
;
2284 FOR_EACH_CALL_EXPR_ARG (arg
, iter
, node
)
2286 dump_generic_node (pp
, arg
, spc
, flags
, false);
2287 if (more_call_expr_args_p (&iter
))
2294 if (CALL_EXPR_VA_ARG_PACK (node
))
2296 if (call_expr_nargs (node
) > 0)
2301 pp_string (pp
, "__builtin_va_arg_pack ()");
2303 pp_right_paren (pp
);
2305 op1
= CALL_EXPR_STATIC_CHAIN (node
);
2308 pp_string (pp
, " [static-chain: ");
2309 dump_generic_node (pp
, op1
, spc
, flags
, false);
2310 pp_right_bracket (pp
);
2313 if (CALL_EXPR_RETURN_SLOT_OPT (node
))
2314 pp_string (pp
, " [return slot optimization]");
2315 if (CALL_EXPR_TAILCALL (node
))
2316 pp_string (pp
, " [tail call]");
2319 case WITH_CLEANUP_EXPR
:
2323 case CLEANUP_POINT_EXPR
:
2324 pp_string (pp
, "<<cleanup_point ");
2325 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2326 pp_string (pp
, ">>");
2329 case PLACEHOLDER_EXPR
:
2330 pp_string (pp
, "<PLACEHOLDER_EXPR ");
2331 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
2335 /* Binary arithmetic and logic expressions. */
2336 case WIDEN_SUM_EXPR
:
2337 case WIDEN_MULT_EXPR
:
2339 case MULT_HIGHPART_EXPR
:
2341 case POINTER_PLUS_EXPR
:
2342 case POINTER_DIFF_EXPR
:
2344 case TRUNC_DIV_EXPR
:
2346 case FLOOR_DIV_EXPR
:
2347 case ROUND_DIV_EXPR
:
2348 case TRUNC_MOD_EXPR
:
2350 case FLOOR_MOD_EXPR
:
2351 case ROUND_MOD_EXPR
:
2353 case EXACT_DIV_EXPR
:
2358 case WIDEN_LSHIFT_EXPR
:
2362 case TRUTH_ANDIF_EXPR
:
2363 case TRUTH_ORIF_EXPR
:
2364 case TRUTH_AND_EXPR
:
2366 case TRUTH_XOR_EXPR
:
2380 case UNORDERED_EXPR
:
2382 const char *op
= op_symbol (node
);
2383 op0
= TREE_OPERAND (node
, 0);
2384 op1
= TREE_OPERAND (node
, 1);
2386 /* When the operands are expressions with less priority,
2387 keep semantics of the tree representation. */
2388 if (op_prio (op0
) <= op_prio (node
))
2391 dump_generic_node (pp
, op0
, spc
, flags
, false);
2392 pp_right_paren (pp
);
2395 dump_generic_node (pp
, op0
, spc
, flags
, false);
2401 /* When the operands are expressions with less priority,
2402 keep semantics of the tree representation. */
2403 if (op_prio (op1
) <= op_prio (node
))
2406 dump_generic_node (pp
, op1
, spc
, flags
, false);
2407 pp_right_paren (pp
);
2410 dump_generic_node (pp
, op1
, spc
, flags
, false);
2414 /* Unary arithmetic and logic expressions. */
2417 case TRUTH_NOT_EXPR
:
2419 case PREDECREMENT_EXPR
:
2420 case PREINCREMENT_EXPR
:
2422 if (TREE_CODE (node
) == ADDR_EXPR
2423 && (TREE_CODE (TREE_OPERAND (node
, 0)) == STRING_CST
2424 || TREE_CODE (TREE_OPERAND (node
, 0)) == FUNCTION_DECL
))
2425 ; /* Do not output '&' for strings and function pointers. */
2427 pp_string (pp
, op_symbol (node
));
2429 if (op_prio (TREE_OPERAND (node
, 0)) < op_prio (node
))
2432 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2433 pp_right_paren (pp
);
2436 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2439 case POSTDECREMENT_EXPR
:
2440 case POSTINCREMENT_EXPR
:
2441 if (op_prio (TREE_OPERAND (node
, 0)) < op_prio (node
))
2444 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2445 pp_right_paren (pp
);
2448 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2449 pp_string (pp
, op_symbol (node
));
2453 pp_string (pp
, "MIN_EXPR <");
2454 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2455 pp_string (pp
, ", ");
2456 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2461 pp_string (pp
, "MAX_EXPR <");
2462 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2463 pp_string (pp
, ", ");
2464 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2469 pp_string (pp
, "ABS_EXPR <");
2470 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2475 pp_string (pp
, "ABSU_EXPR <");
2476 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2484 case ADDR_SPACE_CONVERT_EXPR
:
2485 case FIXED_CONVERT_EXPR
:
2486 case FIX_TRUNC_EXPR
:
2489 type
= TREE_TYPE (node
);
2490 op0
= TREE_OPERAND (node
, 0);
2491 if (type
!= TREE_TYPE (op0
))
2494 dump_generic_node (pp
, type
, spc
, flags
, false);
2495 pp_string (pp
, ") ");
2497 if (op_prio (op0
) < op_prio (node
))
2499 dump_generic_node (pp
, op0
, spc
, flags
, false);
2500 if (op_prio (op0
) < op_prio (node
))
2501 pp_right_paren (pp
);
2504 case VIEW_CONVERT_EXPR
:
2505 pp_string (pp
, "VIEW_CONVERT_EXPR<");
2506 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
2507 pp_string (pp
, ">(");
2508 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2509 pp_right_paren (pp
);
2513 pp_string (pp
, "((");
2514 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2515 pp_string (pp
, "))");
2518 case NON_LVALUE_EXPR
:
2519 pp_string (pp
, "NON_LVALUE_EXPR <");
2520 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2525 pp_string (pp
, "SAVE_EXPR <");
2526 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2531 pp_string (pp
, "COMPLEX_EXPR <");
2532 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2533 pp_string (pp
, ", ");
2534 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2539 pp_string (pp
, "CONJ_EXPR <");
2540 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2545 if (flags
& TDF_GIMPLE
)
2547 pp_string (pp
, "__real ");
2548 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2552 pp_string (pp
, "REALPART_EXPR <");
2553 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2559 if (flags
& TDF_GIMPLE
)
2561 pp_string (pp
, "__imag ");
2562 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2566 pp_string (pp
, "IMAGPART_EXPR <");
2567 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2573 pp_string (pp
, "VA_ARG_EXPR <");
2574 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2578 case TRY_FINALLY_EXPR
:
2579 case TRY_CATCH_EXPR
:
2580 pp_string (pp
, "try");
2581 newline_and_indent (pp
, spc
+2);
2583 newline_and_indent (pp
, spc
+4);
2584 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
+4, flags
, true);
2585 newline_and_indent (pp
, spc
+2);
2586 pp_right_brace (pp
);
2587 newline_and_indent (pp
, spc
);
2589 (TREE_CODE (node
) == TRY_CATCH_EXPR
) ? "catch" : "finally");
2590 newline_and_indent (pp
, spc
+2);
2592 newline_and_indent (pp
, spc
+4);
2593 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
+4, flags
, true);
2594 newline_and_indent (pp
, spc
+2);
2595 pp_right_brace (pp
);
2600 pp_string (pp
, "catch (");
2601 dump_generic_node (pp
, CATCH_TYPES (node
), spc
+2, flags
, false);
2602 pp_right_paren (pp
);
2603 newline_and_indent (pp
, spc
+2);
2605 newline_and_indent (pp
, spc
+4);
2606 dump_generic_node (pp
, CATCH_BODY (node
), spc
+4, flags
, true);
2607 newline_and_indent (pp
, spc
+2);
2608 pp_right_brace (pp
);
2612 case EH_FILTER_EXPR
:
2613 pp_string (pp
, "<<<eh_filter (");
2614 dump_generic_node (pp
, EH_FILTER_TYPES (node
), spc
+2, flags
, false);
2615 pp_string (pp
, ")>>>");
2616 newline_and_indent (pp
, spc
+2);
2618 newline_and_indent (pp
, spc
+4);
2619 dump_generic_node (pp
, EH_FILTER_FAILURE (node
), spc
+4, flags
, true);
2620 newline_and_indent (pp
, spc
+2);
2621 pp_right_brace (pp
);
2626 op0
= TREE_OPERAND (node
, 0);
2627 /* If this is for break or continue, don't bother printing it. */
2628 if (DECL_NAME (op0
))
2630 const char *name
= IDENTIFIER_POINTER (DECL_NAME (op0
));
2631 if (strcmp (name
, "break") == 0
2632 || strcmp (name
, "continue") == 0)
2635 dump_generic_node (pp
, op0
, spc
, flags
, false);
2637 if (DECL_NONLOCAL (op0
))
2638 pp_string (pp
, " [non-local]");
2642 pp_string (pp
, "while (1)");
2643 if (!(flags
& TDF_SLIM
))
2645 newline_and_indent (pp
, spc
+2);
2647 newline_and_indent (pp
, spc
+4);
2648 dump_generic_node (pp
, LOOP_EXPR_BODY (node
), spc
+4, flags
, true);
2649 newline_and_indent (pp
, spc
+2);
2650 pp_right_brace (pp
);
2656 pp_string (pp
, "// predicted ");
2657 if (PREDICT_EXPR_OUTCOME (node
))
2658 pp_string (pp
, "likely by ");
2660 pp_string (pp
, "unlikely by ");
2661 pp_string (pp
, predictor_name (PREDICT_EXPR_PREDICTOR (node
)));
2662 pp_string (pp
, " predictor.");
2666 pp_string (pp
, "ANNOTATE_EXPR <");
2667 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2668 switch ((enum annot_expr_kind
) TREE_INT_CST_LOW (TREE_OPERAND (node
, 1)))
2670 case annot_expr_ivdep_kind
:
2671 pp_string (pp
, ", ivdep");
2673 case annot_expr_unroll_kind
:
2674 pp_printf (pp
, ", unroll %d",
2675 (int) TREE_INT_CST_LOW (TREE_OPERAND (node
, 2)));
2677 case annot_expr_no_vector_kind
:
2678 pp_string (pp
, ", no-vector");
2680 case annot_expr_vector_kind
:
2681 pp_string (pp
, ", vector");
2683 case annot_expr_parallel_kind
:
2684 pp_string (pp
, ", parallel");
2693 pp_string (pp
, "return");
2694 op0
= TREE_OPERAND (node
, 0);
2698 if (TREE_CODE (op0
) == MODIFY_EXPR
)
2699 dump_generic_node (pp
, TREE_OPERAND (op0
, 1),
2702 dump_generic_node (pp
, op0
, spc
, flags
, false);
2707 pp_string (pp
, "if (");
2708 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2709 pp_string (pp
, ") break");
2713 pp_string (pp
, "switch (");
2714 dump_generic_node (pp
, SWITCH_COND (node
), spc
, flags
, false);
2715 pp_right_paren (pp
);
2716 if (!(flags
& TDF_SLIM
))
2718 newline_and_indent (pp
, spc
+2);
2720 if (SWITCH_BODY (node
))
2722 newline_and_indent (pp
, spc
+4);
2723 dump_generic_node (pp
, SWITCH_BODY (node
), spc
+4, flags
,
2726 newline_and_indent (pp
, spc
+2);
2727 pp_right_brace (pp
);
2733 op0
= GOTO_DESTINATION (node
);
2734 if (TREE_CODE (op0
) != SSA_NAME
&& DECL_P (op0
) && DECL_NAME (op0
))
2736 const char *name
= IDENTIFIER_POINTER (DECL_NAME (op0
));
2737 if (strcmp (name
, "break") == 0
2738 || strcmp (name
, "continue") == 0)
2740 pp_string (pp
, name
);
2744 pp_string (pp
, "goto ");
2745 dump_generic_node (pp
, op0
, spc
, flags
, false);
2749 pp_string (pp
, "__asm__");
2750 if (ASM_VOLATILE_P (node
))
2751 pp_string (pp
, " __volatile__");
2753 dump_generic_node (pp
, ASM_STRING (node
), spc
, flags
, false);
2755 dump_generic_node (pp
, ASM_OUTPUTS (node
), spc
, flags
, false);
2757 dump_generic_node (pp
, ASM_INPUTS (node
), spc
, flags
, false);
2758 if (ASM_CLOBBERS (node
))
2761 dump_generic_node (pp
, ASM_CLOBBERS (node
), spc
, flags
, false);
2763 pp_right_paren (pp
);
2766 case CASE_LABEL_EXPR
:
2767 if (CASE_LOW (node
) && CASE_HIGH (node
))
2769 pp_string (pp
, "case ");
2770 dump_generic_node (pp
, CASE_LOW (node
), spc
, flags
, false);
2771 pp_string (pp
, " ... ");
2772 dump_generic_node (pp
, CASE_HIGH (node
), spc
, flags
, false);
2774 else if (CASE_LOW (node
))
2776 pp_string (pp
, "case ");
2777 dump_generic_node (pp
, CASE_LOW (node
), spc
, flags
, false);
2780 pp_string (pp
, "default");
2785 pp_string (pp
, "OBJ_TYPE_REF(");
2786 dump_generic_node (pp
, OBJ_TYPE_REF_EXPR (node
), spc
, flags
, false);
2788 /* We omit the class type for -fcompare-debug because we may
2789 drop TYPE_BINFO early depending on debug info, and then
2790 virtual_method_call_p would return false, whereas when
2791 TYPE_BINFO is preserved it may still return true and then
2792 we'd print the class type. Compare tree and rtl dumps for
2793 libstdc++-prettyprinters/shared_ptr.cc with and without -g,
2794 for example, at occurrences of OBJ_TYPE_REF. */
2795 if (!(flags
& (TDF_SLIM
| TDF_COMPARE_DEBUG
))
2796 && virtual_method_call_p (node
))
2798 pp_string (pp
, "(");
2799 dump_generic_node (pp
, obj_type_ref_class (node
), spc
, flags
, false);
2800 pp_string (pp
, ")");
2802 dump_generic_node (pp
, OBJ_TYPE_REF_OBJECT (node
), spc
, flags
, false);
2804 dump_generic_node (pp
, OBJ_TYPE_REF_TOKEN (node
), spc
, flags
, false);
2805 pp_right_paren (pp
);
2809 if (SSA_NAME_IDENTIFIER (node
))
2811 if ((flags
& TDF_NOUID
)
2812 && SSA_NAME_VAR (node
)
2813 && DECL_NAMELESS (SSA_NAME_VAR (node
)))
2814 dump_fancy_name (pp
, SSA_NAME_IDENTIFIER (node
));
2815 else if (! (flags
& TDF_GIMPLE
)
2816 || SSA_NAME_VAR (node
))
2817 dump_generic_node (pp
, SSA_NAME_IDENTIFIER (node
),
2821 pp_decimal_int (pp
, SSA_NAME_VERSION (node
));
2822 if (SSA_NAME_IS_DEFAULT_DEF (node
))
2823 pp_string (pp
, "(D)");
2824 if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (node
))
2825 pp_string (pp
, "(ab)");
2828 case WITH_SIZE_EXPR
:
2829 pp_string (pp
, "WITH_SIZE_EXPR <");
2830 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2831 pp_string (pp
, ", ");
2832 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2837 pp_string (pp
, "ASSERT_EXPR <");
2838 dump_generic_node (pp
, ASSERT_EXPR_VAR (node
), spc
, flags
, false);
2839 pp_string (pp
, ", ");
2840 dump_generic_node (pp
, ASSERT_EXPR_COND (node
), spc
, flags
, false);
2845 pp_string (pp
, "scev_known");
2848 case SCEV_NOT_KNOWN
:
2849 pp_string (pp
, "scev_not_known");
2852 case POLYNOMIAL_CHREC
:
2854 dump_generic_node (pp
, CHREC_LEFT (node
), spc
, flags
, false);
2855 pp_string (pp
, ", +, ");
2856 dump_generic_node (pp
, CHREC_RIGHT (node
), spc
, flags
, false);
2857 pp_printf (pp
, "}_%u", CHREC_VARIABLE (node
));
2861 case REALIGN_LOAD_EXPR
:
2862 pp_string (pp
, "REALIGN_LOAD <");
2863 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2864 pp_string (pp
, ", ");
2865 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2866 pp_string (pp
, ", ");
2867 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2872 pp_string (pp
, " VEC_COND_EXPR < ");
2873 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2874 pp_string (pp
, " , ");
2875 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2876 pp_string (pp
, " , ");
2877 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2878 pp_string (pp
, " > ");
2882 pp_string (pp
, " VEC_PERM_EXPR < ");
2883 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2884 pp_string (pp
, " , ");
2885 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2886 pp_string (pp
, " , ");
2887 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2888 pp_string (pp
, " > ");
2892 pp_string (pp
, " DOT_PROD_EXPR < ");
2893 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2894 pp_string (pp
, ", ");
2895 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2896 pp_string (pp
, ", ");
2897 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2898 pp_string (pp
, " > ");
2901 case WIDEN_MULT_PLUS_EXPR
:
2902 pp_string (pp
, " WIDEN_MULT_PLUS_EXPR < ");
2903 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2904 pp_string (pp
, ", ");
2905 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2906 pp_string (pp
, ", ");
2907 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2908 pp_string (pp
, " > ");
2911 case WIDEN_MULT_MINUS_EXPR
:
2912 pp_string (pp
, " WIDEN_MULT_MINUS_EXPR < ");
2913 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2914 pp_string (pp
, ", ");
2915 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2916 pp_string (pp
, ", ");
2917 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2918 pp_string (pp
, " > ");
2922 pp_string (pp
, "#pragma acc parallel");
2923 goto dump_omp_clauses_body
;
2926 pp_string (pp
, "#pragma acc kernels");
2927 goto dump_omp_clauses_body
;
2930 pp_string (pp
, "#pragma acc data");
2931 dump_omp_clauses (pp
, OACC_DATA_CLAUSES (node
), spc
, flags
);
2934 case OACC_HOST_DATA
:
2935 pp_string (pp
, "#pragma acc host_data");
2936 dump_omp_clauses (pp
, OACC_HOST_DATA_CLAUSES (node
), spc
, flags
);
2940 pp_string (pp
, "#pragma acc declare");
2941 dump_omp_clauses (pp
, OACC_DECLARE_CLAUSES (node
), spc
, flags
);
2945 pp_string (pp
, "#pragma acc update");
2946 dump_omp_clauses (pp
, OACC_UPDATE_CLAUSES (node
), spc
, flags
);
2949 case OACC_ENTER_DATA
:
2950 pp_string (pp
, "#pragma acc enter data");
2951 dump_omp_clauses (pp
, OACC_ENTER_DATA_CLAUSES (node
), spc
, flags
);
2954 case OACC_EXIT_DATA
:
2955 pp_string (pp
, "#pragma acc exit data");
2956 dump_omp_clauses (pp
, OACC_EXIT_DATA_CLAUSES (node
), spc
, flags
);
2960 pp_string (pp
, "#pragma acc cache");
2961 dump_omp_clauses (pp
, OACC_CACHE_CLAUSES (node
), spc
, flags
);
2965 pp_string (pp
, "#pragma omp parallel");
2966 dump_omp_clauses (pp
, OMP_PARALLEL_CLAUSES (node
), spc
, flags
);
2969 dump_omp_clauses_body
:
2970 dump_omp_clauses (pp
, OMP_CLAUSES (node
), spc
, flags
);
2974 if (!(flags
& TDF_SLIM
) && OMP_BODY (node
))
2976 newline_and_indent (pp
, spc
+ 2);
2978 newline_and_indent (pp
, spc
+ 4);
2979 dump_generic_node (pp
, OMP_BODY (node
), spc
+ 4, flags
, false);
2980 newline_and_indent (pp
, spc
+ 2);
2981 pp_right_brace (pp
);
2987 pp_string (pp
, "#pragma omp task");
2988 dump_omp_clauses (pp
, OMP_TASK_CLAUSES (node
), spc
, flags
);
2992 pp_string (pp
, "#pragma omp for");
2996 pp_string (pp
, "#pragma omp simd");
2999 case OMP_DISTRIBUTE
:
3000 pp_string (pp
, "#pragma omp distribute");
3004 pp_string (pp
, "#pragma omp taskloop");
3008 pp_string (pp
, "#pragma acc loop");
3012 pp_string (pp
, "#pragma omp teams");
3013 dump_omp_clauses (pp
, OMP_TEAMS_CLAUSES (node
), spc
, flags
);
3016 case OMP_TARGET_DATA
:
3017 pp_string (pp
, "#pragma omp target data");
3018 dump_omp_clauses (pp
, OMP_TARGET_DATA_CLAUSES (node
), spc
, flags
);
3021 case OMP_TARGET_ENTER_DATA
:
3022 pp_string (pp
, "#pragma omp target enter data");
3023 dump_omp_clauses (pp
, OMP_TARGET_ENTER_DATA_CLAUSES (node
), spc
, flags
);
3027 case OMP_TARGET_EXIT_DATA
:
3028 pp_string (pp
, "#pragma omp target exit data");
3029 dump_omp_clauses (pp
, OMP_TARGET_EXIT_DATA_CLAUSES (node
), spc
, flags
);
3034 pp_string (pp
, "#pragma omp target");
3035 dump_omp_clauses (pp
, OMP_TARGET_CLAUSES (node
), spc
, flags
);
3038 case OMP_TARGET_UPDATE
:
3039 pp_string (pp
, "#pragma omp target update");
3040 dump_omp_clauses (pp
, OMP_TARGET_UPDATE_CLAUSES (node
), spc
, flags
);
3045 dump_omp_clauses (pp
, OMP_FOR_CLAUSES (node
), spc
, flags
);
3046 if (!(flags
& TDF_SLIM
))
3050 if (OMP_FOR_PRE_BODY (node
))
3052 newline_and_indent (pp
, spc
+ 2);
3055 newline_and_indent (pp
, spc
);
3056 dump_generic_node (pp
, OMP_FOR_PRE_BODY (node
),
3059 if (OMP_FOR_INIT (node
))
3062 for (i
= 0; i
< TREE_VEC_LENGTH (OMP_FOR_INIT (node
)); i
++)
3065 newline_and_indent (pp
, spc
);
3066 pp_string (pp
, "for (");
3067 dump_generic_node (pp
,
3068 TREE_VEC_ELT (OMP_FOR_INIT (node
), i
),
3070 pp_string (pp
, "; ");
3071 dump_generic_node (pp
,
3072 TREE_VEC_ELT (OMP_FOR_COND (node
), i
),
3074 pp_string (pp
, "; ");
3075 dump_generic_node (pp
,
3076 TREE_VEC_ELT (OMP_FOR_INCR (node
), i
),
3078 pp_right_paren (pp
);
3081 if (OMP_FOR_BODY (node
))
3083 newline_and_indent (pp
, spc
+ 2);
3085 newline_and_indent (pp
, spc
+ 4);
3086 dump_generic_node (pp
, OMP_FOR_BODY (node
), spc
+ 4, flags
,
3088 newline_and_indent (pp
, spc
+ 2);
3089 pp_right_brace (pp
);
3091 if (OMP_FOR_INIT (node
))
3092 spc
-= 2 * TREE_VEC_LENGTH (OMP_FOR_INIT (node
)) - 2;
3093 if (OMP_FOR_PRE_BODY (node
))
3096 newline_and_indent (pp
, spc
+ 2);
3097 pp_right_brace (pp
);
3104 pp_string (pp
, "#pragma omp sections");
3105 dump_omp_clauses (pp
, OMP_SECTIONS_CLAUSES (node
), spc
, flags
);
3109 pp_string (pp
, "#pragma omp section");
3113 pp_string (pp
, "#pragma omp master");
3117 pp_string (pp
, "#pragma omp taskgroup");
3121 pp_string (pp
, "#pragma omp ordered");
3122 dump_omp_clauses (pp
, OMP_ORDERED_CLAUSES (node
), spc
, flags
);
3126 pp_string (pp
, "#pragma omp critical");
3127 if (OMP_CRITICAL_NAME (node
))
3131 dump_generic_node (pp
, OMP_CRITICAL_NAME (node
), spc
,
3133 pp_right_paren (pp
);
3135 dump_omp_clauses (pp
, OMP_CRITICAL_CLAUSES (node
), spc
, flags
);
3139 pp_string (pp
, "#pragma omp atomic");
3140 if (OMP_ATOMIC_SEQ_CST (node
))
3141 pp_string (pp
, " seq_cst");
3142 newline_and_indent (pp
, spc
+ 2);
3143 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3147 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3150 case OMP_ATOMIC_READ
:
3151 pp_string (pp
, "#pragma omp atomic read");
3152 if (OMP_ATOMIC_SEQ_CST (node
))
3153 pp_string (pp
, " seq_cst");
3154 newline_and_indent (pp
, spc
+ 2);
3155 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3159 case OMP_ATOMIC_CAPTURE_OLD
:
3160 case OMP_ATOMIC_CAPTURE_NEW
:
3161 pp_string (pp
, "#pragma omp atomic capture");
3162 if (OMP_ATOMIC_SEQ_CST (node
))
3163 pp_string (pp
, " seq_cst");
3164 newline_and_indent (pp
, spc
+ 2);
3165 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3169 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3173 pp_string (pp
, "#pragma omp single");
3174 dump_omp_clauses (pp
, OMP_SINGLE_CLAUSES (node
), spc
, flags
);
3178 dump_omp_clause (pp
, node
, spc
, flags
);
3182 case TRANSACTION_EXPR
:
3183 if (TRANSACTION_EXPR_OUTER (node
))
3184 pp_string (pp
, "__transaction_atomic [[outer]]");
3185 else if (TRANSACTION_EXPR_RELAXED (node
))
3186 pp_string (pp
, "__transaction_relaxed");
3188 pp_string (pp
, "__transaction_atomic");
3189 if (!(flags
& TDF_SLIM
) && TRANSACTION_EXPR_BODY (node
))
3191 newline_and_indent (pp
, spc
);
3193 newline_and_indent (pp
, spc
+ 2);
3194 dump_generic_node (pp
, TRANSACTION_EXPR_BODY (node
),
3195 spc
+ 2, flags
, false);
3196 newline_and_indent (pp
, spc
);
3197 pp_right_brace (pp
);
3202 case VEC_SERIES_EXPR
:
3203 case VEC_WIDEN_MULT_HI_EXPR
:
3204 case VEC_WIDEN_MULT_LO_EXPR
:
3205 case VEC_WIDEN_MULT_EVEN_EXPR
:
3206 case VEC_WIDEN_MULT_ODD_EXPR
:
3207 case VEC_WIDEN_LSHIFT_HI_EXPR
:
3208 case VEC_WIDEN_LSHIFT_LO_EXPR
:
3210 for (str
= get_tree_code_name (code
); *str
; str
++)
3211 pp_character (pp
, TOUPPER (*str
));
3212 pp_string (pp
, " < ");
3213 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3214 pp_string (pp
, ", ");
3215 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3216 pp_string (pp
, " > ");
3219 case VEC_DUPLICATE_EXPR
:
3221 for (str
= get_tree_code_name (code
); *str
; str
++)
3222 pp_character (pp
, TOUPPER (*str
));
3223 pp_string (pp
, " < ");
3224 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3225 pp_string (pp
, " > ");
3228 case VEC_UNPACK_HI_EXPR
:
3229 pp_string (pp
, " VEC_UNPACK_HI_EXPR < ");
3230 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3231 pp_string (pp
, " > ");
3234 case VEC_UNPACK_LO_EXPR
:
3235 pp_string (pp
, " VEC_UNPACK_LO_EXPR < ");
3236 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3237 pp_string (pp
, " > ");
3240 case VEC_UNPACK_FLOAT_HI_EXPR
:
3241 pp_string (pp
, " VEC_UNPACK_FLOAT_HI_EXPR < ");
3242 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3243 pp_string (pp
, " > ");
3246 case VEC_UNPACK_FLOAT_LO_EXPR
:
3247 pp_string (pp
, " VEC_UNPACK_FLOAT_LO_EXPR < ");
3248 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3249 pp_string (pp
, " > ");
3252 case VEC_UNPACK_FIX_TRUNC_HI_EXPR
:
3253 pp_string (pp
, " VEC_UNPACK_FIX_TRUNC_HI_EXPR < ");
3254 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3255 pp_string (pp
, " > ");
3258 case VEC_UNPACK_FIX_TRUNC_LO_EXPR
:
3259 pp_string (pp
, " VEC_UNPACK_FIX_TRUNC_LO_EXPR < ");
3260 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3261 pp_string (pp
, " > ");
3264 case VEC_PACK_TRUNC_EXPR
:
3265 pp_string (pp
, " VEC_PACK_TRUNC_EXPR < ");
3266 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3267 pp_string (pp
, ", ");
3268 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3269 pp_string (pp
, " > ");
3272 case VEC_PACK_SAT_EXPR
:
3273 pp_string (pp
, " VEC_PACK_SAT_EXPR < ");
3274 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3275 pp_string (pp
, ", ");
3276 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3277 pp_string (pp
, " > ");
3280 case VEC_PACK_FIX_TRUNC_EXPR
:
3281 pp_string (pp
, " VEC_PACK_FIX_TRUNC_EXPR < ");
3282 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3283 pp_string (pp
, ", ");
3284 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3285 pp_string (pp
, " > ");
3288 case VEC_PACK_FLOAT_EXPR
:
3289 pp_string (pp
, " VEC_PACK_FLOAT_EXPR < ");
3290 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3291 pp_string (pp
, ", ");
3292 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3293 pp_string (pp
, " > ");
3297 dump_block_node (pp
, node
, spc
, flags
);
3300 case DEBUG_BEGIN_STMT
:
3301 pp_string (pp
, "# DEBUG BEGIN STMT");
3308 if (is_stmt
&& is_expr
)
3314 /* Print the declaration of a variable. */
3317 print_declaration (pretty_printer
*pp
, tree t
, int spc
, dump_flags_t flags
)
3321 if (TREE_CODE(t
) == NAMELIST_DECL
)
3323 pp_string(pp
, "namelist ");
3324 dump_decl_name (pp
, t
, flags
);
3329 if (TREE_CODE (t
) == TYPE_DECL
)
3330 pp_string (pp
, "typedef ");
3332 if (CODE_CONTAINS_STRUCT (TREE_CODE (t
), TS_DECL_WRTL
) && DECL_REGISTER (t
))
3333 pp_string (pp
, "register ");
3335 if (TREE_PUBLIC (t
) && DECL_EXTERNAL (t
))
3336 pp_string (pp
, "extern ");
3337 else if (TREE_STATIC (t
))
3338 pp_string (pp
, "static ");
3340 /* Print the type and name. */
3341 if (TREE_TYPE (t
) && TREE_CODE (TREE_TYPE (t
)) == ARRAY_TYPE
)
3345 /* Print array's type. */
3346 tmp
= TREE_TYPE (t
);
3347 while (TREE_CODE (TREE_TYPE (tmp
)) == ARRAY_TYPE
)
3348 tmp
= TREE_TYPE (tmp
);
3349 dump_generic_node (pp
, TREE_TYPE (tmp
), spc
, flags
, false);
3351 /* Print variable's name. */
3353 dump_generic_node (pp
, t
, spc
, flags
, false);
3355 /* Print the dimensions. */
3356 tmp
= TREE_TYPE (t
);
3357 while (TREE_CODE (tmp
) == ARRAY_TYPE
)
3359 dump_array_domain (pp
, TYPE_DOMAIN (tmp
), spc
, flags
);
3360 tmp
= TREE_TYPE (tmp
);
3363 else if (TREE_CODE (t
) == FUNCTION_DECL
)
3365 dump_generic_node (pp
, TREE_TYPE (TREE_TYPE (t
)), spc
, flags
, false);
3367 dump_decl_name (pp
, t
, flags
);
3368 dump_function_declaration (pp
, TREE_TYPE (t
), spc
, flags
);
3372 /* Print type declaration. */
3373 dump_generic_node (pp
, TREE_TYPE (t
), spc
, flags
, false);
3375 /* Print variable's name. */
3377 dump_generic_node (pp
, t
, spc
, flags
, false);
3380 if (VAR_P (t
) && DECL_HARD_REGISTER (t
))
3382 pp_string (pp
, " __asm__ ");
3384 dump_generic_node (pp
, DECL_ASSEMBLER_NAME (t
), spc
, flags
, false);
3385 pp_right_paren (pp
);
3388 /* The initial value of a function serves to determine whether the function
3389 is declared or defined. So the following does not apply to function
3391 if (TREE_CODE (t
) != FUNCTION_DECL
)
3393 /* Print the initial value. */
3394 if (DECL_INITIAL (t
))
3399 if (!(flags
& TDF_SLIM
))
3400 dump_generic_node (pp
, DECL_INITIAL (t
), spc
, flags
, false);
3402 pp_string (pp
, "<<< omitted >>>");
3406 if (VAR_P (t
) && DECL_HAS_VALUE_EXPR_P (t
))
3408 pp_string (pp
, " [value-expr: ");
3409 dump_generic_node (pp
, DECL_VALUE_EXPR (t
), spc
, flags
, false);
3410 pp_right_bracket (pp
);
3417 /* Prints a structure: name, fields, and methods.
3418 FIXME: Still incomplete. */
3421 print_struct_decl (pretty_printer
*pp
, const_tree node
, int spc
,
3424 /* Print the name of the structure. */
3425 if (TYPE_NAME (node
))
3428 if (TREE_CODE (node
) == RECORD_TYPE
)
3429 pp_string (pp
, "struct ");
3430 else if ((TREE_CODE (node
) == UNION_TYPE
3431 || TREE_CODE (node
) == QUAL_UNION_TYPE
))
3432 pp_string (pp
, "union ");
3434 dump_generic_node (pp
, TYPE_NAME (node
), spc
, TDF_NONE
, false);
3437 /* Print the contents of the structure. */
3443 /* Print the fields of the structure. */
3446 tmp
= TYPE_FIELDS (node
);
3449 /* Avoid to print recursively the structure. */
3450 /* FIXME : Not implemented correctly...,
3451 what about the case when we have a cycle in the contain graph? ...
3452 Maybe this could be solved by looking at the scope in which the
3453 structure was declared. */
3454 if (TREE_TYPE (tmp
) != node
3455 && (TREE_CODE (TREE_TYPE (tmp
)) != POINTER_TYPE
3456 || TREE_TYPE (TREE_TYPE (tmp
)) != node
))
3458 print_declaration (pp
, tmp
, spc
+2, flags
);
3461 tmp
= DECL_CHAIN (tmp
);
3465 pp_right_brace (pp
);
3468 /* Return the priority of the operator CODE.
3470 From lowest to highest precedence with either left-to-right (L-R)
3471 or right-to-left (R-L) associativity]:
3474 2 [R-L] = += -= *= /= %= &= ^= |= <<= >>=
3486 14 [R-L] ! ~ ++ -- + - * & (type) sizeof
3487 15 [L-R] fn() [] -> .
3489 unary +, - and * have higher precedence than the corresponding binary
3493 op_code_prio (enum tree_code code
)
3510 case TRUTH_ORIF_EXPR
:
3513 case TRUTH_AND_EXPR
:
3514 case TRUTH_ANDIF_EXPR
:
3521 case TRUTH_XOR_EXPR
:
3538 case UNORDERED_EXPR
:
3549 case VEC_WIDEN_LSHIFT_HI_EXPR
:
3550 case VEC_WIDEN_LSHIFT_LO_EXPR
:
3551 case WIDEN_LSHIFT_EXPR
:
3554 case WIDEN_SUM_EXPR
:
3556 case POINTER_PLUS_EXPR
:
3557 case POINTER_DIFF_EXPR
:
3561 case VEC_WIDEN_MULT_HI_EXPR
:
3562 case VEC_WIDEN_MULT_LO_EXPR
:
3563 case WIDEN_MULT_EXPR
:
3565 case WIDEN_MULT_PLUS_EXPR
:
3566 case WIDEN_MULT_MINUS_EXPR
:
3568 case MULT_HIGHPART_EXPR
:
3569 case TRUNC_DIV_EXPR
:
3571 case FLOOR_DIV_EXPR
:
3572 case ROUND_DIV_EXPR
:
3574 case EXACT_DIV_EXPR
:
3575 case TRUNC_MOD_EXPR
:
3577 case FLOOR_MOD_EXPR
:
3578 case ROUND_MOD_EXPR
:
3581 case TRUTH_NOT_EXPR
:
3583 case POSTINCREMENT_EXPR
:
3584 case POSTDECREMENT_EXPR
:
3585 case PREINCREMENT_EXPR
:
3586 case PREDECREMENT_EXPR
:
3592 case FIX_TRUNC_EXPR
:
3598 case ARRAY_RANGE_REF
:
3602 /* Special expressions. */
3608 case VEC_UNPACK_HI_EXPR
:
3609 case VEC_UNPACK_LO_EXPR
:
3610 case VEC_UNPACK_FLOAT_HI_EXPR
:
3611 case VEC_UNPACK_FLOAT_LO_EXPR
:
3612 case VEC_UNPACK_FIX_TRUNC_HI_EXPR
:
3613 case VEC_UNPACK_FIX_TRUNC_LO_EXPR
:
3614 case VEC_PACK_TRUNC_EXPR
:
3615 case VEC_PACK_SAT_EXPR
:
3619 /* Return an arbitrarily high precedence to avoid surrounding single
3620 VAR_DECLs in ()s. */
3625 /* Return the priority of the operator OP. */
3628 op_prio (const_tree op
)
3630 enum tree_code code
;
3635 code
= TREE_CODE (op
);
3636 if (code
== SAVE_EXPR
|| code
== NON_LVALUE_EXPR
)
3637 return op_prio (TREE_OPERAND (op
, 0));
3639 return op_code_prio (code
);
3642 /* Return the symbol associated with operator CODE. */
3645 op_symbol_code (enum tree_code code
)
3653 case TRUTH_ORIF_EXPR
:
3656 case TRUTH_AND_EXPR
:
3657 case TRUTH_ANDIF_EXPR
:
3663 case TRUTH_XOR_EXPR
:
3673 case UNORDERED_EXPR
:
3719 case WIDEN_LSHIFT_EXPR
:
3722 case POINTER_PLUS_EXPR
:
3728 case WIDEN_SUM_EXPR
:
3731 case WIDEN_MULT_EXPR
:
3734 case MULT_HIGHPART_EXPR
:
3739 case POINTER_DIFF_EXPR
:
3745 case TRUTH_NOT_EXPR
:
3752 case TRUNC_DIV_EXPR
:
3759 case FLOOR_DIV_EXPR
:
3762 case ROUND_DIV_EXPR
:
3765 case EXACT_DIV_EXPR
:
3768 case TRUNC_MOD_EXPR
:
3774 case FLOOR_MOD_EXPR
:
3777 case ROUND_MOD_EXPR
:
3780 case PREDECREMENT_EXPR
:
3783 case PREINCREMENT_EXPR
:
3786 case POSTDECREMENT_EXPR
:
3789 case POSTINCREMENT_EXPR
:
3799 return "<<< ??? >>>";
3803 /* Return the symbol associated with operator OP. */
3806 op_symbol (const_tree op
)
3808 return op_symbol_code (TREE_CODE (op
));
3811 /* Prints the name of a call. NODE is the CALL_EXPR_FN of a CALL_EXPR or
3812 the gimple_call_fn of a GIMPLE_CALL. */
3815 print_call_name (pretty_printer
*pp
, tree node
, dump_flags_t flags
)
3819 if (TREE_CODE (op0
) == NON_LVALUE_EXPR
)
3820 op0
= TREE_OPERAND (op0
, 0);
3823 switch (TREE_CODE (op0
))
3828 dump_function_name (pp
, op0
, flags
);
3834 op0
= TREE_OPERAND (op0
, 0);
3839 dump_generic_node (pp
, TREE_OPERAND (op0
, 0), 0, flags
, false);
3840 pp_string (pp
, ") ? ");
3841 dump_generic_node (pp
, TREE_OPERAND (op0
, 1), 0, flags
, false);
3842 pp_string (pp
, " : ");
3843 dump_generic_node (pp
, TREE_OPERAND (op0
, 2), 0, flags
, false);
3847 if (TREE_CODE (TREE_OPERAND (op0
, 0)) == VAR_DECL
)
3848 dump_function_name (pp
, TREE_OPERAND (op0
, 0), flags
);
3850 dump_generic_node (pp
, op0
, 0, flags
, false);
3854 if (integer_zerop (TREE_OPERAND (op0
, 1)))
3856 op0
= TREE_OPERAND (op0
, 0);
3863 dump_generic_node (pp
, op0
, 0, flags
, false);
3871 /* Print the first N characters in the array STR, replacing non-printable
3872 characters (including embedded nuls) with unambiguous escape sequences. */
3875 pretty_print_string (pretty_printer
*pp
, const char *str
, unsigned n
)
3880 for ( ; n
; --n
, ++str
)
3885 pp_string (pp
, "\\b");
3889 pp_string (pp
, "\\f");
3893 pp_string (pp
, "\\n");
3897 pp_string (pp
, "\\r");
3901 pp_string (pp
, "\\t");
3905 pp_string (pp
, "\\v");
3909 pp_string (pp
, "\\\\");
3913 pp_string (pp
, "\\\"");
3917 pp_string (pp
, "\\'");
3921 if (str
[0] || n
> 1)
3923 if (!ISPRINT (str
[0]))
3926 sprintf (buf
, "\\x%02x", (unsigned char)str
[0]);
3927 pp_string (pp
, buf
);
3930 pp_character (pp
, str
[0]);
3938 maybe_init_pretty_print (FILE *file
)
3942 tree_pp
= new pretty_printer ();
3943 pp_needs_newline (tree_pp
) = true;
3944 pp_translate_identifiers (tree_pp
) = false;
3947 tree_pp
->buffer
->stream
= file
;
3951 newline_and_indent (pretty_printer
*pp
, int spc
)
3957 /* Handle the %K format for TEXT. Separate from default_tree_printer
3958 so it can also be used in front ends.
3959 The location LOC and BLOCK are expected to be extracted by the caller
3960 from the %K argument arg via EXPR_LOCATION(arg) and TREE_BLOCK(arg). */
3963 percent_K_format (text_info
*text
, location_t loc
, tree block
)
3965 text
->set_location (0, loc
, SHOW_RANGE_WITH_CARET
);
3966 gcc_assert (pp_ti_abstract_origin (text
) != NULL
);
3967 *pp_ti_abstract_origin (text
) = NULL
;
3971 /* ??? LTO drops all BLOCK_ABSTRACT_ORIGINs apart from those
3972 representing the outermost block of an inlined function.
3973 So walk the BLOCK tree until we hit such a scope. */
3975 && TREE_CODE (block
) == BLOCK
)
3977 if (inlined_function_outer_scope_p (block
))
3979 *pp_ti_abstract_origin (text
) = block
;
3982 block
= BLOCK_SUPERCONTEXT (block
);
3988 && TREE_CODE (block
) == BLOCK
3989 && BLOCK_ABSTRACT_ORIGIN (block
))
3991 tree ao
= BLOCK_ABSTRACT_ORIGIN (block
);
3993 while (TREE_CODE (ao
) == BLOCK
3994 && BLOCK_ABSTRACT_ORIGIN (ao
)
3995 && BLOCK_ABSTRACT_ORIGIN (ao
) != ao
)
3996 ao
= BLOCK_ABSTRACT_ORIGIN (ao
);
3998 if (TREE_CODE (ao
) == FUNCTION_DECL
)
4000 *pp_ti_abstract_origin (text
) = block
;
4003 block
= BLOCK_SUPERCONTEXT (block
);
4007 /* Print the identifier ID to PRETTY-PRINTER. */
4010 pp_tree_identifier (pretty_printer
*pp
, tree id
)
4012 if (pp_translate_identifiers (pp
))
4014 const char *text
= identifier_to_locale (IDENTIFIER_POINTER (id
));
4015 pp_append_text (pp
, text
, text
+ strlen (text
));
4018 pp_append_text (pp
, IDENTIFIER_POINTER (id
),
4019 IDENTIFIER_POINTER (id
) + IDENTIFIER_LENGTH (id
));
4022 /* A helper function that is used to dump function information before the
4026 dump_function_header (FILE *dump_file
, tree fdecl
, dump_flags_t flags
)
4028 const char *dname
, *aname
;
4029 struct cgraph_node
*node
= cgraph_node::get (fdecl
);
4030 struct function
*fun
= DECL_STRUCT_FUNCTION (fdecl
);
4032 dname
= lang_hooks
.decl_printable_name (fdecl
, 1);
4034 if (DECL_ASSEMBLER_NAME_SET_P (fdecl
))
4035 aname
= (IDENTIFIER_POINTER
4036 (DECL_ASSEMBLER_NAME (fdecl
)));
4038 aname
= "<unset-asm-name>";
4040 fprintf (dump_file
, "\n;; Function %s (%s, funcdef_no=%d",
4041 dname
, aname
, fun
->funcdef_no
);
4042 if (!(flags
& TDF_NOUID
))
4043 fprintf (dump_file
, ", decl_uid=%d", DECL_UID (fdecl
));
4046 fprintf (dump_file
, ", cgraph_uid=%d", node
->get_uid ());
4047 fprintf (dump_file
, ", symbol_order=%d)%s\n\n", node
->order
,
4048 node
->frequency
== NODE_FREQUENCY_HOT
4050 : node
->frequency
== NODE_FREQUENCY_UNLIKELY_EXECUTED
4051 ? " (unlikely executed)"
4052 : node
->frequency
== NODE_FREQUENCY_EXECUTED_ONCE
4053 ? " (executed once)"
4057 fprintf (dump_file
, ")\n\n");
4060 /* Dump double_int D to pretty_printer PP. UNS is true
4061 if D is unsigned and false otherwise. */
4063 pp_double_int (pretty_printer
*pp
, double_int d
, bool uns
)
4066 pp_wide_integer (pp
, d
.low
);
4067 else if (d
.fits_uhwi ())
4068 pp_unsigned_wide_integer (pp
, d
.low
);
4071 unsigned HOST_WIDE_INT low
= d
.low
;
4072 HOST_WIDE_INT high
= d
.high
;
4073 if (!uns
&& d
.is_negative ())
4076 high
= ~high
+ !low
;
4079 /* Would "%x%0*x" or "%x%*0x" get zero-padding on all
4081 sprintf (pp_buffer (pp
)->digit_buffer
,
4082 HOST_WIDE_INT_PRINT_DOUBLE_HEX
,
4083 (unsigned HOST_WIDE_INT
) high
, low
);
4084 pp_string (pp
, pp_buffer (pp
)->digit_buffer
);