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 /* Print a single expression T to string, and return it. */
168 print_generic_expr_to_str (tree t
)
171 dump_generic_node (&pp
, t
, 0, TDF_VOPS
|TDF_MEMSYMS
, false);
172 return xstrdup (pp_formatted_text (&pp
));
175 /* Dump NAME, an IDENTIFIER_POINTER, sanitized so that D<num> sequences
176 in it are replaced with Dxxxx, as long as they are at the start or
177 preceded by $ and at the end or followed by $. See make_fancy_name
181 dump_fancy_name (pretty_printer
*pp
, tree name
)
184 int length
= IDENTIFIER_LENGTH (name
);
185 const char *n
= IDENTIFIER_POINTER (name
);
192 && (n
== IDENTIFIER_POINTER (name
) || n
[-1] == '$'))
195 while (ISDIGIT (n
[l
]))
197 if (n
[l
] == '\0' || n
[l
] == '$')
210 pp_tree_identifier (pp
, name
);
214 char *str
= XNEWVEC (char, length
+ 1);
217 q
= n
= IDENTIFIER_POINTER (name
);
224 && (q
== IDENTIFIER_POINTER (name
) || q
[-1] == '$'))
227 while (ISDIGIT (q
[l
]))
229 if (q
[l
] == '\0' || q
[l
] == '$')
231 memcpy (p
, n
, q
- n
);
232 memcpy (p
+ (q
- n
), "Dxxxx", 5);
242 memcpy (p
, n
, IDENTIFIER_LENGTH (name
) - (n
- IDENTIFIER_POINTER (name
)));
244 if (pp_translate_identifiers (pp
))
246 const char *text
= identifier_to_locale (str
);
247 pp_append_text (pp
, text
, text
+ strlen (text
));
250 pp_append_text (pp
, str
, str
+ length
);
254 /* Dump the name of a _DECL node and its DECL_UID if TDF_UID is set
258 dump_decl_name (pretty_printer
*pp
, tree node
, dump_flags_t flags
)
260 tree name
= DECL_NAME (node
);
263 if ((flags
& TDF_ASMNAME
)
264 && HAS_DECL_ASSEMBLER_NAME_P (node
)
265 && DECL_ASSEMBLER_NAME_SET_P (node
))
266 pp_tree_identifier (pp
, DECL_ASSEMBLER_NAME_RAW (node
));
267 /* For -fcompare-debug don't dump DECL_NAMELESS names at all,
268 -g might have created more fancy names and their indexes
269 could get out of sync. Usually those should be DECL_IGNORED_P
270 too, SRA can create even non-DECL_IGNORED_P DECL_NAMELESS fancy
271 names, let's hope those never get out of sync after doing the
272 dump_fancy_name sanitization. */
273 else if ((flags
& TDF_COMPARE_DEBUG
)
274 && DECL_NAMELESS (node
)
275 && DECL_IGNORED_P (node
))
277 /* For DECL_NAMELESS names look for embedded uids in the
278 names and sanitize them for TDF_NOUID. */
279 else if ((flags
& TDF_NOUID
) && DECL_NAMELESS (node
))
280 dump_fancy_name (pp
, name
);
282 pp_tree_identifier (pp
, name
);
284 char uid_sep
= (flags
& TDF_GIMPLE
) ? '_' : '.';
285 if ((flags
& TDF_UID
) || name
== NULL_TREE
)
287 if (TREE_CODE (node
) == LABEL_DECL
&& LABEL_DECL_UID (node
) != -1)
288 pp_printf (pp
, "L%c%d", uid_sep
, (int) LABEL_DECL_UID (node
));
289 else if (TREE_CODE (node
) == DEBUG_EXPR_DECL
)
291 if (flags
& TDF_NOUID
)
292 pp_string (pp
, "D#xxxx");
294 pp_printf (pp
, "D#%i", DEBUG_TEMP_UID (node
));
298 char c
= TREE_CODE (node
) == CONST_DECL
? 'C' : 'D';
299 if (flags
& TDF_NOUID
)
300 pp_printf (pp
, "%c.xxxx", c
);
302 pp_printf (pp
, "%c%c%u", c
, uid_sep
, DECL_UID (node
));
305 if ((flags
& TDF_ALIAS
) && DECL_PT_UID (node
) != DECL_UID (node
))
307 if (flags
& TDF_NOUID
)
308 pp_printf (pp
, "ptD.xxxx");
310 pp_printf (pp
, "ptD.%u", DECL_PT_UID (node
));
314 /* Like the above, but used for pretty printing function calls. */
317 dump_function_name (pretty_printer
*pp
, tree node
, dump_flags_t flags
)
319 if (CONVERT_EXPR_P (node
))
320 node
= TREE_OPERAND (node
, 0);
321 if (DECL_NAME (node
) && (flags
& TDF_ASMNAME
) == 0)
322 pp_string (pp
, lang_hooks
.decl_printable_name (node
, 1));
324 dump_decl_name (pp
, node
, flags
);
327 /* Dump a function declaration. NODE is the FUNCTION_TYPE. PP, SPC and
328 FLAGS are as in dump_generic_node. */
331 dump_function_declaration (pretty_printer
*pp
, tree node
,
332 int spc
, dump_flags_t flags
)
334 bool wrote_arg
= false;
340 /* Print the argument types. */
341 arg
= TYPE_ARG_TYPES (node
);
342 while (arg
&& arg
!= void_list_node
&& arg
!= error_mark_node
)
350 dump_generic_node (pp
, TREE_VALUE (arg
), spc
, flags
, false);
351 arg
= TREE_CHAIN (arg
);
354 /* Drop the trailing void_type_node if we had any previous argument. */
355 if (arg
== void_list_node
&& !wrote_arg
)
356 pp_string (pp
, "void");
357 /* Properly dump vararg function types. */
358 else if (!arg
&& wrote_arg
)
359 pp_string (pp
, ", ...");
360 /* Avoid printing any arg for unprototyped functions. */
365 /* Dump the domain associated with an array. */
368 dump_array_domain (pretty_printer
*pp
, tree domain
, int spc
, dump_flags_t flags
)
370 pp_left_bracket (pp
);
373 tree min
= TYPE_MIN_VALUE (domain
);
374 tree max
= TYPE_MAX_VALUE (domain
);
377 && integer_zerop (min
)
378 && tree_fits_shwi_p (max
))
379 pp_wide_integer (pp
, tree_to_shwi (max
) + 1);
383 dump_generic_node (pp
, min
, spc
, flags
, false);
386 dump_generic_node (pp
, max
, spc
, flags
, false);
390 pp_string (pp
, "<unknown>");
391 pp_right_bracket (pp
);
395 /* Dump OpenMP clause CLAUSE. PP, CLAUSE, SPC and FLAGS are as in
396 dump_generic_node. */
399 dump_omp_clause (pretty_printer
*pp
, tree clause
, int spc
, dump_flags_t flags
)
403 switch (OMP_CLAUSE_CODE (clause
))
405 case OMP_CLAUSE_PRIVATE
:
408 case OMP_CLAUSE_SHARED
:
411 case OMP_CLAUSE_FIRSTPRIVATE
:
412 name
= "firstprivate";
414 case OMP_CLAUSE_LASTPRIVATE
:
415 name
= "lastprivate";
417 case OMP_CLAUSE_COPYIN
:
420 case OMP_CLAUSE_COPYPRIVATE
:
421 name
= "copyprivate";
423 case OMP_CLAUSE_UNIFORM
:
426 case OMP_CLAUSE_USE_DEVICE_PTR
:
427 name
= "use_device_ptr";
429 case OMP_CLAUSE_IS_DEVICE_PTR
:
430 name
= "is_device_ptr";
432 case OMP_CLAUSE__LOOPTEMP_
:
435 case OMP_CLAUSE_TO_DECLARE
:
438 case OMP_CLAUSE_LINK
:
442 pp_string (pp
, name
);
444 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
449 case OMP_CLAUSE_REDUCTION
:
450 pp_string (pp
, "reduction(");
451 if (OMP_CLAUSE_REDUCTION_CODE (clause
) != ERROR_MARK
)
454 op_symbol_code (OMP_CLAUSE_REDUCTION_CODE (clause
)));
457 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
463 pp_string (pp
, "if(");
464 switch (OMP_CLAUSE_IF_MODIFIER (clause
))
466 case ERROR_MARK
: break;
467 case OMP_PARALLEL
: pp_string (pp
, "parallel:"); break;
468 case OMP_TASK
: pp_string (pp
, "task:"); break;
469 case OMP_TASKLOOP
: pp_string (pp
, "taskloop:"); break;
470 case OMP_TARGET_DATA
: pp_string (pp
, "target data:"); break;
471 case OMP_TARGET
: pp_string (pp
, "target:"); break;
472 case OMP_TARGET_UPDATE
: pp_string (pp
, "target update:"); break;
473 case OMP_TARGET_ENTER_DATA
:
474 pp_string (pp
, "target enter data:"); break;
475 case OMP_TARGET_EXIT_DATA
: pp_string (pp
, "target exit data:"); break;
476 default: gcc_unreachable ();
478 dump_generic_node (pp
, OMP_CLAUSE_IF_EXPR (clause
),
483 case OMP_CLAUSE_NUM_THREADS
:
484 pp_string (pp
, "num_threads(");
485 dump_generic_node (pp
, OMP_CLAUSE_NUM_THREADS_EXPR (clause
),
490 case OMP_CLAUSE_NOWAIT
:
491 pp_string (pp
, "nowait");
493 case OMP_CLAUSE_ORDERED
:
494 pp_string (pp
, "ordered");
495 if (OMP_CLAUSE_ORDERED_EXPR (clause
))
498 dump_generic_node (pp
, OMP_CLAUSE_ORDERED_EXPR (clause
),
504 case OMP_CLAUSE_DEFAULT
:
505 pp_string (pp
, "default(");
506 switch (OMP_CLAUSE_DEFAULT_KIND (clause
))
508 case OMP_CLAUSE_DEFAULT_UNSPECIFIED
:
510 case OMP_CLAUSE_DEFAULT_SHARED
:
511 pp_string (pp
, "shared");
513 case OMP_CLAUSE_DEFAULT_NONE
:
514 pp_string (pp
, "none");
516 case OMP_CLAUSE_DEFAULT_PRIVATE
:
517 pp_string (pp
, "private");
519 case OMP_CLAUSE_DEFAULT_FIRSTPRIVATE
:
520 pp_string (pp
, "firstprivate");
522 case OMP_CLAUSE_DEFAULT_PRESENT
:
523 pp_string (pp
, "present");
531 case OMP_CLAUSE_SCHEDULE
:
532 pp_string (pp
, "schedule(");
533 if (OMP_CLAUSE_SCHEDULE_KIND (clause
)
534 & (OMP_CLAUSE_SCHEDULE_MONOTONIC
535 | OMP_CLAUSE_SCHEDULE_NONMONOTONIC
))
537 if (OMP_CLAUSE_SCHEDULE_KIND (clause
)
538 & OMP_CLAUSE_SCHEDULE_MONOTONIC
)
539 pp_string (pp
, "monotonic");
541 pp_string (pp
, "nonmonotonic");
542 if (OMP_CLAUSE_SCHEDULE_SIMD (clause
))
547 if (OMP_CLAUSE_SCHEDULE_SIMD (clause
))
548 pp_string (pp
, "simd:");
550 switch (OMP_CLAUSE_SCHEDULE_KIND (clause
) & OMP_CLAUSE_SCHEDULE_MASK
)
552 case OMP_CLAUSE_SCHEDULE_STATIC
:
553 pp_string (pp
, "static");
555 case OMP_CLAUSE_SCHEDULE_DYNAMIC
:
556 pp_string (pp
, "dynamic");
558 case OMP_CLAUSE_SCHEDULE_GUIDED
:
559 pp_string (pp
, "guided");
561 case OMP_CLAUSE_SCHEDULE_RUNTIME
:
562 pp_string (pp
, "runtime");
564 case OMP_CLAUSE_SCHEDULE_AUTO
:
565 pp_string (pp
, "auto");
570 if (OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (clause
))
573 dump_generic_node (pp
, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (clause
),
579 case OMP_CLAUSE_UNTIED
:
580 pp_string (pp
, "untied");
583 case OMP_CLAUSE_COLLAPSE
:
584 pp_string (pp
, "collapse(");
585 dump_generic_node (pp
, OMP_CLAUSE_COLLAPSE_EXPR (clause
),
590 case OMP_CLAUSE_FINAL
:
591 pp_string (pp
, "final(");
592 dump_generic_node (pp
, OMP_CLAUSE_FINAL_EXPR (clause
),
597 case OMP_CLAUSE_MERGEABLE
:
598 pp_string (pp
, "mergeable");
601 case OMP_CLAUSE_LINEAR
:
602 pp_string (pp
, "linear(");
603 switch (OMP_CLAUSE_LINEAR_KIND (clause
))
605 case OMP_CLAUSE_LINEAR_DEFAULT
:
607 case OMP_CLAUSE_LINEAR_REF
:
608 pp_string (pp
, "ref(");
610 case OMP_CLAUSE_LINEAR_VAL
:
611 pp_string (pp
, "val(");
613 case OMP_CLAUSE_LINEAR_UVAL
:
614 pp_string (pp
, "uval(");
619 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
621 if (OMP_CLAUSE_LINEAR_KIND (clause
) != OMP_CLAUSE_LINEAR_DEFAULT
)
624 dump_generic_node (pp
, OMP_CLAUSE_LINEAR_STEP (clause
),
629 case OMP_CLAUSE_ALIGNED
:
630 pp_string (pp
, "aligned(");
631 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
633 if (OMP_CLAUSE_ALIGNED_ALIGNMENT (clause
))
636 dump_generic_node (pp
, OMP_CLAUSE_ALIGNED_ALIGNMENT (clause
),
642 case OMP_CLAUSE_DEPEND
:
643 pp_string (pp
, "depend(");
644 switch (OMP_CLAUSE_DEPEND_KIND (clause
))
646 case OMP_CLAUSE_DEPEND_IN
:
647 pp_string (pp
, "in");
649 case OMP_CLAUSE_DEPEND_OUT
:
650 pp_string (pp
, "out");
652 case OMP_CLAUSE_DEPEND_INOUT
:
653 pp_string (pp
, "inout");
655 case OMP_CLAUSE_DEPEND_SOURCE
:
656 pp_string (pp
, "source)");
658 case OMP_CLAUSE_DEPEND_SINK
:
659 pp_string (pp
, "sink:");
660 for (tree t
= OMP_CLAUSE_DECL (clause
); t
; t
= TREE_CHAIN (t
))
661 if (TREE_CODE (t
) == TREE_LIST
)
663 dump_generic_node (pp
, TREE_VALUE (t
), spc
, flags
, false);
664 if (TREE_PURPOSE (t
) != integer_zero_node
)
666 if (OMP_CLAUSE_DEPEND_SINK_NEGATIVE (t
))
670 dump_generic_node (pp
, TREE_PURPOSE (t
), spc
, flags
,
684 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
690 pp_string (pp
, "map(");
691 switch (OMP_CLAUSE_MAP_KIND (clause
))
694 case GOMP_MAP_POINTER
:
695 pp_string (pp
, "alloc");
698 case GOMP_MAP_TO_PSET
:
699 pp_string (pp
, "to");
702 pp_string (pp
, "from");
704 case GOMP_MAP_TOFROM
:
705 pp_string (pp
, "tofrom");
707 case GOMP_MAP_FORCE_ALLOC
:
708 pp_string (pp
, "force_alloc");
710 case GOMP_MAP_FORCE_TO
:
711 pp_string (pp
, "force_to");
713 case GOMP_MAP_FORCE_FROM
:
714 pp_string (pp
, "force_from");
716 case GOMP_MAP_FORCE_TOFROM
:
717 pp_string (pp
, "force_tofrom");
719 case GOMP_MAP_FORCE_PRESENT
:
720 pp_string (pp
, "force_present");
722 case GOMP_MAP_DELETE
:
723 pp_string (pp
, "delete");
725 case GOMP_MAP_FORCE_DEVICEPTR
:
726 pp_string (pp
, "force_deviceptr");
728 case GOMP_MAP_ALWAYS_TO
:
729 pp_string (pp
, "always,to");
731 case GOMP_MAP_ALWAYS_FROM
:
732 pp_string (pp
, "always,from");
734 case GOMP_MAP_ALWAYS_TOFROM
:
735 pp_string (pp
, "always,tofrom");
737 case GOMP_MAP_RELEASE
:
738 pp_string (pp
, "release");
740 case GOMP_MAP_FIRSTPRIVATE_POINTER
:
741 pp_string (pp
, "firstprivate");
743 case GOMP_MAP_FIRSTPRIVATE_REFERENCE
:
744 pp_string (pp
, "firstprivate ref");
746 case GOMP_MAP_STRUCT
:
747 pp_string (pp
, "struct");
749 case GOMP_MAP_ALWAYS_POINTER
:
750 pp_string (pp
, "always_pointer");
752 case GOMP_MAP_DEVICE_RESIDENT
:
753 pp_string (pp
, "device_resident");
756 pp_string (pp
, "link");
762 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
765 if (OMP_CLAUSE_SIZE (clause
))
767 switch (OMP_CLAUSE_CODE (clause
) == OMP_CLAUSE_MAP
768 ? OMP_CLAUSE_MAP_KIND (clause
) : GOMP_MAP_TO
)
770 case GOMP_MAP_POINTER
:
771 case GOMP_MAP_FIRSTPRIVATE_POINTER
:
772 case GOMP_MAP_FIRSTPRIVATE_REFERENCE
:
773 case GOMP_MAP_ALWAYS_POINTER
:
774 pp_string (pp
, " [pointer assign, bias: ");
776 case GOMP_MAP_TO_PSET
:
777 pp_string (pp
, " [pointer set, len: ");
780 pp_string (pp
, " [len: ");
783 dump_generic_node (pp
, OMP_CLAUSE_SIZE (clause
),
785 pp_right_bracket (pp
);
790 case OMP_CLAUSE_FROM
:
791 pp_string (pp
, "from(");
792 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
794 goto print_clause_size
;
797 pp_string (pp
, "to(");
798 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
800 goto print_clause_size
;
802 case OMP_CLAUSE__CACHE_
:
804 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
806 goto print_clause_size
;
808 case OMP_CLAUSE_NUM_TEAMS
:
809 pp_string (pp
, "num_teams(");
810 dump_generic_node (pp
, OMP_CLAUSE_NUM_TEAMS_EXPR (clause
),
815 case OMP_CLAUSE_THREAD_LIMIT
:
816 pp_string (pp
, "thread_limit(");
817 dump_generic_node (pp
, OMP_CLAUSE_THREAD_LIMIT_EXPR (clause
),
822 case OMP_CLAUSE_DEVICE
:
823 pp_string (pp
, "device(");
824 dump_generic_node (pp
, OMP_CLAUSE_DEVICE_ID (clause
),
829 case OMP_CLAUSE_DIST_SCHEDULE
:
830 pp_string (pp
, "dist_schedule(static");
831 if (OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR (clause
))
834 dump_generic_node (pp
,
835 OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR (clause
),
841 case OMP_CLAUSE_PROC_BIND
:
842 pp_string (pp
, "proc_bind(");
843 switch (OMP_CLAUSE_PROC_BIND_KIND (clause
))
845 case OMP_CLAUSE_PROC_BIND_MASTER
:
846 pp_string (pp
, "master");
848 case OMP_CLAUSE_PROC_BIND_CLOSE
:
849 pp_string (pp
, "close");
851 case OMP_CLAUSE_PROC_BIND_SPREAD
:
852 pp_string (pp
, "spread");
860 case OMP_CLAUSE_SAFELEN
:
861 pp_string (pp
, "safelen(");
862 dump_generic_node (pp
, OMP_CLAUSE_SAFELEN_EXPR (clause
),
867 case OMP_CLAUSE_SIMDLEN
:
868 pp_string (pp
, "simdlen(");
869 dump_generic_node (pp
, OMP_CLAUSE_SIMDLEN_EXPR (clause
),
874 case OMP_CLAUSE_PRIORITY
:
875 pp_string (pp
, "priority(");
876 dump_generic_node (pp
, OMP_CLAUSE_PRIORITY_EXPR (clause
),
881 case OMP_CLAUSE_GRAINSIZE
:
882 pp_string (pp
, "grainsize(");
883 dump_generic_node (pp
, OMP_CLAUSE_GRAINSIZE_EXPR (clause
),
888 case OMP_CLAUSE_NUM_TASKS
:
889 pp_string (pp
, "num_tasks(");
890 dump_generic_node (pp
, OMP_CLAUSE_NUM_TASKS_EXPR (clause
),
895 case OMP_CLAUSE_HINT
:
896 pp_string (pp
, "hint(");
897 dump_generic_node (pp
, OMP_CLAUSE_HINT_EXPR (clause
),
902 case OMP_CLAUSE_DEFAULTMAP
:
903 pp_string (pp
, "defaultmap(tofrom:scalar)");
906 case OMP_CLAUSE__SIMDUID_
:
907 pp_string (pp
, "_simduid_(");
908 dump_generic_node (pp
, OMP_CLAUSE__SIMDUID__DECL (clause
),
913 case OMP_CLAUSE__SIMT_
:
914 pp_string (pp
, "_simt_");
917 case OMP_CLAUSE_GANG
:
918 pp_string (pp
, "gang");
919 if (OMP_CLAUSE_GANG_EXPR (clause
) != NULL_TREE
)
921 pp_string (pp
, "(num: ");
922 dump_generic_node (pp
, OMP_CLAUSE_GANG_EXPR (clause
),
925 if (OMP_CLAUSE_GANG_STATIC_EXPR (clause
) != NULL_TREE
)
927 if (OMP_CLAUSE_GANG_EXPR (clause
) == NULL_TREE
)
931 pp_string (pp
, "static:");
932 if (OMP_CLAUSE_GANG_STATIC_EXPR (clause
)
933 == integer_minus_one_node
)
934 pp_character (pp
, '*');
936 dump_generic_node (pp
, OMP_CLAUSE_GANG_STATIC_EXPR (clause
),
939 if (OMP_CLAUSE_GANG_EXPR (clause
) != NULL_TREE
940 || OMP_CLAUSE_GANG_STATIC_EXPR (clause
) != NULL_TREE
)
944 case OMP_CLAUSE_ASYNC
:
945 pp_string (pp
, "async");
946 if (OMP_CLAUSE_ASYNC_EXPR (clause
))
948 pp_character(pp
, '(');
949 dump_generic_node (pp
, OMP_CLAUSE_ASYNC_EXPR (clause
),
951 pp_character(pp
, ')');
955 case OMP_CLAUSE_AUTO
:
957 pp_string (pp
, omp_clause_code_name
[OMP_CLAUSE_CODE (clause
)]);
960 case OMP_CLAUSE_WAIT
:
961 pp_string (pp
, "wait(");
962 dump_generic_node (pp
, OMP_CLAUSE_WAIT_EXPR (clause
),
964 pp_character(pp
, ')');
967 case OMP_CLAUSE_WORKER
:
968 pp_string (pp
, "worker");
969 if (OMP_CLAUSE_WORKER_EXPR (clause
) != NULL_TREE
)
972 dump_generic_node (pp
, OMP_CLAUSE_WORKER_EXPR (clause
),
978 case OMP_CLAUSE_VECTOR
:
979 pp_string (pp
, "vector");
980 if (OMP_CLAUSE_VECTOR_EXPR (clause
) != NULL_TREE
)
983 dump_generic_node (pp
, OMP_CLAUSE_VECTOR_EXPR (clause
),
989 case OMP_CLAUSE_NUM_GANGS
:
990 pp_string (pp
, "num_gangs(");
991 dump_generic_node (pp
, OMP_CLAUSE_NUM_GANGS_EXPR (clause
),
993 pp_character (pp
, ')');
996 case OMP_CLAUSE_NUM_WORKERS
:
997 pp_string (pp
, "num_workers(");
998 dump_generic_node (pp
, OMP_CLAUSE_NUM_WORKERS_EXPR (clause
),
1000 pp_character (pp
, ')');
1003 case OMP_CLAUSE_VECTOR_LENGTH
:
1004 pp_string (pp
, "vector_length(");
1005 dump_generic_node (pp
, OMP_CLAUSE_VECTOR_LENGTH_EXPR (clause
),
1007 pp_character (pp
, ')');
1010 case OMP_CLAUSE_INBRANCH
:
1011 pp_string (pp
, "inbranch");
1013 case OMP_CLAUSE_NOTINBRANCH
:
1014 pp_string (pp
, "notinbranch");
1016 case OMP_CLAUSE_FOR
:
1017 pp_string (pp
, "for");
1019 case OMP_CLAUSE_PARALLEL
:
1020 pp_string (pp
, "parallel");
1022 case OMP_CLAUSE_SECTIONS
:
1023 pp_string (pp
, "sections");
1025 case OMP_CLAUSE_TASKGROUP
:
1026 pp_string (pp
, "taskgroup");
1028 case OMP_CLAUSE_NOGROUP
:
1029 pp_string (pp
, "nogroup");
1031 case OMP_CLAUSE_THREADS
:
1032 pp_string (pp
, "threads");
1034 case OMP_CLAUSE_SIMD
:
1035 pp_string (pp
, "simd");
1037 case OMP_CLAUSE_INDEPENDENT
:
1038 pp_string (pp
, "independent");
1040 case OMP_CLAUSE_TILE
:
1041 pp_string (pp
, "tile(");
1042 dump_generic_node (pp
, OMP_CLAUSE_TILE_LIST (clause
),
1044 pp_right_paren (pp
);
1047 case OMP_CLAUSE__GRIDDIM_
:
1048 pp_string (pp
, "_griddim_(");
1049 pp_unsigned_wide_integer (pp
, OMP_CLAUSE__GRIDDIM__DIMENSION (clause
));
1051 dump_generic_node (pp
, OMP_CLAUSE__GRIDDIM__SIZE (clause
), spc
, flags
,
1054 dump_generic_node (pp
, OMP_CLAUSE__GRIDDIM__GROUP (clause
), spc
, flags
,
1056 pp_right_paren (pp
);
1058 case OMP_CLAUSE_IF_PRESENT
:
1059 pp_string (pp
, "if_present");
1061 case OMP_CLAUSE_FINALIZE
:
1062 pp_string (pp
, "finalize");
1066 /* Should never happen. */
1067 dump_generic_node (pp
, clause
, spc
, flags
, false);
1073 /* Dump the list of OpenMP clauses. PP, SPC and FLAGS are as in
1074 dump_generic_node. */
1077 dump_omp_clauses (pretty_printer
*pp
, tree clause
, int spc
, dump_flags_t flags
)
1085 dump_omp_clause (pp
, clause
, spc
, flags
);
1086 clause
= OMP_CLAUSE_CHAIN (clause
);
1094 /* Dump location LOC to PP. */
1097 dump_location (pretty_printer
*pp
, location_t loc
)
1099 expanded_location xloc
= expand_location (loc
);
1101 pp_left_bracket (pp
);
1104 pp_string (pp
, xloc
.file
);
1105 pp_string (pp
, ":");
1107 pp_decimal_int (pp
, xloc
.line
);
1109 pp_decimal_int (pp
, xloc
.column
);
1110 pp_string (pp
, "] ");
1114 /* Dump lexical block BLOCK. PP, SPC and FLAGS are as in
1115 dump_generic_node. */
1118 dump_block_node (pretty_printer
*pp
, tree block
, int spc
, dump_flags_t flags
)
1122 pp_printf (pp
, "BLOCK #%d ", BLOCK_NUMBER (block
));
1124 if (flags
& TDF_ADDRESS
)
1125 pp_printf (pp
, "[%p] ", (void *) block
);
1127 if (TREE_ASM_WRITTEN (block
))
1128 pp_string (pp
, "[written] ");
1130 if (flags
& TDF_SLIM
)
1133 if (BLOCK_SOURCE_LOCATION (block
))
1134 dump_location (pp
, BLOCK_SOURCE_LOCATION (block
));
1136 newline_and_indent (pp
, spc
+ 2);
1138 if (BLOCK_SUPERCONTEXT (block
))
1140 pp_string (pp
, "SUPERCONTEXT: ");
1141 dump_generic_node (pp
, BLOCK_SUPERCONTEXT (block
), 0,
1142 flags
| TDF_SLIM
, false);
1143 newline_and_indent (pp
, spc
+ 2);
1146 if (BLOCK_SUBBLOCKS (block
))
1148 pp_string (pp
, "SUBBLOCKS: ");
1149 for (t
= BLOCK_SUBBLOCKS (block
); t
; t
= BLOCK_CHAIN (t
))
1151 dump_generic_node (pp
, t
, 0, flags
| TDF_SLIM
, false);
1154 newline_and_indent (pp
, spc
+ 2);
1157 if (BLOCK_CHAIN (block
))
1159 pp_string (pp
, "SIBLINGS: ");
1160 for (t
= BLOCK_CHAIN (block
); t
; t
= BLOCK_CHAIN (t
))
1162 dump_generic_node (pp
, t
, 0, flags
| TDF_SLIM
, false);
1165 newline_and_indent (pp
, spc
+ 2);
1168 if (BLOCK_VARS (block
))
1170 pp_string (pp
, "VARS: ");
1171 for (t
= BLOCK_VARS (block
); t
; t
= TREE_CHAIN (t
))
1173 dump_generic_node (pp
, t
, 0, flags
, false);
1176 newline_and_indent (pp
, spc
+ 2);
1179 if (vec_safe_length (BLOCK_NONLOCALIZED_VARS (block
)) > 0)
1182 vec
<tree
, va_gc
> *nlv
= BLOCK_NONLOCALIZED_VARS (block
);
1184 pp_string (pp
, "NONLOCALIZED_VARS: ");
1185 FOR_EACH_VEC_ELT (*nlv
, i
, t
)
1187 dump_generic_node (pp
, t
, 0, flags
, false);
1190 newline_and_indent (pp
, spc
+ 2);
1193 if (BLOCK_ABSTRACT_ORIGIN (block
))
1195 pp_string (pp
, "ABSTRACT_ORIGIN: ");
1196 dump_generic_node (pp
, BLOCK_ABSTRACT_ORIGIN (block
), 0,
1197 flags
| TDF_SLIM
, false);
1198 newline_and_indent (pp
, spc
+ 2);
1201 if (BLOCK_FRAGMENT_ORIGIN (block
))
1203 pp_string (pp
, "FRAGMENT_ORIGIN: ");
1204 dump_generic_node (pp
, BLOCK_FRAGMENT_ORIGIN (block
), 0,
1205 flags
| TDF_SLIM
, false);
1206 newline_and_indent (pp
, spc
+ 2);
1209 if (BLOCK_FRAGMENT_CHAIN (block
))
1211 pp_string (pp
, "FRAGMENT_CHAIN: ");
1212 for (t
= BLOCK_FRAGMENT_CHAIN (block
); t
; t
= BLOCK_FRAGMENT_CHAIN (t
))
1214 dump_generic_node (pp
, t
, 0, flags
| TDF_SLIM
, false);
1217 newline_and_indent (pp
, spc
+ 2);
1222 /* Dump the node NODE on the pretty_printer PP, SPC spaces of
1223 indent. FLAGS specifies details to show in the dump (see TDF_* in
1224 dumpfile.h). If IS_STMT is true, the object printed is considered
1225 to be a statement and it is terminated by ';' if appropriate. */
1228 dump_generic_node (pretty_printer
*pp
, tree node
, int spc
, dump_flags_t flags
,
1235 enum tree_code code
;
1237 if (node
== NULL_TREE
)
1240 is_expr
= EXPR_P (node
);
1242 if (is_stmt
&& (flags
& TDF_STMTADDR
))
1243 pp_printf (pp
, "<&%p> ", (void *)node
);
1245 if ((flags
& TDF_LINENO
) && EXPR_HAS_LOCATION (node
))
1246 dump_location (pp
, EXPR_LOCATION (node
));
1248 code
= TREE_CODE (node
);
1252 pp_string (pp
, "<<< error >>>");
1255 case IDENTIFIER_NODE
:
1256 pp_tree_identifier (pp
, node
);
1260 while (node
&& node
!= error_mark_node
)
1262 if (TREE_PURPOSE (node
))
1264 dump_generic_node (pp
, TREE_PURPOSE (node
), spc
, flags
, false);
1267 dump_generic_node (pp
, TREE_VALUE (node
), spc
, flags
, false);
1268 node
= TREE_CHAIN (node
);
1269 if (node
&& TREE_CODE (node
) == TREE_LIST
)
1278 dump_generic_node (pp
, BINFO_TYPE (node
), spc
, flags
, false);
1284 if (TREE_VEC_LENGTH (node
) > 0)
1286 size_t len
= TREE_VEC_LENGTH (node
);
1287 for (i
= 0; i
< len
- 1; i
++)
1289 dump_generic_node (pp
, TREE_VEC_ELT (node
, i
), spc
, flags
,
1294 dump_generic_node (pp
, TREE_VEC_ELT (node
, len
- 1), spc
,
1303 case FIXED_POINT_TYPE
:
1309 unsigned int quals
= TYPE_QUALS (node
);
1310 enum tree_code_class tclass
;
1312 if (quals
& TYPE_QUAL_ATOMIC
)
1313 pp_string (pp
, "atomic ");
1314 if (quals
& TYPE_QUAL_CONST
)
1315 pp_string (pp
, "const ");
1316 else if (quals
& TYPE_QUAL_VOLATILE
)
1317 pp_string (pp
, "volatile ");
1318 else if (quals
& TYPE_QUAL_RESTRICT
)
1319 pp_string (pp
, "restrict ");
1321 if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node
)))
1323 pp_string (pp
, "<address-space-");
1324 pp_decimal_int (pp
, TYPE_ADDR_SPACE (node
));
1325 pp_string (pp
, "> ");
1328 tclass
= TREE_CODE_CLASS (TREE_CODE (node
));
1330 if (tclass
== tcc_declaration
)
1332 if (DECL_NAME (node
))
1333 dump_decl_name (pp
, node
, flags
);
1335 pp_string (pp
, "<unnamed type decl>");
1337 else if (tclass
== tcc_type
)
1339 if (TYPE_NAME (node
))
1341 if (TREE_CODE (TYPE_NAME (node
)) == IDENTIFIER_NODE
)
1342 pp_tree_identifier (pp
, TYPE_NAME (node
));
1343 else if (TREE_CODE (TYPE_NAME (node
)) == TYPE_DECL
1344 && DECL_NAME (TYPE_NAME (node
)))
1345 dump_decl_name (pp
, TYPE_NAME (node
), flags
);
1347 pp_string (pp
, "<unnamed type>");
1349 else if (TREE_CODE (node
) == VECTOR_TYPE
)
1351 pp_string (pp
, "vector");
1353 pp_wide_integer (pp
, TYPE_VECTOR_SUBPARTS (node
));
1354 pp_string (pp
, ") ");
1355 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1357 else if (TREE_CODE (node
) == INTEGER_TYPE
)
1359 if (TYPE_PRECISION (node
) == CHAR_TYPE_SIZE
)
1360 pp_string (pp
, (TYPE_UNSIGNED (node
)
1363 else if (TYPE_PRECISION (node
) == SHORT_TYPE_SIZE
)
1364 pp_string (pp
, (TYPE_UNSIGNED (node
)
1367 else if (TYPE_PRECISION (node
) == INT_TYPE_SIZE
)
1368 pp_string (pp
, (TYPE_UNSIGNED (node
)
1371 else if (TYPE_PRECISION (node
) == LONG_TYPE_SIZE
)
1372 pp_string (pp
, (TYPE_UNSIGNED (node
)
1375 else if (TYPE_PRECISION (node
) == LONG_LONG_TYPE_SIZE
)
1376 pp_string (pp
, (TYPE_UNSIGNED (node
)
1377 ? "unsigned long long"
1378 : "signed long long"));
1379 else if (TYPE_PRECISION (node
) >= CHAR_TYPE_SIZE
1380 && pow2p_hwi (TYPE_PRECISION (node
)))
1382 pp_string (pp
, (TYPE_UNSIGNED (node
) ? "uint" : "int"));
1383 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1384 pp_string (pp
, "_t");
1388 pp_string (pp
, (TYPE_UNSIGNED (node
)
1389 ? "<unnamed-unsigned:"
1390 : "<unnamed-signed:"));
1391 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1395 else if (TREE_CODE (node
) == COMPLEX_TYPE
)
1397 pp_string (pp
, "__complex__ ");
1398 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1400 else if (TREE_CODE (node
) == REAL_TYPE
)
1402 pp_string (pp
, "<float:");
1403 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1406 else if (TREE_CODE (node
) == FIXED_POINT_TYPE
)
1408 pp_string (pp
, "<fixed-point-");
1409 pp_string (pp
, TYPE_SATURATING (node
) ? "sat:" : "nonsat:");
1410 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1413 else if (TREE_CODE (node
) == VOID_TYPE
)
1414 pp_string (pp
, "void");
1416 pp_string (pp
, "<unnamed type>");
1422 case REFERENCE_TYPE
:
1423 str
= (TREE_CODE (node
) == POINTER_TYPE
? "*" : "&");
1425 if (TREE_TYPE (node
) == NULL
)
1427 pp_string (pp
, str
);
1428 pp_string (pp
, "<null type>");
1430 else if (TREE_CODE (TREE_TYPE (node
)) == FUNCTION_TYPE
)
1432 tree fnode
= TREE_TYPE (node
);
1434 dump_generic_node (pp
, TREE_TYPE (fnode
), spc
, flags
, false);
1437 pp_string (pp
, str
);
1438 if (TYPE_IDENTIFIER (node
))
1439 dump_generic_node (pp
, TYPE_NAME (node
), spc
, flags
, false);
1440 else if (flags
& TDF_NOUID
)
1441 pp_printf (pp
, "<Txxxx>");
1443 pp_printf (pp
, "<T%x>", TYPE_UID (node
));
1445 pp_right_paren (pp
);
1446 dump_function_declaration (pp
, fnode
, spc
, flags
);
1450 unsigned int quals
= TYPE_QUALS (node
);
1452 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1454 pp_string (pp
, str
);
1456 if (quals
& TYPE_QUAL_CONST
)
1457 pp_string (pp
, " const");
1458 if (quals
& TYPE_QUAL_VOLATILE
)
1459 pp_string (pp
, " volatile");
1460 if (quals
& TYPE_QUAL_RESTRICT
)
1461 pp_string (pp
, " restrict");
1463 if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node
)))
1465 pp_string (pp
, " <address-space-");
1466 pp_decimal_int (pp
, TYPE_ADDR_SPACE (node
));
1470 if (TYPE_REF_CAN_ALIAS_ALL (node
))
1471 pp_string (pp
, " {ref-all}");
1481 if (flags
& TDF_GIMPLE
)
1483 pp_string (pp
, "__MEM <");
1484 dump_generic_node (pp
, TREE_TYPE (node
),
1485 spc
, flags
| TDF_SLIM
, false);
1486 if (TYPE_ALIGN (TREE_TYPE (node
))
1487 != TYPE_ALIGN (TYPE_MAIN_VARIANT (TREE_TYPE (node
))))
1489 pp_string (pp
, ", ");
1490 pp_decimal_int (pp
, TYPE_ALIGN (TREE_TYPE (node
)));
1493 pp_string (pp
, " (");
1494 if (TREE_TYPE (TREE_OPERAND (node
, 0))
1495 != TREE_TYPE (TREE_OPERAND (node
, 1)))
1498 dump_generic_node (pp
, TREE_TYPE (TREE_OPERAND (node
, 1)),
1499 spc
, flags
| TDF_SLIM
, false);
1500 pp_right_paren (pp
);
1502 dump_generic_node (pp
, TREE_OPERAND (node
, 0),
1503 spc
, flags
| TDF_SLIM
, false);
1504 if (! integer_zerop (TREE_OPERAND (node
, 1)))
1506 pp_string (pp
, " + ");
1507 dump_generic_node (pp
, TREE_OPERAND (node
, 1),
1508 spc
, flags
| TDF_SLIM
, false);
1510 pp_right_paren (pp
);
1512 else if (integer_zerop (TREE_OPERAND (node
, 1))
1513 /* Dump the types of INTEGER_CSTs explicitly, for we can't
1514 infer them and MEM_ATTR caching will share MEM_REFs
1515 with differently-typed op0s. */
1516 && TREE_CODE (TREE_OPERAND (node
, 0)) != INTEGER_CST
1517 /* Released SSA_NAMES have no TREE_TYPE. */
1518 && TREE_TYPE (TREE_OPERAND (node
, 0)) != NULL_TREE
1519 /* Same pointer types, but ignoring POINTER_TYPE vs.
1521 && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node
, 0)))
1522 == TREE_TYPE (TREE_TYPE (TREE_OPERAND (node
, 1))))
1523 && (TYPE_MODE (TREE_TYPE (TREE_OPERAND (node
, 0)))
1524 == TYPE_MODE (TREE_TYPE (TREE_OPERAND (node
, 1))))
1525 && (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node
, 0)))
1526 == TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node
, 1))))
1527 /* Same value types ignoring qualifiers. */
1528 && (TYPE_MAIN_VARIANT (TREE_TYPE (node
))
1529 == TYPE_MAIN_VARIANT
1530 (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node
, 1)))))
1531 && (!(flags
& TDF_ALIAS
)
1532 || MR_DEPENDENCE_CLIQUE (node
) == 0))
1534 if (TREE_CODE (TREE_OPERAND (node
, 0)) != ADDR_EXPR
)
1537 dump_generic_node (pp
, TREE_OPERAND (node
, 0),
1541 dump_generic_node (pp
,
1542 TREE_OPERAND (TREE_OPERAND (node
, 0), 0),
1549 pp_string (pp
, "MEM[");
1551 ptype
= TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (node
, 1)));
1552 dump_generic_node (pp
, ptype
,
1553 spc
, flags
| TDF_SLIM
, false);
1554 pp_right_paren (pp
);
1555 dump_generic_node (pp
, TREE_OPERAND (node
, 0),
1557 if (!integer_zerop (TREE_OPERAND (node
, 1)))
1559 pp_string (pp
, " + ");
1560 dump_generic_node (pp
, TREE_OPERAND (node
, 1),
1563 if ((flags
& TDF_ALIAS
)
1564 && MR_DEPENDENCE_CLIQUE (node
) != 0)
1566 pp_string (pp
, " clique ");
1567 pp_unsigned_wide_integer (pp
, MR_DEPENDENCE_CLIQUE (node
));
1568 pp_string (pp
, " base ");
1569 pp_unsigned_wide_integer (pp
, MR_DEPENDENCE_BASE (node
));
1571 pp_right_bracket (pp
);
1576 case TARGET_MEM_REF
:
1578 const char *sep
= "";
1581 pp_string (pp
, "MEM[");
1583 if (TREE_CODE (TMR_BASE (node
)) == ADDR_EXPR
)
1585 pp_string (pp
, sep
);
1587 pp_string (pp
, "symbol: ");
1588 dump_generic_node (pp
, TREE_OPERAND (TMR_BASE (node
), 0),
1593 pp_string (pp
, sep
);
1595 pp_string (pp
, "base: ");
1596 dump_generic_node (pp
, TMR_BASE (node
), spc
, flags
, false);
1598 tmp
= TMR_INDEX2 (node
);
1601 pp_string (pp
, sep
);
1603 pp_string (pp
, "base: ");
1604 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1606 tmp
= TMR_INDEX (node
);
1609 pp_string (pp
, sep
);
1611 pp_string (pp
, "index: ");
1612 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1614 tmp
= TMR_STEP (node
);
1617 pp_string (pp
, sep
);
1619 pp_string (pp
, "step: ");
1620 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1622 tmp
= TMR_OFFSET (node
);
1625 pp_string (pp
, sep
);
1627 pp_string (pp
, "offset: ");
1628 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1630 pp_right_bracket (pp
);
1638 /* Print the innermost component type. */
1639 for (tmp
= TREE_TYPE (node
); TREE_CODE (tmp
) == ARRAY_TYPE
;
1640 tmp
= TREE_TYPE (tmp
))
1642 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1644 /* Print the dimensions. */
1645 for (tmp
= node
; TREE_CODE (tmp
) == ARRAY_TYPE
; tmp
= TREE_TYPE (tmp
))
1646 dump_array_domain (pp
, TYPE_DOMAIN (tmp
), spc
, flags
);
1652 case QUAL_UNION_TYPE
:
1654 unsigned int quals
= TYPE_QUALS (node
);
1656 if (quals
& TYPE_QUAL_ATOMIC
)
1657 pp_string (pp
, "atomic ");
1658 if (quals
& TYPE_QUAL_CONST
)
1659 pp_string (pp
, "const ");
1660 if (quals
& TYPE_QUAL_VOLATILE
)
1661 pp_string (pp
, "volatile ");
1663 /* Print the name of the structure. */
1664 if (TREE_CODE (node
) == RECORD_TYPE
)
1665 pp_string (pp
, "struct ");
1666 else if (TREE_CODE (node
) == UNION_TYPE
)
1667 pp_string (pp
, "union ");
1669 if (TYPE_NAME (node
))
1670 dump_generic_node (pp
, TYPE_NAME (node
), spc
, flags
, false);
1671 else if (!(flags
& TDF_SLIM
))
1672 /* FIXME: If we eliminate the 'else' above and attempt
1673 to show the fields for named types, we may get stuck
1674 following a cycle of pointers to structs. The alleged
1675 self-reference check in print_struct_decl will not detect
1676 cycles involving more than one pointer or struct type. */
1677 print_struct_decl (pp
, node
, spc
, flags
);
1686 if (flags
& TDF_GIMPLE
1687 && (POINTER_TYPE_P (TREE_TYPE (node
))
1688 || (TYPE_PRECISION (TREE_TYPE (node
))
1689 < TYPE_PRECISION (integer_type_node
))
1690 || exact_log2 (TYPE_PRECISION (TREE_TYPE (node
))) == -1))
1692 pp_string (pp
, "_Literal (");
1693 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1694 pp_string (pp
, ") ");
1696 if (TREE_CODE (TREE_TYPE (node
)) == POINTER_TYPE
1697 && ! (flags
& TDF_GIMPLE
))
1699 /* In the case of a pointer, one may want to divide by the
1700 size of the pointed-to type. Unfortunately, this not
1701 straightforward. The C front-end maps expressions
1706 in such a way that the two INTEGER_CST nodes for "5" have
1707 different values but identical types. In the latter
1708 case, the 5 is multiplied by sizeof (int) in c-common.c
1709 (pointer_int_sum) to convert it to a byte address, and
1710 yet the type of the node is left unchanged. Argh. What
1711 is consistent though is that the number value corresponds
1712 to bytes (UNITS) offset.
1714 NB: Neither of the following divisors can be trivially
1715 used to recover the original literal:
1717 TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (node)))
1718 TYPE_PRECISION (TREE_TYPE (TREE_TYPE (node))) */
1719 pp_wide_integer (pp
, TREE_INT_CST_LOW (node
));
1720 pp_string (pp
, "B"); /* pseudo-unit */
1722 else if (tree_fits_shwi_p (node
))
1723 pp_wide_integer (pp
, tree_to_shwi (node
));
1724 else if (tree_fits_uhwi_p (node
))
1725 pp_unsigned_wide_integer (pp
, tree_to_uhwi (node
));
1728 wide_int val
= wi::to_wide (node
);
1730 if (wi::neg_p (val
, TYPE_SIGN (TREE_TYPE (node
))))
1735 print_hex (val
, pp_buffer (pp
)->digit_buffer
);
1736 pp_string (pp
, pp_buffer (pp
)->digit_buffer
);
1738 if ((flags
& TDF_GIMPLE
)
1739 && ! (POINTER_TYPE_P (TREE_TYPE (node
))
1740 || (TYPE_PRECISION (TREE_TYPE (node
))
1741 < TYPE_PRECISION (integer_type_node
))
1742 || exact_log2 (TYPE_PRECISION (TREE_TYPE (node
))) == -1))
1744 if (TYPE_UNSIGNED (TREE_TYPE (node
)))
1745 pp_character (pp
, 'u');
1746 if (TYPE_PRECISION (TREE_TYPE (node
))
1747 == TYPE_PRECISION (unsigned_type_node
))
1749 else if (TYPE_PRECISION (TREE_TYPE (node
))
1750 == TYPE_PRECISION (long_unsigned_type_node
))
1751 pp_character (pp
, 'l');
1752 else if (TYPE_PRECISION (TREE_TYPE (node
))
1753 == TYPE_PRECISION (long_long_unsigned_type_node
))
1754 pp_string (pp
, "ll");
1756 if (TREE_OVERFLOW (node
))
1757 pp_string (pp
, "(OVF)");
1761 pp_string (pp
, "POLY_INT_CST [");
1762 dump_generic_node (pp
, POLY_INT_CST_COEFF (node
, 0), spc
, flags
, false);
1763 for (unsigned int i
= 1; i
< NUM_POLY_INT_COEFFS
; ++i
)
1765 pp_string (pp
, ", ");
1766 dump_generic_node (pp
, POLY_INT_CST_COEFF (node
, i
),
1769 pp_string (pp
, "]");
1773 /* Code copied from print_node. */
1776 if (TREE_OVERFLOW (node
))
1777 pp_string (pp
, " overflow");
1779 d
= TREE_REAL_CST (node
);
1780 if (REAL_VALUE_ISINF (d
))
1781 pp_string (pp
, REAL_VALUE_NEGATIVE (d
) ? " -Inf" : " Inf");
1782 else if (REAL_VALUE_ISNAN (d
))
1783 pp_string (pp
, " Nan");
1787 real_to_decimal (string
, &d
, sizeof (string
), 0, 1);
1788 pp_string (pp
, string
);
1796 fixed_to_decimal (string
, TREE_FIXED_CST_PTR (node
), sizeof (string
));
1797 pp_string (pp
, string
);
1802 pp_string (pp
, "__complex__ (");
1803 dump_generic_node (pp
, TREE_REALPART (node
), spc
, flags
, false);
1804 pp_string (pp
, ", ");
1805 dump_generic_node (pp
, TREE_IMAGPART (node
), spc
, flags
, false);
1806 pp_right_paren (pp
);
1811 pp_string (pp
, "\"");
1812 if (unsigned nbytes
= TREE_STRING_LENGTH (node
))
1813 pretty_print_string (pp
, TREE_STRING_POINTER (node
), nbytes
);
1814 pp_string (pp
, "\"");
1821 pp_string (pp
, "{ ");
1822 unsigned HOST_WIDE_INT nunits
;
1823 if (!VECTOR_CST_NELTS (node
).is_constant (&nunits
))
1824 nunits
= vector_cst_encoded_nelts (node
);
1825 for (i
= 0; i
< nunits
; ++i
)
1828 pp_string (pp
, ", ");
1829 dump_generic_node (pp
, VECTOR_CST_ELT (node
, i
),
1832 if (!VECTOR_CST_NELTS (node
).is_constant ())
1833 pp_string (pp
, ", ...");
1834 pp_string (pp
, " }");
1840 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1842 if (TREE_CODE (node
) == METHOD_TYPE
)
1844 if (TYPE_METHOD_BASETYPE (node
))
1845 dump_generic_node (pp
, TYPE_NAME (TYPE_METHOD_BASETYPE (node
)),
1848 pp_string (pp
, "<null method basetype>");
1849 pp_colon_colon (pp
);
1851 if (TYPE_IDENTIFIER (node
))
1852 dump_generic_node (pp
, TYPE_NAME (node
), spc
, flags
, false);
1853 else if (TYPE_NAME (node
) && DECL_NAME (TYPE_NAME (node
)))
1854 dump_decl_name (pp
, TYPE_NAME (node
), flags
);
1855 else if (flags
& TDF_NOUID
)
1856 pp_printf (pp
, "<Txxxx>");
1858 pp_printf (pp
, "<T%x>", TYPE_UID (node
));
1859 dump_function_declaration (pp
, node
, spc
, flags
);
1864 dump_decl_name (pp
, node
, flags
);
1868 if (DECL_NAME (node
))
1869 dump_decl_name (pp
, node
, flags
);
1870 else if (LABEL_DECL_UID (node
) != -1)
1872 if (flags
& TDF_GIMPLE
)
1873 pp_printf (pp
, "L%d", (int) LABEL_DECL_UID (node
));
1875 pp_printf (pp
, "<L%d>", (int) LABEL_DECL_UID (node
));
1879 if (flags
& TDF_NOUID
)
1880 pp_string (pp
, "<D.xxxx>");
1883 if (flags
& TDF_GIMPLE
)
1884 pp_printf (pp
, "<D%u>", DECL_UID (node
));
1886 pp_printf (pp
, "<D.%u>", DECL_UID (node
));
1892 if (DECL_IS_BUILTIN (node
))
1894 /* Don't print the declaration of built-in types. */
1897 if (DECL_NAME (node
))
1898 dump_decl_name (pp
, node
, flags
);
1899 else if (TYPE_NAME (TREE_TYPE (node
)) != node
)
1901 pp_string (pp
, (TREE_CODE (TREE_TYPE (node
)) == UNION_TYPE
1902 ? "union" : "struct "));
1903 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1906 pp_string (pp
, "<anon>");
1912 case DEBUG_EXPR_DECL
:
1913 case NAMESPACE_DECL
:
1915 dump_decl_name (pp
, node
, flags
);
1919 pp_string (pp
, "<retval>");
1923 op0
= TREE_OPERAND (node
, 0);
1926 && (TREE_CODE (op0
) == INDIRECT_REF
1927 || (TREE_CODE (op0
) == MEM_REF
1928 && TREE_CODE (TREE_OPERAND (op0
, 0)) != ADDR_EXPR
1929 && integer_zerop (TREE_OPERAND (op0
, 1))
1930 /* Dump the types of INTEGER_CSTs explicitly, for we
1931 can't infer them and MEM_ATTR caching will share
1932 MEM_REFs with differently-typed op0s. */
1933 && TREE_CODE (TREE_OPERAND (op0
, 0)) != INTEGER_CST
1934 /* Released SSA_NAMES have no TREE_TYPE. */
1935 && TREE_TYPE (TREE_OPERAND (op0
, 0)) != NULL_TREE
1936 /* Same pointer types, but ignoring POINTER_TYPE vs.
1938 && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 0)))
1939 == TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 1))))
1940 && (TYPE_MODE (TREE_TYPE (TREE_OPERAND (op0
, 0)))
1941 == TYPE_MODE (TREE_TYPE (TREE_OPERAND (op0
, 1))))
1942 && (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (op0
, 0)))
1943 == TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (op0
, 1))))
1944 /* Same value types ignoring qualifiers. */
1945 && (TYPE_MAIN_VARIANT (TREE_TYPE (op0
))
1946 == TYPE_MAIN_VARIANT
1947 (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 1)))))
1948 && MR_DEPENDENCE_CLIQUE (op0
) == 0)))
1950 op0
= TREE_OPERAND (op0
, 0);
1953 if (op_prio (op0
) < op_prio (node
))
1955 dump_generic_node (pp
, op0
, spc
, flags
, false);
1956 if (op_prio (op0
) < op_prio (node
))
1957 pp_right_paren (pp
);
1958 pp_string (pp
, str
);
1959 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1960 op0
= component_ref_field_offset (node
);
1961 if (op0
&& TREE_CODE (op0
) != INTEGER_CST
)
1963 pp_string (pp
, "{off: ");
1964 dump_generic_node (pp
, op0
, spc
, flags
, false);
1965 pp_right_brace (pp
);
1970 pp_string (pp
, "BIT_FIELD_REF <");
1971 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1972 pp_string (pp
, ", ");
1973 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1974 pp_string (pp
, ", ");
1975 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
1979 case BIT_INSERT_EXPR
:
1980 pp_string (pp
, "BIT_INSERT_EXPR <");
1981 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1982 pp_string (pp
, ", ");
1983 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1984 pp_string (pp
, ", ");
1985 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
1986 pp_string (pp
, " (");
1987 if (INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (node
, 1))))
1989 TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (node
, 1))));
1991 dump_generic_node (pp
, TYPE_SIZE (TREE_TYPE (TREE_OPERAND (node
, 1))),
1993 pp_string (pp
, " bits)>");
1997 case ARRAY_RANGE_REF
:
1998 op0
= TREE_OPERAND (node
, 0);
1999 if (op_prio (op0
) < op_prio (node
))
2001 dump_generic_node (pp
, op0
, spc
, flags
, false);
2002 if (op_prio (op0
) < op_prio (node
))
2003 pp_right_paren (pp
);
2004 pp_left_bracket (pp
);
2005 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2006 if (TREE_CODE (node
) == ARRAY_RANGE_REF
)
2007 pp_string (pp
, " ...");
2008 pp_right_bracket (pp
);
2010 op0
= array_ref_low_bound (node
);
2011 op1
= array_ref_element_size (node
);
2013 if (!integer_zerop (op0
)
2014 || TREE_OPERAND (node
, 2)
2015 || TREE_OPERAND (node
, 3))
2017 pp_string (pp
, "{lb: ");
2018 dump_generic_node (pp
, op0
, spc
, flags
, false);
2019 pp_string (pp
, " sz: ");
2020 dump_generic_node (pp
, op1
, spc
, flags
, false);
2021 pp_right_brace (pp
);
2027 unsigned HOST_WIDE_INT ix
;
2029 bool is_struct_init
= false;
2030 bool is_array_init
= false;
2033 if (TREE_CLOBBER_P (node
))
2034 pp_string (pp
, "CLOBBER");
2035 else if (TREE_CODE (TREE_TYPE (node
)) == RECORD_TYPE
2036 || TREE_CODE (TREE_TYPE (node
)) == UNION_TYPE
)
2037 is_struct_init
= true;
2038 else if (TREE_CODE (TREE_TYPE (node
)) == ARRAY_TYPE
2039 && TYPE_DOMAIN (TREE_TYPE (node
))
2040 && TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
)))
2041 && TREE_CODE (TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
))))
2044 tree minv
= TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
)));
2045 is_array_init
= true;
2046 curidx
= wi::to_widest (minv
);
2048 FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (node
), ix
, field
, val
)
2055 dump_generic_node (pp
, field
, spc
, flags
, false);
2058 else if (is_array_init
2059 && (TREE_CODE (field
) != INTEGER_CST
2060 || curidx
!= wi::to_widest (field
)))
2062 pp_left_bracket (pp
);
2063 if (TREE_CODE (field
) == RANGE_EXPR
)
2065 dump_generic_node (pp
, TREE_OPERAND (field
, 0), spc
,
2067 pp_string (pp
, " ... ");
2068 dump_generic_node (pp
, TREE_OPERAND (field
, 1), spc
,
2070 if (TREE_CODE (TREE_OPERAND (field
, 1)) == INTEGER_CST
)
2071 curidx
= wi::to_widest (TREE_OPERAND (field
, 1));
2074 dump_generic_node (pp
, field
, spc
, flags
, false);
2075 if (TREE_CODE (field
) == INTEGER_CST
)
2076 curidx
= wi::to_widest (field
);
2077 pp_string (pp
, "]=");
2082 if (val
&& TREE_CODE (val
) == ADDR_EXPR
)
2083 if (TREE_CODE (TREE_OPERAND (val
, 0)) == FUNCTION_DECL
)
2084 val
= TREE_OPERAND (val
, 0);
2085 if (val
&& TREE_CODE (val
) == FUNCTION_DECL
)
2086 dump_decl_name (pp
, val
, flags
);
2088 dump_generic_node (pp
, val
, spc
, flags
, false);
2089 if (ix
!= CONSTRUCTOR_NELTS (node
) - 1)
2095 pp_right_brace (pp
);
2102 if (flags
& TDF_SLIM
)
2104 pp_string (pp
, "<COMPOUND_EXPR>");
2108 dump_generic_node (pp
, TREE_OPERAND (node
, 0),
2109 spc
, flags
, !(flags
& TDF_SLIM
));
2110 if (flags
& TDF_SLIM
)
2111 newline_and_indent (pp
, spc
);
2118 for (tp
= &TREE_OPERAND (node
, 1);
2119 TREE_CODE (*tp
) == COMPOUND_EXPR
;
2120 tp
= &TREE_OPERAND (*tp
, 1))
2122 dump_generic_node (pp
, TREE_OPERAND (*tp
, 0),
2123 spc
, flags
, !(flags
& TDF_SLIM
));
2124 if (flags
& TDF_SLIM
)
2125 newline_and_indent (pp
, spc
);
2133 dump_generic_node (pp
, *tp
, spc
, flags
, !(flags
& TDF_SLIM
));
2137 case STATEMENT_LIST
:
2139 tree_stmt_iterator si
;
2142 if (flags
& TDF_SLIM
)
2144 pp_string (pp
, "<STATEMENT_LIST>");
2148 for (si
= tsi_start (node
); !tsi_end_p (si
); tsi_next (&si
))
2151 newline_and_indent (pp
, spc
);
2154 dump_generic_node (pp
, tsi_stmt (si
), spc
, flags
, true);
2161 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
,
2166 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
,
2171 pp_string (pp
, "TARGET_EXPR <");
2172 dump_generic_node (pp
, TARGET_EXPR_SLOT (node
), spc
, flags
, false);
2175 dump_generic_node (pp
, TARGET_EXPR_INITIAL (node
), spc
, flags
, false);
2180 print_declaration (pp
, DECL_EXPR_DECL (node
), spc
, flags
);
2185 if (TREE_TYPE (node
) == NULL
|| TREE_TYPE (node
) == void_type_node
)
2187 pp_string (pp
, "if (");
2188 dump_generic_node (pp
, COND_EXPR_COND (node
), spc
, flags
, false);
2189 pp_right_paren (pp
);
2190 /* The lowered cond_exprs should always be printed in full. */
2191 if (COND_EXPR_THEN (node
)
2192 && (IS_EMPTY_STMT (COND_EXPR_THEN (node
))
2193 || TREE_CODE (COND_EXPR_THEN (node
)) == GOTO_EXPR
)
2194 && COND_EXPR_ELSE (node
)
2195 && (IS_EMPTY_STMT (COND_EXPR_ELSE (node
))
2196 || TREE_CODE (COND_EXPR_ELSE (node
)) == GOTO_EXPR
))
2199 dump_generic_node (pp
, COND_EXPR_THEN (node
),
2201 if (!IS_EMPTY_STMT (COND_EXPR_ELSE (node
)))
2203 pp_string (pp
, " else ");
2204 dump_generic_node (pp
, COND_EXPR_ELSE (node
),
2208 else if (!(flags
& TDF_SLIM
))
2210 /* Output COND_EXPR_THEN. */
2211 if (COND_EXPR_THEN (node
))
2213 newline_and_indent (pp
, spc
+2);
2215 newline_and_indent (pp
, spc
+4);
2216 dump_generic_node (pp
, COND_EXPR_THEN (node
), spc
+4,
2218 newline_and_indent (pp
, spc
+2);
2219 pp_right_brace (pp
);
2222 /* Output COND_EXPR_ELSE. */
2223 if (COND_EXPR_ELSE (node
)
2224 && !IS_EMPTY_STMT (COND_EXPR_ELSE (node
)))
2226 newline_and_indent (pp
, spc
);
2227 pp_string (pp
, "else");
2228 newline_and_indent (pp
, spc
+2);
2230 newline_and_indent (pp
, spc
+4);
2231 dump_generic_node (pp
, COND_EXPR_ELSE (node
), spc
+4,
2233 newline_and_indent (pp
, spc
+2);
2234 pp_right_brace (pp
);
2241 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2245 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2249 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2255 if (!(flags
& TDF_SLIM
))
2257 if (BIND_EXPR_VARS (node
))
2261 for (op0
= BIND_EXPR_VARS (node
); op0
; op0
= DECL_CHAIN (op0
))
2263 print_declaration (pp
, op0
, spc
+2, flags
);
2268 newline_and_indent (pp
, spc
+2);
2269 dump_generic_node (pp
, BIND_EXPR_BODY (node
), spc
+2, flags
, true);
2270 newline_and_indent (pp
, spc
);
2271 pp_right_brace (pp
);
2277 if (CALL_EXPR_FN (node
) != NULL_TREE
)
2278 print_call_name (pp
, CALL_EXPR_FN (node
), flags
);
2282 pp_string (pp
, internal_fn_name (CALL_EXPR_IFN (node
)));
2285 /* Print parameters. */
2290 call_expr_arg_iterator iter
;
2291 FOR_EACH_CALL_EXPR_ARG (arg
, iter
, node
)
2293 dump_generic_node (pp
, arg
, spc
, flags
, false);
2294 if (more_call_expr_args_p (&iter
))
2301 if (CALL_EXPR_VA_ARG_PACK (node
))
2303 if (call_expr_nargs (node
) > 0)
2308 pp_string (pp
, "__builtin_va_arg_pack ()");
2310 pp_right_paren (pp
);
2312 op1
= CALL_EXPR_STATIC_CHAIN (node
);
2315 pp_string (pp
, " [static-chain: ");
2316 dump_generic_node (pp
, op1
, spc
, flags
, false);
2317 pp_right_bracket (pp
);
2320 if (CALL_EXPR_RETURN_SLOT_OPT (node
))
2321 pp_string (pp
, " [return slot optimization]");
2322 if (CALL_EXPR_TAILCALL (node
))
2323 pp_string (pp
, " [tail call]");
2326 case WITH_CLEANUP_EXPR
:
2330 case CLEANUP_POINT_EXPR
:
2331 pp_string (pp
, "<<cleanup_point ");
2332 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2333 pp_string (pp
, ">>");
2336 case PLACEHOLDER_EXPR
:
2337 pp_string (pp
, "<PLACEHOLDER_EXPR ");
2338 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
2342 /* Binary arithmetic and logic expressions. */
2343 case WIDEN_SUM_EXPR
:
2344 case WIDEN_MULT_EXPR
:
2346 case MULT_HIGHPART_EXPR
:
2348 case POINTER_PLUS_EXPR
:
2349 case POINTER_DIFF_EXPR
:
2351 case TRUNC_DIV_EXPR
:
2353 case FLOOR_DIV_EXPR
:
2354 case ROUND_DIV_EXPR
:
2355 case TRUNC_MOD_EXPR
:
2357 case FLOOR_MOD_EXPR
:
2358 case ROUND_MOD_EXPR
:
2360 case EXACT_DIV_EXPR
:
2365 case WIDEN_LSHIFT_EXPR
:
2369 case TRUTH_ANDIF_EXPR
:
2370 case TRUTH_ORIF_EXPR
:
2371 case TRUTH_AND_EXPR
:
2373 case TRUTH_XOR_EXPR
:
2387 case UNORDERED_EXPR
:
2389 const char *op
= op_symbol (node
);
2390 op0
= TREE_OPERAND (node
, 0);
2391 op1
= TREE_OPERAND (node
, 1);
2393 /* When the operands are expressions with less priority,
2394 keep semantics of the tree representation. */
2395 if (op_prio (op0
) <= op_prio (node
))
2398 dump_generic_node (pp
, op0
, spc
, flags
, false);
2399 pp_right_paren (pp
);
2402 dump_generic_node (pp
, op0
, spc
, flags
, false);
2408 /* When the operands are expressions with less priority,
2409 keep semantics of the tree representation. */
2410 if (op_prio (op1
) <= op_prio (node
))
2413 dump_generic_node (pp
, op1
, spc
, flags
, false);
2414 pp_right_paren (pp
);
2417 dump_generic_node (pp
, op1
, spc
, flags
, false);
2421 /* Unary arithmetic and logic expressions. */
2424 case TRUTH_NOT_EXPR
:
2426 case PREDECREMENT_EXPR
:
2427 case PREINCREMENT_EXPR
:
2429 if (TREE_CODE (node
) == ADDR_EXPR
2430 && (TREE_CODE (TREE_OPERAND (node
, 0)) == STRING_CST
2431 || TREE_CODE (TREE_OPERAND (node
, 0)) == FUNCTION_DECL
))
2432 ; /* Do not output '&' for strings and function pointers. */
2434 pp_string (pp
, op_symbol (node
));
2436 if (op_prio (TREE_OPERAND (node
, 0)) < op_prio (node
))
2439 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2440 pp_right_paren (pp
);
2443 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2446 case POSTDECREMENT_EXPR
:
2447 case POSTINCREMENT_EXPR
:
2448 if (op_prio (TREE_OPERAND (node
, 0)) < op_prio (node
))
2451 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2452 pp_right_paren (pp
);
2455 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2456 pp_string (pp
, op_symbol (node
));
2460 pp_string (pp
, "MIN_EXPR <");
2461 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2462 pp_string (pp
, ", ");
2463 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2468 pp_string (pp
, "MAX_EXPR <");
2469 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2470 pp_string (pp
, ", ");
2471 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2476 pp_string (pp
, "ABS_EXPR <");
2477 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2482 pp_string (pp
, "ABSU_EXPR <");
2483 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2491 case ADDR_SPACE_CONVERT_EXPR
:
2492 case FIXED_CONVERT_EXPR
:
2493 case FIX_TRUNC_EXPR
:
2496 type
= TREE_TYPE (node
);
2497 op0
= TREE_OPERAND (node
, 0);
2498 if (type
!= TREE_TYPE (op0
))
2501 dump_generic_node (pp
, type
, spc
, flags
, false);
2502 pp_string (pp
, ") ");
2504 if (op_prio (op0
) < op_prio (node
))
2506 dump_generic_node (pp
, op0
, spc
, flags
, false);
2507 if (op_prio (op0
) < op_prio (node
))
2508 pp_right_paren (pp
);
2511 case VIEW_CONVERT_EXPR
:
2512 pp_string (pp
, "VIEW_CONVERT_EXPR<");
2513 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
2514 pp_string (pp
, ">(");
2515 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2516 pp_right_paren (pp
);
2520 pp_string (pp
, "((");
2521 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2522 pp_string (pp
, "))");
2525 case NON_LVALUE_EXPR
:
2526 pp_string (pp
, "NON_LVALUE_EXPR <");
2527 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2532 pp_string (pp
, "SAVE_EXPR <");
2533 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2538 pp_string (pp
, "COMPLEX_EXPR <");
2539 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2540 pp_string (pp
, ", ");
2541 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2546 pp_string (pp
, "CONJ_EXPR <");
2547 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2552 if (flags
& TDF_GIMPLE
)
2554 pp_string (pp
, "__real ");
2555 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2559 pp_string (pp
, "REALPART_EXPR <");
2560 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2566 if (flags
& TDF_GIMPLE
)
2568 pp_string (pp
, "__imag ");
2569 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2573 pp_string (pp
, "IMAGPART_EXPR <");
2574 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2580 pp_string (pp
, "VA_ARG_EXPR <");
2581 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2585 case TRY_FINALLY_EXPR
:
2586 case TRY_CATCH_EXPR
:
2587 pp_string (pp
, "try");
2588 newline_and_indent (pp
, spc
+2);
2590 newline_and_indent (pp
, spc
+4);
2591 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
+4, flags
, true);
2592 newline_and_indent (pp
, spc
+2);
2593 pp_right_brace (pp
);
2594 newline_and_indent (pp
, spc
);
2596 (TREE_CODE (node
) == TRY_CATCH_EXPR
) ? "catch" : "finally");
2597 newline_and_indent (pp
, spc
+2);
2599 newline_and_indent (pp
, spc
+4);
2600 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
+4, flags
, true);
2601 newline_and_indent (pp
, spc
+2);
2602 pp_right_brace (pp
);
2607 pp_string (pp
, "catch (");
2608 dump_generic_node (pp
, CATCH_TYPES (node
), spc
+2, flags
, false);
2609 pp_right_paren (pp
);
2610 newline_and_indent (pp
, spc
+2);
2612 newline_and_indent (pp
, spc
+4);
2613 dump_generic_node (pp
, CATCH_BODY (node
), spc
+4, flags
, true);
2614 newline_and_indent (pp
, spc
+2);
2615 pp_right_brace (pp
);
2619 case EH_FILTER_EXPR
:
2620 pp_string (pp
, "<<<eh_filter (");
2621 dump_generic_node (pp
, EH_FILTER_TYPES (node
), spc
+2, flags
, false);
2622 pp_string (pp
, ")>>>");
2623 newline_and_indent (pp
, spc
+2);
2625 newline_and_indent (pp
, spc
+4);
2626 dump_generic_node (pp
, EH_FILTER_FAILURE (node
), spc
+4, flags
, true);
2627 newline_and_indent (pp
, spc
+2);
2628 pp_right_brace (pp
);
2633 op0
= TREE_OPERAND (node
, 0);
2634 /* If this is for break or continue, don't bother printing it. */
2635 if (DECL_NAME (op0
))
2637 const char *name
= IDENTIFIER_POINTER (DECL_NAME (op0
));
2638 if (strcmp (name
, "break") == 0
2639 || strcmp (name
, "continue") == 0)
2642 dump_generic_node (pp
, op0
, spc
, flags
, false);
2644 if (DECL_NONLOCAL (op0
))
2645 pp_string (pp
, " [non-local]");
2649 pp_string (pp
, "while (1)");
2650 if (!(flags
& TDF_SLIM
))
2652 newline_and_indent (pp
, spc
+2);
2654 newline_and_indent (pp
, spc
+4);
2655 dump_generic_node (pp
, LOOP_EXPR_BODY (node
), spc
+4, flags
, true);
2656 newline_and_indent (pp
, spc
+2);
2657 pp_right_brace (pp
);
2663 pp_string (pp
, "// predicted ");
2664 if (PREDICT_EXPR_OUTCOME (node
))
2665 pp_string (pp
, "likely by ");
2667 pp_string (pp
, "unlikely by ");
2668 pp_string (pp
, predictor_name (PREDICT_EXPR_PREDICTOR (node
)));
2669 pp_string (pp
, " predictor.");
2673 pp_string (pp
, "ANNOTATE_EXPR <");
2674 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2675 switch ((enum annot_expr_kind
) TREE_INT_CST_LOW (TREE_OPERAND (node
, 1)))
2677 case annot_expr_ivdep_kind
:
2678 pp_string (pp
, ", ivdep");
2680 case annot_expr_unroll_kind
:
2681 pp_printf (pp
, ", unroll %d",
2682 (int) TREE_INT_CST_LOW (TREE_OPERAND (node
, 2)));
2684 case annot_expr_no_vector_kind
:
2685 pp_string (pp
, ", no-vector");
2687 case annot_expr_vector_kind
:
2688 pp_string (pp
, ", vector");
2690 case annot_expr_parallel_kind
:
2691 pp_string (pp
, ", parallel");
2700 pp_string (pp
, "return");
2701 op0
= TREE_OPERAND (node
, 0);
2705 if (TREE_CODE (op0
) == MODIFY_EXPR
)
2706 dump_generic_node (pp
, TREE_OPERAND (op0
, 1),
2709 dump_generic_node (pp
, op0
, spc
, flags
, false);
2714 pp_string (pp
, "if (");
2715 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2716 pp_string (pp
, ") break");
2720 pp_string (pp
, "switch (");
2721 dump_generic_node (pp
, SWITCH_COND (node
), spc
, flags
, false);
2722 pp_right_paren (pp
);
2723 if (!(flags
& TDF_SLIM
))
2725 newline_and_indent (pp
, spc
+2);
2727 if (SWITCH_BODY (node
))
2729 newline_and_indent (pp
, spc
+4);
2730 dump_generic_node (pp
, SWITCH_BODY (node
), spc
+4, flags
,
2733 newline_and_indent (pp
, spc
+2);
2734 pp_right_brace (pp
);
2740 op0
= GOTO_DESTINATION (node
);
2741 if (TREE_CODE (op0
) != SSA_NAME
&& DECL_P (op0
) && DECL_NAME (op0
))
2743 const char *name
= IDENTIFIER_POINTER (DECL_NAME (op0
));
2744 if (strcmp (name
, "break") == 0
2745 || strcmp (name
, "continue") == 0)
2747 pp_string (pp
, name
);
2751 pp_string (pp
, "goto ");
2752 dump_generic_node (pp
, op0
, spc
, flags
, false);
2756 pp_string (pp
, "__asm__");
2757 if (ASM_VOLATILE_P (node
))
2758 pp_string (pp
, " __volatile__");
2760 dump_generic_node (pp
, ASM_STRING (node
), spc
, flags
, false);
2762 dump_generic_node (pp
, ASM_OUTPUTS (node
), spc
, flags
, false);
2764 dump_generic_node (pp
, ASM_INPUTS (node
), spc
, flags
, false);
2765 if (ASM_CLOBBERS (node
))
2768 dump_generic_node (pp
, ASM_CLOBBERS (node
), spc
, flags
, false);
2770 pp_right_paren (pp
);
2773 case CASE_LABEL_EXPR
:
2774 if (CASE_LOW (node
) && CASE_HIGH (node
))
2776 pp_string (pp
, "case ");
2777 dump_generic_node (pp
, CASE_LOW (node
), spc
, flags
, false);
2778 pp_string (pp
, " ... ");
2779 dump_generic_node (pp
, CASE_HIGH (node
), spc
, flags
, false);
2781 else if (CASE_LOW (node
))
2783 pp_string (pp
, "case ");
2784 dump_generic_node (pp
, CASE_LOW (node
), spc
, flags
, false);
2787 pp_string (pp
, "default");
2792 pp_string (pp
, "OBJ_TYPE_REF(");
2793 dump_generic_node (pp
, OBJ_TYPE_REF_EXPR (node
), spc
, flags
, false);
2795 /* We omit the class type for -fcompare-debug because we may
2796 drop TYPE_BINFO early depending on debug info, and then
2797 virtual_method_call_p would return false, whereas when
2798 TYPE_BINFO is preserved it may still return true and then
2799 we'd print the class type. Compare tree and rtl dumps for
2800 libstdc++-prettyprinters/shared_ptr.cc with and without -g,
2801 for example, at occurrences of OBJ_TYPE_REF. */
2802 if (!(flags
& (TDF_SLIM
| TDF_COMPARE_DEBUG
))
2803 && virtual_method_call_p (node
))
2805 pp_string (pp
, "(");
2806 dump_generic_node (pp
, obj_type_ref_class (node
), spc
, flags
, false);
2807 pp_string (pp
, ")");
2809 dump_generic_node (pp
, OBJ_TYPE_REF_OBJECT (node
), spc
, flags
, false);
2811 dump_generic_node (pp
, OBJ_TYPE_REF_TOKEN (node
), spc
, flags
, false);
2812 pp_right_paren (pp
);
2816 if (SSA_NAME_IDENTIFIER (node
))
2818 if ((flags
& TDF_NOUID
)
2819 && SSA_NAME_VAR (node
)
2820 && DECL_NAMELESS (SSA_NAME_VAR (node
)))
2821 dump_fancy_name (pp
, SSA_NAME_IDENTIFIER (node
));
2822 else if (! (flags
& TDF_GIMPLE
)
2823 || SSA_NAME_VAR (node
))
2824 dump_generic_node (pp
, SSA_NAME_IDENTIFIER (node
),
2828 pp_decimal_int (pp
, SSA_NAME_VERSION (node
));
2829 if (SSA_NAME_IS_DEFAULT_DEF (node
))
2830 pp_string (pp
, "(D)");
2831 if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (node
))
2832 pp_string (pp
, "(ab)");
2835 case WITH_SIZE_EXPR
:
2836 pp_string (pp
, "WITH_SIZE_EXPR <");
2837 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2838 pp_string (pp
, ", ");
2839 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2844 pp_string (pp
, "ASSERT_EXPR <");
2845 dump_generic_node (pp
, ASSERT_EXPR_VAR (node
), spc
, flags
, false);
2846 pp_string (pp
, ", ");
2847 dump_generic_node (pp
, ASSERT_EXPR_COND (node
), spc
, flags
, false);
2852 pp_string (pp
, "scev_known");
2855 case SCEV_NOT_KNOWN
:
2856 pp_string (pp
, "scev_not_known");
2859 case POLYNOMIAL_CHREC
:
2861 dump_generic_node (pp
, CHREC_LEFT (node
), spc
, flags
, false);
2862 pp_string (pp
, ", +, ");
2863 dump_generic_node (pp
, CHREC_RIGHT (node
), spc
, flags
, false);
2864 pp_printf (pp
, "}_%u", CHREC_VARIABLE (node
));
2868 case REALIGN_LOAD_EXPR
:
2869 pp_string (pp
, "REALIGN_LOAD <");
2870 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2871 pp_string (pp
, ", ");
2872 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2873 pp_string (pp
, ", ");
2874 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2879 pp_string (pp
, " VEC_COND_EXPR < ");
2880 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2881 pp_string (pp
, " , ");
2882 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2883 pp_string (pp
, " , ");
2884 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2885 pp_string (pp
, " > ");
2889 pp_string (pp
, " VEC_PERM_EXPR < ");
2890 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2891 pp_string (pp
, " , ");
2892 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2893 pp_string (pp
, " , ");
2894 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2895 pp_string (pp
, " > ");
2899 pp_string (pp
, " DOT_PROD_EXPR < ");
2900 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2901 pp_string (pp
, ", ");
2902 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2903 pp_string (pp
, ", ");
2904 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2905 pp_string (pp
, " > ");
2908 case WIDEN_MULT_PLUS_EXPR
:
2909 pp_string (pp
, " WIDEN_MULT_PLUS_EXPR < ");
2910 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2911 pp_string (pp
, ", ");
2912 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2913 pp_string (pp
, ", ");
2914 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2915 pp_string (pp
, " > ");
2918 case WIDEN_MULT_MINUS_EXPR
:
2919 pp_string (pp
, " WIDEN_MULT_MINUS_EXPR < ");
2920 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2921 pp_string (pp
, ", ");
2922 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2923 pp_string (pp
, ", ");
2924 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2925 pp_string (pp
, " > ");
2929 pp_string (pp
, "#pragma acc parallel");
2930 goto dump_omp_clauses_body
;
2933 pp_string (pp
, "#pragma acc kernels");
2934 goto dump_omp_clauses_body
;
2937 pp_string (pp
, "#pragma acc data");
2938 dump_omp_clauses (pp
, OACC_DATA_CLAUSES (node
), spc
, flags
);
2941 case OACC_HOST_DATA
:
2942 pp_string (pp
, "#pragma acc host_data");
2943 dump_omp_clauses (pp
, OACC_HOST_DATA_CLAUSES (node
), spc
, flags
);
2947 pp_string (pp
, "#pragma acc declare");
2948 dump_omp_clauses (pp
, OACC_DECLARE_CLAUSES (node
), spc
, flags
);
2952 pp_string (pp
, "#pragma acc update");
2953 dump_omp_clauses (pp
, OACC_UPDATE_CLAUSES (node
), spc
, flags
);
2956 case OACC_ENTER_DATA
:
2957 pp_string (pp
, "#pragma acc enter data");
2958 dump_omp_clauses (pp
, OACC_ENTER_DATA_CLAUSES (node
), spc
, flags
);
2961 case OACC_EXIT_DATA
:
2962 pp_string (pp
, "#pragma acc exit data");
2963 dump_omp_clauses (pp
, OACC_EXIT_DATA_CLAUSES (node
), spc
, flags
);
2967 pp_string (pp
, "#pragma acc cache");
2968 dump_omp_clauses (pp
, OACC_CACHE_CLAUSES (node
), spc
, flags
);
2972 pp_string (pp
, "#pragma omp parallel");
2973 dump_omp_clauses (pp
, OMP_PARALLEL_CLAUSES (node
), spc
, flags
);
2976 dump_omp_clauses_body
:
2977 dump_omp_clauses (pp
, OMP_CLAUSES (node
), spc
, flags
);
2981 if (!(flags
& TDF_SLIM
) && OMP_BODY (node
))
2983 newline_and_indent (pp
, spc
+ 2);
2985 newline_and_indent (pp
, spc
+ 4);
2986 dump_generic_node (pp
, OMP_BODY (node
), spc
+ 4, flags
, false);
2987 newline_and_indent (pp
, spc
+ 2);
2988 pp_right_brace (pp
);
2994 pp_string (pp
, "#pragma omp task");
2995 dump_omp_clauses (pp
, OMP_TASK_CLAUSES (node
), spc
, flags
);
2999 pp_string (pp
, "#pragma omp for");
3003 pp_string (pp
, "#pragma omp simd");
3006 case OMP_DISTRIBUTE
:
3007 pp_string (pp
, "#pragma omp distribute");
3011 pp_string (pp
, "#pragma omp taskloop");
3015 pp_string (pp
, "#pragma acc loop");
3019 pp_string (pp
, "#pragma omp teams");
3020 dump_omp_clauses (pp
, OMP_TEAMS_CLAUSES (node
), spc
, flags
);
3023 case OMP_TARGET_DATA
:
3024 pp_string (pp
, "#pragma omp target data");
3025 dump_omp_clauses (pp
, OMP_TARGET_DATA_CLAUSES (node
), spc
, flags
);
3028 case OMP_TARGET_ENTER_DATA
:
3029 pp_string (pp
, "#pragma omp target enter data");
3030 dump_omp_clauses (pp
, OMP_TARGET_ENTER_DATA_CLAUSES (node
), spc
, flags
);
3034 case OMP_TARGET_EXIT_DATA
:
3035 pp_string (pp
, "#pragma omp target exit data");
3036 dump_omp_clauses (pp
, OMP_TARGET_EXIT_DATA_CLAUSES (node
), spc
, flags
);
3041 pp_string (pp
, "#pragma omp target");
3042 dump_omp_clauses (pp
, OMP_TARGET_CLAUSES (node
), spc
, flags
);
3045 case OMP_TARGET_UPDATE
:
3046 pp_string (pp
, "#pragma omp target update");
3047 dump_omp_clauses (pp
, OMP_TARGET_UPDATE_CLAUSES (node
), spc
, flags
);
3052 dump_omp_clauses (pp
, OMP_FOR_CLAUSES (node
), spc
, flags
);
3053 if (!(flags
& TDF_SLIM
))
3057 if (OMP_FOR_PRE_BODY (node
))
3059 newline_and_indent (pp
, spc
+ 2);
3062 newline_and_indent (pp
, spc
);
3063 dump_generic_node (pp
, OMP_FOR_PRE_BODY (node
),
3066 if (OMP_FOR_INIT (node
))
3069 for (i
= 0; i
< TREE_VEC_LENGTH (OMP_FOR_INIT (node
)); i
++)
3072 newline_and_indent (pp
, spc
);
3073 pp_string (pp
, "for (");
3074 dump_generic_node (pp
,
3075 TREE_VEC_ELT (OMP_FOR_INIT (node
), i
),
3077 pp_string (pp
, "; ");
3078 dump_generic_node (pp
,
3079 TREE_VEC_ELT (OMP_FOR_COND (node
), i
),
3081 pp_string (pp
, "; ");
3082 dump_generic_node (pp
,
3083 TREE_VEC_ELT (OMP_FOR_INCR (node
), i
),
3085 pp_right_paren (pp
);
3088 if (OMP_FOR_BODY (node
))
3090 newline_and_indent (pp
, spc
+ 2);
3092 newline_and_indent (pp
, spc
+ 4);
3093 dump_generic_node (pp
, OMP_FOR_BODY (node
), spc
+ 4, flags
,
3095 newline_and_indent (pp
, spc
+ 2);
3096 pp_right_brace (pp
);
3098 if (OMP_FOR_INIT (node
))
3099 spc
-= 2 * TREE_VEC_LENGTH (OMP_FOR_INIT (node
)) - 2;
3100 if (OMP_FOR_PRE_BODY (node
))
3103 newline_and_indent (pp
, spc
+ 2);
3104 pp_right_brace (pp
);
3111 pp_string (pp
, "#pragma omp sections");
3112 dump_omp_clauses (pp
, OMP_SECTIONS_CLAUSES (node
), spc
, flags
);
3116 pp_string (pp
, "#pragma omp section");
3120 pp_string (pp
, "#pragma omp master");
3124 pp_string (pp
, "#pragma omp taskgroup");
3128 pp_string (pp
, "#pragma omp ordered");
3129 dump_omp_clauses (pp
, OMP_ORDERED_CLAUSES (node
), spc
, flags
);
3133 pp_string (pp
, "#pragma omp critical");
3134 if (OMP_CRITICAL_NAME (node
))
3138 dump_generic_node (pp
, OMP_CRITICAL_NAME (node
), spc
,
3140 pp_right_paren (pp
);
3142 dump_omp_clauses (pp
, OMP_CRITICAL_CLAUSES (node
), spc
, flags
);
3146 pp_string (pp
, "#pragma omp atomic");
3147 if (OMP_ATOMIC_SEQ_CST (node
))
3148 pp_string (pp
, " seq_cst");
3149 newline_and_indent (pp
, spc
+ 2);
3150 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3154 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3157 case OMP_ATOMIC_READ
:
3158 pp_string (pp
, "#pragma omp atomic read");
3159 if (OMP_ATOMIC_SEQ_CST (node
))
3160 pp_string (pp
, " seq_cst");
3161 newline_and_indent (pp
, spc
+ 2);
3162 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3166 case OMP_ATOMIC_CAPTURE_OLD
:
3167 case OMP_ATOMIC_CAPTURE_NEW
:
3168 pp_string (pp
, "#pragma omp atomic capture");
3169 if (OMP_ATOMIC_SEQ_CST (node
))
3170 pp_string (pp
, " seq_cst");
3171 newline_and_indent (pp
, spc
+ 2);
3172 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3176 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3180 pp_string (pp
, "#pragma omp single");
3181 dump_omp_clauses (pp
, OMP_SINGLE_CLAUSES (node
), spc
, flags
);
3185 dump_omp_clause (pp
, node
, spc
, flags
);
3189 case TRANSACTION_EXPR
:
3190 if (TRANSACTION_EXPR_OUTER (node
))
3191 pp_string (pp
, "__transaction_atomic [[outer]]");
3192 else if (TRANSACTION_EXPR_RELAXED (node
))
3193 pp_string (pp
, "__transaction_relaxed");
3195 pp_string (pp
, "__transaction_atomic");
3196 if (!(flags
& TDF_SLIM
) && TRANSACTION_EXPR_BODY (node
))
3198 newline_and_indent (pp
, spc
);
3200 newline_and_indent (pp
, spc
+ 2);
3201 dump_generic_node (pp
, TRANSACTION_EXPR_BODY (node
),
3202 spc
+ 2, flags
, false);
3203 newline_and_indent (pp
, spc
);
3204 pp_right_brace (pp
);
3209 case VEC_SERIES_EXPR
:
3210 case VEC_WIDEN_MULT_HI_EXPR
:
3211 case VEC_WIDEN_MULT_LO_EXPR
:
3212 case VEC_WIDEN_MULT_EVEN_EXPR
:
3213 case VEC_WIDEN_MULT_ODD_EXPR
:
3214 case VEC_WIDEN_LSHIFT_HI_EXPR
:
3215 case VEC_WIDEN_LSHIFT_LO_EXPR
:
3217 for (str
= get_tree_code_name (code
); *str
; str
++)
3218 pp_character (pp
, TOUPPER (*str
));
3219 pp_string (pp
, " < ");
3220 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3221 pp_string (pp
, ", ");
3222 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3223 pp_string (pp
, " > ");
3226 case VEC_DUPLICATE_EXPR
:
3228 for (str
= get_tree_code_name (code
); *str
; str
++)
3229 pp_character (pp
, TOUPPER (*str
));
3230 pp_string (pp
, " < ");
3231 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3232 pp_string (pp
, " > ");
3235 case VEC_UNPACK_HI_EXPR
:
3236 pp_string (pp
, " VEC_UNPACK_HI_EXPR < ");
3237 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3238 pp_string (pp
, " > ");
3241 case VEC_UNPACK_LO_EXPR
:
3242 pp_string (pp
, " VEC_UNPACK_LO_EXPR < ");
3243 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3244 pp_string (pp
, " > ");
3247 case VEC_UNPACK_FLOAT_HI_EXPR
:
3248 pp_string (pp
, " VEC_UNPACK_FLOAT_HI_EXPR < ");
3249 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3250 pp_string (pp
, " > ");
3253 case VEC_UNPACK_FLOAT_LO_EXPR
:
3254 pp_string (pp
, " VEC_UNPACK_FLOAT_LO_EXPR < ");
3255 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3256 pp_string (pp
, " > ");
3259 case VEC_UNPACK_FIX_TRUNC_HI_EXPR
:
3260 pp_string (pp
, " VEC_UNPACK_FIX_TRUNC_HI_EXPR < ");
3261 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3262 pp_string (pp
, " > ");
3265 case VEC_UNPACK_FIX_TRUNC_LO_EXPR
:
3266 pp_string (pp
, " VEC_UNPACK_FIX_TRUNC_LO_EXPR < ");
3267 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3268 pp_string (pp
, " > ");
3271 case VEC_PACK_TRUNC_EXPR
:
3272 pp_string (pp
, " VEC_PACK_TRUNC_EXPR < ");
3273 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3274 pp_string (pp
, ", ");
3275 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3276 pp_string (pp
, " > ");
3279 case VEC_PACK_SAT_EXPR
:
3280 pp_string (pp
, " VEC_PACK_SAT_EXPR < ");
3281 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3282 pp_string (pp
, ", ");
3283 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3284 pp_string (pp
, " > ");
3287 case VEC_PACK_FIX_TRUNC_EXPR
:
3288 pp_string (pp
, " VEC_PACK_FIX_TRUNC_EXPR < ");
3289 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3290 pp_string (pp
, ", ");
3291 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3292 pp_string (pp
, " > ");
3295 case VEC_PACK_FLOAT_EXPR
:
3296 pp_string (pp
, " VEC_PACK_FLOAT_EXPR < ");
3297 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3298 pp_string (pp
, ", ");
3299 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3300 pp_string (pp
, " > ");
3304 dump_block_node (pp
, node
, spc
, flags
);
3307 case DEBUG_BEGIN_STMT
:
3308 pp_string (pp
, "# DEBUG BEGIN STMT");
3315 if (is_stmt
&& is_expr
)
3321 /* Print the declaration of a variable. */
3324 print_declaration (pretty_printer
*pp
, tree t
, int spc
, dump_flags_t flags
)
3328 if (TREE_CODE(t
) == NAMELIST_DECL
)
3330 pp_string(pp
, "namelist ");
3331 dump_decl_name (pp
, t
, flags
);
3336 if (TREE_CODE (t
) == TYPE_DECL
)
3337 pp_string (pp
, "typedef ");
3339 if (CODE_CONTAINS_STRUCT (TREE_CODE (t
), TS_DECL_WRTL
) && DECL_REGISTER (t
))
3340 pp_string (pp
, "register ");
3342 if (TREE_PUBLIC (t
) && DECL_EXTERNAL (t
))
3343 pp_string (pp
, "extern ");
3344 else if (TREE_STATIC (t
))
3345 pp_string (pp
, "static ");
3347 /* Print the type and name. */
3348 if (TREE_TYPE (t
) && TREE_CODE (TREE_TYPE (t
)) == ARRAY_TYPE
)
3352 /* Print array's type. */
3353 tmp
= TREE_TYPE (t
);
3354 while (TREE_CODE (TREE_TYPE (tmp
)) == ARRAY_TYPE
)
3355 tmp
= TREE_TYPE (tmp
);
3356 dump_generic_node (pp
, TREE_TYPE (tmp
), spc
, flags
, false);
3358 /* Print variable's name. */
3360 dump_generic_node (pp
, t
, spc
, flags
, false);
3362 /* Print the dimensions. */
3363 tmp
= TREE_TYPE (t
);
3364 while (TREE_CODE (tmp
) == ARRAY_TYPE
)
3366 dump_array_domain (pp
, TYPE_DOMAIN (tmp
), spc
, flags
);
3367 tmp
= TREE_TYPE (tmp
);
3370 else if (TREE_CODE (t
) == FUNCTION_DECL
)
3372 dump_generic_node (pp
, TREE_TYPE (TREE_TYPE (t
)), spc
, flags
, false);
3374 dump_decl_name (pp
, t
, flags
);
3375 dump_function_declaration (pp
, TREE_TYPE (t
), spc
, flags
);
3379 /* Print type declaration. */
3380 dump_generic_node (pp
, TREE_TYPE (t
), spc
, flags
, false);
3382 /* Print variable's name. */
3384 dump_generic_node (pp
, t
, spc
, flags
, false);
3387 if (VAR_P (t
) && DECL_HARD_REGISTER (t
))
3389 pp_string (pp
, " __asm__ ");
3391 dump_generic_node (pp
, DECL_ASSEMBLER_NAME (t
), spc
, flags
, false);
3392 pp_right_paren (pp
);
3395 /* The initial value of a function serves to determine whether the function
3396 is declared or defined. So the following does not apply to function
3398 if (TREE_CODE (t
) != FUNCTION_DECL
)
3400 /* Print the initial value. */
3401 if (DECL_INITIAL (t
))
3406 if (!(flags
& TDF_SLIM
))
3407 dump_generic_node (pp
, DECL_INITIAL (t
), spc
, flags
, false);
3409 pp_string (pp
, "<<< omitted >>>");
3413 if (VAR_P (t
) && DECL_HAS_VALUE_EXPR_P (t
))
3415 pp_string (pp
, " [value-expr: ");
3416 dump_generic_node (pp
, DECL_VALUE_EXPR (t
), spc
, flags
, false);
3417 pp_right_bracket (pp
);
3424 /* Prints a structure: name, fields, and methods.
3425 FIXME: Still incomplete. */
3428 print_struct_decl (pretty_printer
*pp
, const_tree node
, int spc
,
3431 /* Print the name of the structure. */
3432 if (TYPE_NAME (node
))
3435 if (TREE_CODE (node
) == RECORD_TYPE
)
3436 pp_string (pp
, "struct ");
3437 else if ((TREE_CODE (node
) == UNION_TYPE
3438 || TREE_CODE (node
) == QUAL_UNION_TYPE
))
3439 pp_string (pp
, "union ");
3441 dump_generic_node (pp
, TYPE_NAME (node
), spc
, TDF_NONE
, false);
3444 /* Print the contents of the structure. */
3450 /* Print the fields of the structure. */
3453 tmp
= TYPE_FIELDS (node
);
3456 /* Avoid to print recursively the structure. */
3457 /* FIXME : Not implemented correctly...,
3458 what about the case when we have a cycle in the contain graph? ...
3459 Maybe this could be solved by looking at the scope in which the
3460 structure was declared. */
3461 if (TREE_TYPE (tmp
) != node
3462 && (TREE_CODE (TREE_TYPE (tmp
)) != POINTER_TYPE
3463 || TREE_TYPE (TREE_TYPE (tmp
)) != node
))
3465 print_declaration (pp
, tmp
, spc
+2, flags
);
3468 tmp
= DECL_CHAIN (tmp
);
3472 pp_right_brace (pp
);
3475 /* Return the priority of the operator CODE.
3477 From lowest to highest precedence with either left-to-right (L-R)
3478 or right-to-left (R-L) associativity]:
3481 2 [R-L] = += -= *= /= %= &= ^= |= <<= >>=
3493 14 [R-L] ! ~ ++ -- + - * & (type) sizeof
3494 15 [L-R] fn() [] -> .
3496 unary +, - and * have higher precedence than the corresponding binary
3500 op_code_prio (enum tree_code code
)
3517 case TRUTH_ORIF_EXPR
:
3520 case TRUTH_AND_EXPR
:
3521 case TRUTH_ANDIF_EXPR
:
3528 case TRUTH_XOR_EXPR
:
3545 case UNORDERED_EXPR
:
3556 case VEC_WIDEN_LSHIFT_HI_EXPR
:
3557 case VEC_WIDEN_LSHIFT_LO_EXPR
:
3558 case WIDEN_LSHIFT_EXPR
:
3561 case WIDEN_SUM_EXPR
:
3563 case POINTER_PLUS_EXPR
:
3564 case POINTER_DIFF_EXPR
:
3568 case VEC_WIDEN_MULT_HI_EXPR
:
3569 case VEC_WIDEN_MULT_LO_EXPR
:
3570 case WIDEN_MULT_EXPR
:
3572 case WIDEN_MULT_PLUS_EXPR
:
3573 case WIDEN_MULT_MINUS_EXPR
:
3575 case MULT_HIGHPART_EXPR
:
3576 case TRUNC_DIV_EXPR
:
3578 case FLOOR_DIV_EXPR
:
3579 case ROUND_DIV_EXPR
:
3581 case EXACT_DIV_EXPR
:
3582 case TRUNC_MOD_EXPR
:
3584 case FLOOR_MOD_EXPR
:
3585 case ROUND_MOD_EXPR
:
3588 case TRUTH_NOT_EXPR
:
3590 case POSTINCREMENT_EXPR
:
3591 case POSTDECREMENT_EXPR
:
3592 case PREINCREMENT_EXPR
:
3593 case PREDECREMENT_EXPR
:
3599 case FIX_TRUNC_EXPR
:
3605 case ARRAY_RANGE_REF
:
3609 /* Special expressions. */
3615 case VEC_UNPACK_HI_EXPR
:
3616 case VEC_UNPACK_LO_EXPR
:
3617 case VEC_UNPACK_FLOAT_HI_EXPR
:
3618 case VEC_UNPACK_FLOAT_LO_EXPR
:
3619 case VEC_UNPACK_FIX_TRUNC_HI_EXPR
:
3620 case VEC_UNPACK_FIX_TRUNC_LO_EXPR
:
3621 case VEC_PACK_TRUNC_EXPR
:
3622 case VEC_PACK_SAT_EXPR
:
3626 /* Return an arbitrarily high precedence to avoid surrounding single
3627 VAR_DECLs in ()s. */
3632 /* Return the priority of the operator OP. */
3635 op_prio (const_tree op
)
3637 enum tree_code code
;
3642 code
= TREE_CODE (op
);
3643 if (code
== SAVE_EXPR
|| code
== NON_LVALUE_EXPR
)
3644 return op_prio (TREE_OPERAND (op
, 0));
3646 return op_code_prio (code
);
3649 /* Return the symbol associated with operator CODE. */
3652 op_symbol_code (enum tree_code code
)
3660 case TRUTH_ORIF_EXPR
:
3663 case TRUTH_AND_EXPR
:
3664 case TRUTH_ANDIF_EXPR
:
3670 case TRUTH_XOR_EXPR
:
3680 case UNORDERED_EXPR
:
3726 case WIDEN_LSHIFT_EXPR
:
3729 case POINTER_PLUS_EXPR
:
3735 case WIDEN_SUM_EXPR
:
3738 case WIDEN_MULT_EXPR
:
3741 case MULT_HIGHPART_EXPR
:
3746 case POINTER_DIFF_EXPR
:
3752 case TRUTH_NOT_EXPR
:
3759 case TRUNC_DIV_EXPR
:
3766 case FLOOR_DIV_EXPR
:
3769 case ROUND_DIV_EXPR
:
3772 case EXACT_DIV_EXPR
:
3775 case TRUNC_MOD_EXPR
:
3781 case FLOOR_MOD_EXPR
:
3784 case ROUND_MOD_EXPR
:
3787 case PREDECREMENT_EXPR
:
3790 case PREINCREMENT_EXPR
:
3793 case POSTDECREMENT_EXPR
:
3796 case POSTINCREMENT_EXPR
:
3806 return "<<< ??? >>>";
3810 /* Return the symbol associated with operator OP. */
3813 op_symbol (const_tree op
)
3815 return op_symbol_code (TREE_CODE (op
));
3818 /* Prints the name of a call. NODE is the CALL_EXPR_FN of a CALL_EXPR or
3819 the gimple_call_fn of a GIMPLE_CALL. */
3822 print_call_name (pretty_printer
*pp
, tree node
, dump_flags_t flags
)
3826 if (TREE_CODE (op0
) == NON_LVALUE_EXPR
)
3827 op0
= TREE_OPERAND (op0
, 0);
3830 switch (TREE_CODE (op0
))
3835 dump_function_name (pp
, op0
, flags
);
3841 op0
= TREE_OPERAND (op0
, 0);
3846 dump_generic_node (pp
, TREE_OPERAND (op0
, 0), 0, flags
, false);
3847 pp_string (pp
, ") ? ");
3848 dump_generic_node (pp
, TREE_OPERAND (op0
, 1), 0, flags
, false);
3849 pp_string (pp
, " : ");
3850 dump_generic_node (pp
, TREE_OPERAND (op0
, 2), 0, flags
, false);
3854 if (TREE_CODE (TREE_OPERAND (op0
, 0)) == VAR_DECL
)
3855 dump_function_name (pp
, TREE_OPERAND (op0
, 0), flags
);
3857 dump_generic_node (pp
, op0
, 0, flags
, false);
3861 if (integer_zerop (TREE_OPERAND (op0
, 1)))
3863 op0
= TREE_OPERAND (op0
, 0);
3870 dump_generic_node (pp
, op0
, 0, flags
, false);
3878 /* Print the first N characters in the array STR, replacing non-printable
3879 characters (including embedded nuls) with unambiguous escape sequences. */
3882 pretty_print_string (pretty_printer
*pp
, const char *str
, unsigned n
)
3887 for ( ; n
; --n
, ++str
)
3892 pp_string (pp
, "\\b");
3896 pp_string (pp
, "\\f");
3900 pp_string (pp
, "\\n");
3904 pp_string (pp
, "\\r");
3908 pp_string (pp
, "\\t");
3912 pp_string (pp
, "\\v");
3916 pp_string (pp
, "\\\\");
3920 pp_string (pp
, "\\\"");
3924 pp_string (pp
, "\\'");
3928 if (str
[0] || n
> 1)
3930 if (!ISPRINT (str
[0]))
3933 sprintf (buf
, "\\x%02x", (unsigned char)str
[0]);
3934 pp_string (pp
, buf
);
3937 pp_character (pp
, str
[0]);
3945 maybe_init_pretty_print (FILE *file
)
3949 tree_pp
= new pretty_printer ();
3950 pp_needs_newline (tree_pp
) = true;
3951 pp_translate_identifiers (tree_pp
) = false;
3954 tree_pp
->buffer
->stream
= file
;
3958 newline_and_indent (pretty_printer
*pp
, int spc
)
3964 /* Handle the %K format for TEXT. Separate from default_tree_printer
3965 so it can also be used in front ends.
3966 The location LOC and BLOCK are expected to be extracted by the caller
3967 from the %K argument arg via EXPR_LOCATION(arg) and TREE_BLOCK(arg). */
3970 percent_K_format (text_info
*text
, location_t loc
, tree block
)
3972 text
->set_location (0, loc
, SHOW_RANGE_WITH_CARET
);
3973 gcc_assert (pp_ti_abstract_origin (text
) != NULL
);
3974 *pp_ti_abstract_origin (text
) = NULL
;
3977 && TREE_CODE (block
) == BLOCK
3978 && BLOCK_ABSTRACT_ORIGIN (block
))
3980 tree ao
= BLOCK_ABSTRACT_ORIGIN (block
);
3981 if (TREE_CODE (ao
) == FUNCTION_DECL
)
3983 *pp_ti_abstract_origin (text
) = block
;
3986 block
= BLOCK_SUPERCONTEXT (block
);
3990 /* Print the identifier ID to PRETTY-PRINTER. */
3993 pp_tree_identifier (pretty_printer
*pp
, tree id
)
3995 if (pp_translate_identifiers (pp
))
3997 const char *text
= identifier_to_locale (IDENTIFIER_POINTER (id
));
3998 pp_append_text (pp
, text
, text
+ strlen (text
));
4001 pp_append_text (pp
, IDENTIFIER_POINTER (id
),
4002 IDENTIFIER_POINTER (id
) + IDENTIFIER_LENGTH (id
));
4005 /* A helper function that is used to dump function information before the
4009 dump_function_header (FILE *dump_file
, tree fdecl
, dump_flags_t flags
)
4011 const char *dname
, *aname
;
4012 struct cgraph_node
*node
= cgraph_node::get (fdecl
);
4013 struct function
*fun
= DECL_STRUCT_FUNCTION (fdecl
);
4015 dname
= lang_hooks
.decl_printable_name (fdecl
, 1);
4017 if (DECL_ASSEMBLER_NAME_SET_P (fdecl
))
4018 aname
= (IDENTIFIER_POINTER
4019 (DECL_ASSEMBLER_NAME (fdecl
)));
4021 aname
= "<unset-asm-name>";
4023 fprintf (dump_file
, "\n;; Function %s (%s, funcdef_no=%d",
4024 dname
, aname
, fun
->funcdef_no
);
4025 if (!(flags
& TDF_NOUID
))
4026 fprintf (dump_file
, ", decl_uid=%d", DECL_UID (fdecl
));
4029 fprintf (dump_file
, ", cgraph_uid=%d", node
->get_uid ());
4030 fprintf (dump_file
, ", symbol_order=%d)%s\n\n", node
->order
,
4031 node
->frequency
== NODE_FREQUENCY_HOT
4033 : node
->frequency
== NODE_FREQUENCY_UNLIKELY_EXECUTED
4034 ? " (unlikely executed)"
4035 : node
->frequency
== NODE_FREQUENCY_EXECUTED_ONCE
4036 ? " (executed once)"
4040 fprintf (dump_file
, ")\n\n");
4043 /* Dump double_int D to pretty_printer PP. UNS is true
4044 if D is unsigned and false otherwise. */
4046 pp_double_int (pretty_printer
*pp
, double_int d
, bool uns
)
4049 pp_wide_integer (pp
, d
.low
);
4050 else if (d
.fits_uhwi ())
4051 pp_unsigned_wide_integer (pp
, d
.low
);
4054 unsigned HOST_WIDE_INT low
= d
.low
;
4055 HOST_WIDE_INT high
= d
.high
;
4056 if (!uns
&& d
.is_negative ())
4059 high
= ~high
+ !low
;
4062 /* Would "%x%0*x" or "%x%*0x" get zero-padding on all
4064 sprintf (pp_buffer (pp
)->digit_buffer
,
4065 HOST_WIDE_INT_PRINT_DOUBLE_HEX
,
4066 (unsigned HOST_WIDE_INT
) high
, low
);
4067 pp_string (pp
, pp_buffer (pp
)->digit_buffer
);