1 /* Pretty formatting of GENERIC trees in C syntax.
2 Copyright (C) 2001-2017 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"
37 /* Local functions, macros and variables. */
38 static const char *op_symbol (const_tree
);
39 static void pretty_print_string (pretty_printer
*, const char*);
40 static void newline_and_indent (pretty_printer
*, int);
41 static void maybe_init_pretty_print (FILE *);
42 static void print_struct_decl (pretty_printer
*, const_tree
, int, dump_flags_t
);
43 static void do_niy (pretty_printer
*, const_tree
, dump_flags_t
);
45 #define INDENT(SPACE) do { \
46 int i; for (i = 0; i<SPACE; i++) pp_space (pp); } while (0)
48 #define NIY do_niy (pp, node, flags)
50 static pretty_printer
*tree_pp
;
52 /* Try to print something for an unknown tree code. */
55 do_niy (pretty_printer
*pp
, const_tree node
, dump_flags_t flags
)
59 pp_string (pp
, "<<< Unknown tree: ");
60 pp_string (pp
, get_tree_code_name (TREE_CODE (node
)));
64 len
= TREE_OPERAND_LENGTH (node
);
65 for (i
= 0; i
< len
; ++i
)
67 newline_and_indent (pp
, 2);
68 dump_generic_node (pp
, TREE_OPERAND (node
, i
), 2, flags
, false);
72 pp_string (pp
, " >>>");
75 /* Debugging function to print out a generic expression. */
78 debug_generic_expr (tree t
)
80 print_generic_expr (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
);
81 fprintf (stderr
, "\n");
84 /* Debugging function to print out a generic statement. */
87 debug_generic_stmt (tree t
)
89 print_generic_stmt (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
);
90 fprintf (stderr
, "\n");
93 /* Debugging function to print out a chain of trees . */
96 debug_tree_chain (tree t
)
102 print_generic_expr (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
|TDF_UID
);
103 fprintf (stderr
, " ");
107 fprintf (stderr
, "... [cycled back to ");
108 print_generic_expr (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
|TDF_UID
);
109 fprintf (stderr
, "]");
113 fprintf (stderr
, "\n");
116 /* Prints declaration DECL to the FILE with details specified by FLAGS. */
118 print_generic_decl (FILE *file
, tree decl
, dump_flags_t flags
)
120 maybe_init_pretty_print (file
);
121 print_declaration (tree_pp
, decl
, 2, flags
);
122 pp_write_text_to_stream (tree_pp
);
125 /* Print tree T, and its successors, on file FILE. FLAGS specifies details
126 to show in the dump. See TDF_* in dumpfile.h. */
129 print_generic_stmt (FILE *file
, tree t
, dump_flags_t flags
)
131 maybe_init_pretty_print (file
);
132 dump_generic_node (tree_pp
, t
, 0, flags
, true);
133 pp_newline_and_flush (tree_pp
);
136 /* Print tree T, and its successors, on file FILE. FLAGS specifies details
137 to show in the dump. See TDF_* in dumpfile.h. The output is indented by
141 print_generic_stmt_indented (FILE *file
, tree t
, dump_flags_t flags
, int indent
)
145 maybe_init_pretty_print (file
);
147 for (i
= 0; i
< indent
; i
++)
149 dump_generic_node (tree_pp
, t
, indent
, flags
, true);
150 pp_newline_and_flush (tree_pp
);
153 /* Print a single expression T on file FILE. FLAGS specifies details to show
154 in the dump. See TDF_* in dumpfile.h. */
157 print_generic_expr (FILE *file
, tree t
, dump_flags_t flags
)
159 maybe_init_pretty_print (file
);
160 dump_generic_node (tree_pp
, t
, 0, flags
, false);
164 /* Dump NAME, an IDENTIFIER_POINTER, sanitized so that D<num> sequences
165 in it are replaced with Dxxxx, as long as they are at the start or
166 preceded by $ and at the end or followed by $. See make_fancy_name
170 dump_fancy_name (pretty_printer
*pp
, tree name
)
173 int length
= IDENTIFIER_LENGTH (name
);
174 const char *n
= IDENTIFIER_POINTER (name
);
181 && (n
== IDENTIFIER_POINTER (name
) || n
[-1] == '$'))
184 while (ISDIGIT (n
[l
]))
186 if (n
[l
] == '\0' || n
[l
] == '$')
199 pp_tree_identifier (pp
, name
);
203 char *str
= XNEWVEC (char, length
+ 1);
206 q
= n
= IDENTIFIER_POINTER (name
);
213 && (q
== IDENTIFIER_POINTER (name
) || q
[-1] == '$'))
216 while (ISDIGIT (q
[l
]))
218 if (q
[l
] == '\0' || q
[l
] == '$')
220 memcpy (p
, n
, q
- n
);
221 memcpy (p
+ (q
- n
), "Dxxxx", 5);
231 memcpy (p
, n
, IDENTIFIER_LENGTH (name
) - (n
- IDENTIFIER_POINTER (name
)));
233 if (pp_translate_identifiers (pp
))
235 const char *text
= identifier_to_locale (str
);
236 pp_append_text (pp
, text
, text
+ strlen (text
));
239 pp_append_text (pp
, str
, str
+ length
);
243 /* Dump the name of a _DECL node and its DECL_UID if TDF_UID is set
247 dump_decl_name (pretty_printer
*pp
, tree node
, dump_flags_t flags
)
249 if (DECL_NAME (node
))
251 if ((flags
& TDF_ASMNAME
) && DECL_ASSEMBLER_NAME_SET_P (node
))
252 pp_tree_identifier (pp
, DECL_ASSEMBLER_NAME (node
));
253 /* For DECL_NAMELESS names look for embedded uids in the
254 names and sanitize them for TDF_NOUID. */
255 else if ((flags
& TDF_NOUID
) && DECL_NAMELESS (node
))
256 dump_fancy_name (pp
, DECL_NAME (node
));
258 pp_tree_identifier (pp
, DECL_NAME (node
));
260 char uid_sep
= (flags
& TDF_GIMPLE
) ? '_' : '.';
261 if ((flags
& TDF_UID
) || DECL_NAME (node
) == NULL_TREE
)
263 if (TREE_CODE (node
) == LABEL_DECL
&& LABEL_DECL_UID (node
) != -1)
264 pp_printf (pp
, "L%c%d", uid_sep
, (int) LABEL_DECL_UID (node
));
265 else if (TREE_CODE (node
) == DEBUG_EXPR_DECL
)
267 if (flags
& TDF_NOUID
)
268 pp_string (pp
, "D#xxxx");
270 pp_printf (pp
, "D#%i", DEBUG_TEMP_UID (node
));
274 char c
= TREE_CODE (node
) == CONST_DECL
? 'C' : 'D';
275 if (flags
& TDF_NOUID
)
276 pp_printf (pp
, "%c.xxxx", c
);
278 pp_printf (pp
, "%c%c%u", c
, uid_sep
, DECL_UID (node
));
281 if ((flags
& TDF_ALIAS
) && DECL_PT_UID (node
) != DECL_UID (node
))
283 if (flags
& TDF_NOUID
)
284 pp_printf (pp
, "ptD.xxxx");
286 pp_printf (pp
, "ptD.%u", DECL_PT_UID (node
));
290 /* Like the above, but used for pretty printing function calls. */
293 dump_function_name (pretty_printer
*pp
, tree node
, dump_flags_t flags
)
295 if (CONVERT_EXPR_P (node
))
296 node
= TREE_OPERAND (node
, 0);
297 if (DECL_NAME (node
) && (flags
& TDF_ASMNAME
) == 0)
298 pp_string (pp
, lang_hooks
.decl_printable_name (node
, 1));
300 dump_decl_name (pp
, node
, flags
);
303 /* Dump a function declaration. NODE is the FUNCTION_TYPE. PP, SPC and
304 FLAGS are as in dump_generic_node. */
307 dump_function_declaration (pretty_printer
*pp
, tree node
,
308 int spc
, dump_flags_t flags
)
310 bool wrote_arg
= false;
316 /* Print the argument types. */
317 arg
= TYPE_ARG_TYPES (node
);
318 while (arg
&& arg
!= void_list_node
&& arg
!= error_mark_node
)
326 dump_generic_node (pp
, TREE_VALUE (arg
), spc
, flags
, false);
327 arg
= TREE_CHAIN (arg
);
330 /* Drop the trailing void_type_node if we had any previous argument. */
331 if (arg
== void_list_node
&& !wrote_arg
)
332 pp_string (pp
, "void");
333 /* Properly dump vararg function types. */
334 else if (!arg
&& wrote_arg
)
335 pp_string (pp
, ", ...");
336 /* Avoid printing any arg for unprototyped functions. */
341 /* Dump the domain associated with an array. */
344 dump_array_domain (pretty_printer
*pp
, tree domain
, int spc
, dump_flags_t flags
)
346 pp_left_bracket (pp
);
349 tree min
= TYPE_MIN_VALUE (domain
);
350 tree max
= TYPE_MAX_VALUE (domain
);
353 && integer_zerop (min
)
354 && tree_fits_shwi_p (max
))
355 pp_wide_integer (pp
, tree_to_shwi (max
) + 1);
359 dump_generic_node (pp
, min
, spc
, flags
, false);
362 dump_generic_node (pp
, max
, spc
, flags
, false);
366 pp_string (pp
, "<unknown>");
367 pp_right_bracket (pp
);
371 /* Dump OpenMP clause CLAUSE. PP, CLAUSE, SPC and FLAGS are as in
372 dump_generic_node. */
375 dump_omp_clause (pretty_printer
*pp
, tree clause
, int spc
, dump_flags_t flags
)
379 switch (OMP_CLAUSE_CODE (clause
))
381 case OMP_CLAUSE_PRIVATE
:
384 case OMP_CLAUSE_SHARED
:
387 case OMP_CLAUSE_FIRSTPRIVATE
:
388 name
= "firstprivate";
390 case OMP_CLAUSE_LASTPRIVATE
:
391 name
= "lastprivate";
393 case OMP_CLAUSE_COPYIN
:
396 case OMP_CLAUSE_COPYPRIVATE
:
397 name
= "copyprivate";
399 case OMP_CLAUSE_UNIFORM
:
402 case OMP_CLAUSE_USE_DEVICE_PTR
:
403 name
= "use_device_ptr";
405 case OMP_CLAUSE_IS_DEVICE_PTR
:
406 name
= "is_device_ptr";
408 case OMP_CLAUSE__LOOPTEMP_
:
411 case OMP_CLAUSE_TO_DECLARE
:
414 case OMP_CLAUSE_LINK
:
418 pp_string (pp
, name
);
420 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
425 case OMP_CLAUSE_REDUCTION
:
426 pp_string (pp
, "reduction(");
427 if (OMP_CLAUSE_REDUCTION_CODE (clause
) != ERROR_MARK
)
430 op_symbol_code (OMP_CLAUSE_REDUCTION_CODE (clause
)));
433 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
439 pp_string (pp
, "if(");
440 switch (OMP_CLAUSE_IF_MODIFIER (clause
))
442 case ERROR_MARK
: break;
443 case OMP_PARALLEL
: pp_string (pp
, "parallel:"); break;
444 case OMP_TASK
: pp_string (pp
, "task:"); break;
445 case OMP_TASKLOOP
: pp_string (pp
, "taskloop:"); break;
446 case OMP_TARGET_DATA
: pp_string (pp
, "target data:"); break;
447 case OMP_TARGET
: pp_string (pp
, "target:"); break;
448 case OMP_TARGET_UPDATE
: pp_string (pp
, "target update:"); break;
449 case OMP_TARGET_ENTER_DATA
:
450 pp_string (pp
, "target enter data:"); break;
451 case OMP_TARGET_EXIT_DATA
: pp_string (pp
, "target exit data:"); break;
452 default: gcc_unreachable ();
454 dump_generic_node (pp
, OMP_CLAUSE_IF_EXPR (clause
),
459 case OMP_CLAUSE_NUM_THREADS
:
460 pp_string (pp
, "num_threads(");
461 dump_generic_node (pp
, OMP_CLAUSE_NUM_THREADS_EXPR (clause
),
466 case OMP_CLAUSE__CILK_FOR_COUNT_
:
467 pp_string (pp
, "_Cilk_for_count_(");
468 dump_generic_node (pp
, OMP_CLAUSE_OPERAND (clause
, 0),
473 case OMP_CLAUSE_NOWAIT
:
474 pp_string (pp
, "nowait");
476 case OMP_CLAUSE_ORDERED
:
477 pp_string (pp
, "ordered");
478 if (OMP_CLAUSE_ORDERED_EXPR (clause
))
481 dump_generic_node (pp
, OMP_CLAUSE_ORDERED_EXPR (clause
),
487 case OMP_CLAUSE_DEFAULT
:
488 pp_string (pp
, "default(");
489 switch (OMP_CLAUSE_DEFAULT_KIND (clause
))
491 case OMP_CLAUSE_DEFAULT_UNSPECIFIED
:
493 case OMP_CLAUSE_DEFAULT_SHARED
:
494 pp_string (pp
, "shared");
496 case OMP_CLAUSE_DEFAULT_NONE
:
497 pp_string (pp
, "none");
499 case OMP_CLAUSE_DEFAULT_PRIVATE
:
500 pp_string (pp
, "private");
502 case OMP_CLAUSE_DEFAULT_FIRSTPRIVATE
:
503 pp_string (pp
, "firstprivate");
505 case OMP_CLAUSE_DEFAULT_PRESENT
:
506 pp_string (pp
, "present");
514 case OMP_CLAUSE_SCHEDULE
:
515 pp_string (pp
, "schedule(");
516 if (OMP_CLAUSE_SCHEDULE_KIND (clause
)
517 & (OMP_CLAUSE_SCHEDULE_MONOTONIC
518 | OMP_CLAUSE_SCHEDULE_NONMONOTONIC
))
520 if (OMP_CLAUSE_SCHEDULE_KIND (clause
)
521 & OMP_CLAUSE_SCHEDULE_MONOTONIC
)
522 pp_string (pp
, "monotonic");
524 pp_string (pp
, "nonmonotonic");
525 if (OMP_CLAUSE_SCHEDULE_SIMD (clause
))
530 if (OMP_CLAUSE_SCHEDULE_SIMD (clause
))
531 pp_string (pp
, "simd:");
533 switch (OMP_CLAUSE_SCHEDULE_KIND (clause
) & OMP_CLAUSE_SCHEDULE_MASK
)
535 case OMP_CLAUSE_SCHEDULE_STATIC
:
536 pp_string (pp
, "static");
538 case OMP_CLAUSE_SCHEDULE_DYNAMIC
:
539 pp_string (pp
, "dynamic");
541 case OMP_CLAUSE_SCHEDULE_GUIDED
:
542 pp_string (pp
, "guided");
544 case OMP_CLAUSE_SCHEDULE_RUNTIME
:
545 pp_string (pp
, "runtime");
547 case OMP_CLAUSE_SCHEDULE_AUTO
:
548 pp_string (pp
, "auto");
550 case OMP_CLAUSE_SCHEDULE_CILKFOR
:
551 pp_string (pp
, "cilk-for grain");
556 if (OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (clause
))
559 dump_generic_node (pp
, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (clause
),
565 case OMP_CLAUSE_UNTIED
:
566 pp_string (pp
, "untied");
569 case OMP_CLAUSE_COLLAPSE
:
570 pp_string (pp
, "collapse(");
571 dump_generic_node (pp
, OMP_CLAUSE_COLLAPSE_EXPR (clause
),
576 case OMP_CLAUSE_FINAL
:
577 pp_string (pp
, "final(");
578 dump_generic_node (pp
, OMP_CLAUSE_FINAL_EXPR (clause
),
583 case OMP_CLAUSE_MERGEABLE
:
584 pp_string (pp
, "mergeable");
587 case OMP_CLAUSE_LINEAR
:
588 pp_string (pp
, "linear(");
589 switch (OMP_CLAUSE_LINEAR_KIND (clause
))
591 case OMP_CLAUSE_LINEAR_DEFAULT
:
593 case OMP_CLAUSE_LINEAR_REF
:
594 pp_string (pp
, "ref(");
596 case OMP_CLAUSE_LINEAR_VAL
:
597 pp_string (pp
, "val(");
599 case OMP_CLAUSE_LINEAR_UVAL
:
600 pp_string (pp
, "uval(");
605 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
607 if (OMP_CLAUSE_LINEAR_KIND (clause
) != OMP_CLAUSE_LINEAR_DEFAULT
)
610 dump_generic_node (pp
, OMP_CLAUSE_LINEAR_STEP (clause
),
615 case OMP_CLAUSE_ALIGNED
:
616 pp_string (pp
, "aligned(");
617 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
619 if (OMP_CLAUSE_ALIGNED_ALIGNMENT (clause
))
622 dump_generic_node (pp
, OMP_CLAUSE_ALIGNED_ALIGNMENT (clause
),
628 case OMP_CLAUSE_DEPEND
:
629 pp_string (pp
, "depend(");
630 switch (OMP_CLAUSE_DEPEND_KIND (clause
))
632 case OMP_CLAUSE_DEPEND_IN
:
633 pp_string (pp
, "in");
635 case OMP_CLAUSE_DEPEND_OUT
:
636 pp_string (pp
, "out");
638 case OMP_CLAUSE_DEPEND_INOUT
:
639 pp_string (pp
, "inout");
641 case OMP_CLAUSE_DEPEND_SOURCE
:
642 pp_string (pp
, "source)");
644 case OMP_CLAUSE_DEPEND_SINK
:
645 pp_string (pp
, "sink:");
646 for (tree t
= OMP_CLAUSE_DECL (clause
); t
; t
= TREE_CHAIN (t
))
647 if (TREE_CODE (t
) == TREE_LIST
)
649 dump_generic_node (pp
, TREE_VALUE (t
), spc
, flags
, false);
650 if (TREE_PURPOSE (t
) != integer_zero_node
)
652 if (OMP_CLAUSE_DEPEND_SINK_NEGATIVE (t
))
656 dump_generic_node (pp
, TREE_PURPOSE (t
), spc
, flags
,
670 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
676 pp_string (pp
, "map(");
677 switch (OMP_CLAUSE_MAP_KIND (clause
))
680 case GOMP_MAP_POINTER
:
681 pp_string (pp
, "alloc");
684 case GOMP_MAP_TO_PSET
:
685 pp_string (pp
, "to");
688 pp_string (pp
, "from");
690 case GOMP_MAP_TOFROM
:
691 pp_string (pp
, "tofrom");
693 case GOMP_MAP_FORCE_ALLOC
:
694 pp_string (pp
, "force_alloc");
696 case GOMP_MAP_FORCE_TO
:
697 pp_string (pp
, "force_to");
699 case GOMP_MAP_FORCE_FROM
:
700 pp_string (pp
, "force_from");
702 case GOMP_MAP_FORCE_TOFROM
:
703 pp_string (pp
, "force_tofrom");
705 case GOMP_MAP_FORCE_PRESENT
:
706 pp_string (pp
, "force_present");
708 case GOMP_MAP_DELETE
:
709 pp_string (pp
, "delete");
711 case GOMP_MAP_FORCE_DEVICEPTR
:
712 pp_string (pp
, "force_deviceptr");
714 case GOMP_MAP_ALWAYS_TO
:
715 pp_string (pp
, "always,to");
717 case GOMP_MAP_ALWAYS_FROM
:
718 pp_string (pp
, "always,from");
720 case GOMP_MAP_ALWAYS_TOFROM
:
721 pp_string (pp
, "always,tofrom");
723 case GOMP_MAP_RELEASE
:
724 pp_string (pp
, "release");
726 case GOMP_MAP_FIRSTPRIVATE_POINTER
:
727 pp_string (pp
, "firstprivate");
729 case GOMP_MAP_FIRSTPRIVATE_REFERENCE
:
730 pp_string (pp
, "firstprivate ref");
732 case GOMP_MAP_STRUCT
:
733 pp_string (pp
, "struct");
735 case GOMP_MAP_ALWAYS_POINTER
:
736 pp_string (pp
, "always_pointer");
738 case GOMP_MAP_DEVICE_RESIDENT
:
739 pp_string (pp
, "device_resident");
742 pp_string (pp
, "link");
748 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
751 if (OMP_CLAUSE_SIZE (clause
))
753 switch (OMP_CLAUSE_CODE (clause
) == OMP_CLAUSE_MAP
754 ? OMP_CLAUSE_MAP_KIND (clause
) : GOMP_MAP_TO
)
756 case GOMP_MAP_POINTER
:
757 case GOMP_MAP_FIRSTPRIVATE_POINTER
:
758 case GOMP_MAP_FIRSTPRIVATE_REFERENCE
:
759 case GOMP_MAP_ALWAYS_POINTER
:
760 pp_string (pp
, " [pointer assign, bias: ");
762 case GOMP_MAP_TO_PSET
:
763 pp_string (pp
, " [pointer set, len: ");
766 pp_string (pp
, " [len: ");
769 dump_generic_node (pp
, OMP_CLAUSE_SIZE (clause
),
771 pp_right_bracket (pp
);
776 case OMP_CLAUSE_FROM
:
777 pp_string (pp
, "from(");
778 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
780 goto print_clause_size
;
783 pp_string (pp
, "to(");
784 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
786 goto print_clause_size
;
788 case OMP_CLAUSE__CACHE_
:
790 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
792 goto print_clause_size
;
794 case OMP_CLAUSE_NUM_TEAMS
:
795 pp_string (pp
, "num_teams(");
796 dump_generic_node (pp
, OMP_CLAUSE_NUM_TEAMS_EXPR (clause
),
801 case OMP_CLAUSE_THREAD_LIMIT
:
802 pp_string (pp
, "thread_limit(");
803 dump_generic_node (pp
, OMP_CLAUSE_THREAD_LIMIT_EXPR (clause
),
808 case OMP_CLAUSE_DEVICE
:
809 pp_string (pp
, "device(");
810 dump_generic_node (pp
, OMP_CLAUSE_DEVICE_ID (clause
),
815 case OMP_CLAUSE_DIST_SCHEDULE
:
816 pp_string (pp
, "dist_schedule(static");
817 if (OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR (clause
))
820 dump_generic_node (pp
,
821 OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR (clause
),
827 case OMP_CLAUSE_PROC_BIND
:
828 pp_string (pp
, "proc_bind(");
829 switch (OMP_CLAUSE_PROC_BIND_KIND (clause
))
831 case OMP_CLAUSE_PROC_BIND_MASTER
:
832 pp_string (pp
, "master");
834 case OMP_CLAUSE_PROC_BIND_CLOSE
:
835 pp_string (pp
, "close");
837 case OMP_CLAUSE_PROC_BIND_SPREAD
:
838 pp_string (pp
, "spread");
846 case OMP_CLAUSE_SAFELEN
:
847 pp_string (pp
, "safelen(");
848 dump_generic_node (pp
, OMP_CLAUSE_SAFELEN_EXPR (clause
),
853 case OMP_CLAUSE_SIMDLEN
:
854 pp_string (pp
, "simdlen(");
855 dump_generic_node (pp
, OMP_CLAUSE_SIMDLEN_EXPR (clause
),
860 case OMP_CLAUSE_PRIORITY
:
861 pp_string (pp
, "priority(");
862 dump_generic_node (pp
, OMP_CLAUSE_PRIORITY_EXPR (clause
),
867 case OMP_CLAUSE_GRAINSIZE
:
868 pp_string (pp
, "grainsize(");
869 dump_generic_node (pp
, OMP_CLAUSE_GRAINSIZE_EXPR (clause
),
874 case OMP_CLAUSE_NUM_TASKS
:
875 pp_string (pp
, "num_tasks(");
876 dump_generic_node (pp
, OMP_CLAUSE_NUM_TASKS_EXPR (clause
),
881 case OMP_CLAUSE_HINT
:
882 pp_string (pp
, "hint(");
883 dump_generic_node (pp
, OMP_CLAUSE_HINT_EXPR (clause
),
888 case OMP_CLAUSE_DEFAULTMAP
:
889 pp_string (pp
, "defaultmap(tofrom:scalar)");
892 case OMP_CLAUSE__SIMDUID_
:
893 pp_string (pp
, "_simduid_(");
894 dump_generic_node (pp
, OMP_CLAUSE__SIMDUID__DECL (clause
),
899 case OMP_CLAUSE__SIMT_
:
900 pp_string (pp
, "_simt_");
903 case OMP_CLAUSE_GANG
:
904 pp_string (pp
, "gang");
905 if (OMP_CLAUSE_GANG_EXPR (clause
) != NULL_TREE
)
907 pp_string (pp
, "(num: ");
908 dump_generic_node (pp
, OMP_CLAUSE_GANG_EXPR (clause
),
911 if (OMP_CLAUSE_GANG_STATIC_EXPR (clause
) != NULL_TREE
)
913 if (OMP_CLAUSE_GANG_EXPR (clause
) == NULL_TREE
)
917 pp_string (pp
, "static:");
918 if (OMP_CLAUSE_GANG_STATIC_EXPR (clause
)
919 == integer_minus_one_node
)
920 pp_character (pp
, '*');
922 dump_generic_node (pp
, OMP_CLAUSE_GANG_STATIC_EXPR (clause
),
925 if (OMP_CLAUSE_GANG_EXPR (clause
) != NULL_TREE
926 || OMP_CLAUSE_GANG_STATIC_EXPR (clause
) != NULL_TREE
)
930 case OMP_CLAUSE_ASYNC
:
931 pp_string (pp
, "async");
932 if (OMP_CLAUSE_ASYNC_EXPR (clause
))
934 pp_character(pp
, '(');
935 dump_generic_node (pp
, OMP_CLAUSE_ASYNC_EXPR (clause
),
937 pp_character(pp
, ')');
941 case OMP_CLAUSE_AUTO
:
943 pp_string (pp
, omp_clause_code_name
[OMP_CLAUSE_CODE (clause
)]);
946 case OMP_CLAUSE_WAIT
:
947 pp_string (pp
, "wait(");
948 dump_generic_node (pp
, OMP_CLAUSE_WAIT_EXPR (clause
),
950 pp_character(pp
, ')');
953 case OMP_CLAUSE_WORKER
:
954 pp_string (pp
, "worker");
955 if (OMP_CLAUSE_WORKER_EXPR (clause
) != NULL_TREE
)
958 dump_generic_node (pp
, OMP_CLAUSE_WORKER_EXPR (clause
),
964 case OMP_CLAUSE_VECTOR
:
965 pp_string (pp
, "vector");
966 if (OMP_CLAUSE_VECTOR_EXPR (clause
) != NULL_TREE
)
969 dump_generic_node (pp
, OMP_CLAUSE_VECTOR_EXPR (clause
),
975 case OMP_CLAUSE_NUM_GANGS
:
976 pp_string (pp
, "num_gangs(");
977 dump_generic_node (pp
, OMP_CLAUSE_NUM_GANGS_EXPR (clause
),
979 pp_character (pp
, ')');
982 case OMP_CLAUSE_NUM_WORKERS
:
983 pp_string (pp
, "num_workers(");
984 dump_generic_node (pp
, OMP_CLAUSE_NUM_WORKERS_EXPR (clause
),
986 pp_character (pp
, ')');
989 case OMP_CLAUSE_VECTOR_LENGTH
:
990 pp_string (pp
, "vector_length(");
991 dump_generic_node (pp
, OMP_CLAUSE_VECTOR_LENGTH_EXPR (clause
),
993 pp_character (pp
, ')');
996 case OMP_CLAUSE_INBRANCH
:
997 pp_string (pp
, "inbranch");
999 case OMP_CLAUSE_NOTINBRANCH
:
1000 pp_string (pp
, "notinbranch");
1002 case OMP_CLAUSE_FOR
:
1003 pp_string (pp
, "for");
1005 case OMP_CLAUSE_PARALLEL
:
1006 pp_string (pp
, "parallel");
1008 case OMP_CLAUSE_SECTIONS
:
1009 pp_string (pp
, "sections");
1011 case OMP_CLAUSE_TASKGROUP
:
1012 pp_string (pp
, "taskgroup");
1014 case OMP_CLAUSE_NOGROUP
:
1015 pp_string (pp
, "nogroup");
1017 case OMP_CLAUSE_THREADS
:
1018 pp_string (pp
, "threads");
1020 case OMP_CLAUSE_SIMD
:
1021 pp_string (pp
, "simd");
1023 case OMP_CLAUSE_INDEPENDENT
:
1024 pp_string (pp
, "independent");
1026 case OMP_CLAUSE_TILE
:
1027 pp_string (pp
, "tile(");
1028 dump_generic_node (pp
, OMP_CLAUSE_TILE_LIST (clause
),
1030 pp_right_paren (pp
);
1033 case OMP_CLAUSE__GRIDDIM_
:
1034 pp_string (pp
, "_griddim_(");
1035 pp_unsigned_wide_integer (pp
, OMP_CLAUSE__GRIDDIM__DIMENSION (clause
));
1037 dump_generic_node (pp
, OMP_CLAUSE__GRIDDIM__SIZE (clause
), spc
, flags
,
1040 dump_generic_node (pp
, OMP_CLAUSE__GRIDDIM__GROUP (clause
), spc
, flags
,
1042 pp_right_paren (pp
);
1046 /* Should never happen. */
1047 dump_generic_node (pp
, clause
, spc
, flags
, false);
1053 /* Dump the list of OpenMP clauses. PP, SPC and FLAGS are as in
1054 dump_generic_node. */
1057 dump_omp_clauses (pretty_printer
*pp
, tree clause
, int spc
, dump_flags_t flags
)
1065 dump_omp_clause (pp
, clause
, spc
, flags
);
1066 clause
= OMP_CLAUSE_CHAIN (clause
);
1074 /* Dump location LOC to PP. */
1077 dump_location (pretty_printer
*pp
, location_t loc
)
1079 expanded_location xloc
= expand_location (loc
);
1081 pp_left_bracket (pp
);
1084 pp_string (pp
, xloc
.file
);
1085 pp_string (pp
, ":");
1087 pp_decimal_int (pp
, xloc
.line
);
1089 pp_decimal_int (pp
, xloc
.column
);
1090 pp_string (pp
, "] ");
1094 /* Dump lexical block BLOCK. PP, SPC and FLAGS are as in
1095 dump_generic_node. */
1098 dump_block_node (pretty_printer
*pp
, tree block
, int spc
, dump_flags_t flags
)
1102 pp_printf (pp
, "BLOCK #%d ", BLOCK_NUMBER (block
));
1104 if (flags
& TDF_ADDRESS
)
1105 pp_printf (pp
, "[%p] ", (void *) block
);
1107 if (BLOCK_ABSTRACT (block
))
1108 pp_string (pp
, "[abstract] ");
1110 if (TREE_ASM_WRITTEN (block
))
1111 pp_string (pp
, "[written] ");
1113 if (flags
& TDF_SLIM
)
1116 if (BLOCK_SOURCE_LOCATION (block
))
1117 dump_location (pp
, BLOCK_SOURCE_LOCATION (block
));
1119 newline_and_indent (pp
, spc
+ 2);
1121 if (BLOCK_SUPERCONTEXT (block
))
1123 pp_string (pp
, "SUPERCONTEXT: ");
1124 dump_generic_node (pp
, BLOCK_SUPERCONTEXT (block
), 0,
1125 flags
| TDF_SLIM
, false);
1126 newline_and_indent (pp
, spc
+ 2);
1129 if (BLOCK_SUBBLOCKS (block
))
1131 pp_string (pp
, "SUBBLOCKS: ");
1132 for (t
= BLOCK_SUBBLOCKS (block
); t
; t
= BLOCK_CHAIN (t
))
1134 dump_generic_node (pp
, t
, 0, flags
| TDF_SLIM
, false);
1137 newline_and_indent (pp
, spc
+ 2);
1140 if (BLOCK_CHAIN (block
))
1142 pp_string (pp
, "SIBLINGS: ");
1143 for (t
= BLOCK_CHAIN (block
); t
; t
= BLOCK_CHAIN (t
))
1145 dump_generic_node (pp
, t
, 0, flags
| TDF_SLIM
, false);
1148 newline_and_indent (pp
, spc
+ 2);
1151 if (BLOCK_VARS (block
))
1153 pp_string (pp
, "VARS: ");
1154 for (t
= BLOCK_VARS (block
); t
; t
= TREE_CHAIN (t
))
1156 dump_generic_node (pp
, t
, 0, flags
, false);
1159 newline_and_indent (pp
, spc
+ 2);
1162 if (vec_safe_length (BLOCK_NONLOCALIZED_VARS (block
)) > 0)
1165 vec
<tree
, va_gc
> *nlv
= BLOCK_NONLOCALIZED_VARS (block
);
1167 pp_string (pp
, "NONLOCALIZED_VARS: ");
1168 FOR_EACH_VEC_ELT (*nlv
, i
, t
)
1170 dump_generic_node (pp
, t
, 0, flags
, false);
1173 newline_and_indent (pp
, spc
+ 2);
1176 if (BLOCK_ABSTRACT_ORIGIN (block
))
1178 pp_string (pp
, "ABSTRACT_ORIGIN: ");
1179 dump_generic_node (pp
, BLOCK_ABSTRACT_ORIGIN (block
), 0,
1180 flags
| TDF_SLIM
, false);
1181 newline_and_indent (pp
, spc
+ 2);
1184 if (BLOCK_FRAGMENT_ORIGIN (block
))
1186 pp_string (pp
, "FRAGMENT_ORIGIN: ");
1187 dump_generic_node (pp
, BLOCK_FRAGMENT_ORIGIN (block
), 0,
1188 flags
| TDF_SLIM
, false);
1189 newline_and_indent (pp
, spc
+ 2);
1192 if (BLOCK_FRAGMENT_CHAIN (block
))
1194 pp_string (pp
, "FRAGMENT_CHAIN: ");
1195 for (t
= BLOCK_FRAGMENT_CHAIN (block
); t
; t
= BLOCK_FRAGMENT_CHAIN (t
))
1197 dump_generic_node (pp
, t
, 0, flags
| TDF_SLIM
, false);
1200 newline_and_indent (pp
, spc
+ 2);
1205 /* Dump the node NODE on the pretty_printer PP, SPC spaces of
1206 indent. FLAGS specifies details to show in the dump (see TDF_* in
1207 dumpfile.h). If IS_STMT is true, the object printed is considered
1208 to be a statement and it is terminated by ';' if appropriate. */
1211 dump_generic_node (pretty_printer
*pp
, tree node
, int spc
, dump_flags_t flags
,
1218 enum tree_code code
;
1220 if (node
== NULL_TREE
)
1223 is_expr
= EXPR_P (node
);
1225 if (is_stmt
&& (flags
& TDF_STMTADDR
))
1226 pp_printf (pp
, "<&%p> ", (void *)node
);
1228 if ((flags
& TDF_LINENO
) && EXPR_HAS_LOCATION (node
))
1229 dump_location (pp
, EXPR_LOCATION (node
));
1231 code
= TREE_CODE (node
);
1235 pp_string (pp
, "<<< error >>>");
1238 case IDENTIFIER_NODE
:
1239 pp_tree_identifier (pp
, node
);
1243 while (node
&& node
!= error_mark_node
)
1245 if (TREE_PURPOSE (node
))
1247 dump_generic_node (pp
, TREE_PURPOSE (node
), spc
, flags
, false);
1250 dump_generic_node (pp
, TREE_VALUE (node
), spc
, flags
, false);
1251 node
= TREE_CHAIN (node
);
1252 if (node
&& TREE_CODE (node
) == TREE_LIST
)
1261 dump_generic_node (pp
, BINFO_TYPE (node
), spc
, flags
, false);
1267 if (TREE_VEC_LENGTH (node
) > 0)
1269 size_t len
= TREE_VEC_LENGTH (node
);
1270 for (i
= 0; i
< len
- 1; i
++)
1272 dump_generic_node (pp
, TREE_VEC_ELT (node
, i
), spc
, flags
,
1277 dump_generic_node (pp
, TREE_VEC_ELT (node
, len
- 1), spc
,
1284 case POINTER_BOUNDS_TYPE
:
1287 case FIXED_POINT_TYPE
:
1293 unsigned int quals
= TYPE_QUALS (node
);
1294 enum tree_code_class tclass
;
1296 if (quals
& TYPE_QUAL_ATOMIC
)
1297 pp_string (pp
, "atomic ");
1298 if (quals
& TYPE_QUAL_CONST
)
1299 pp_string (pp
, "const ");
1300 else if (quals
& TYPE_QUAL_VOLATILE
)
1301 pp_string (pp
, "volatile ");
1302 else if (quals
& TYPE_QUAL_RESTRICT
)
1303 pp_string (pp
, "restrict ");
1305 if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node
)))
1307 pp_string (pp
, "<address-space-");
1308 pp_decimal_int (pp
, TYPE_ADDR_SPACE (node
));
1309 pp_string (pp
, "> ");
1312 tclass
= TREE_CODE_CLASS (TREE_CODE (node
));
1314 if (tclass
== tcc_declaration
)
1316 if (DECL_NAME (node
))
1317 dump_decl_name (pp
, node
, flags
);
1319 pp_string (pp
, "<unnamed type decl>");
1321 else if (tclass
== tcc_type
)
1323 if (TYPE_NAME (node
))
1325 if (TREE_CODE (TYPE_NAME (node
)) == IDENTIFIER_NODE
)
1326 pp_tree_identifier (pp
, TYPE_NAME (node
));
1327 else if (TREE_CODE (TYPE_NAME (node
)) == TYPE_DECL
1328 && DECL_NAME (TYPE_NAME (node
)))
1329 dump_decl_name (pp
, TYPE_NAME (node
), flags
);
1331 pp_string (pp
, "<unnamed type>");
1333 else if (TREE_CODE (node
) == VECTOR_TYPE
)
1335 pp_string (pp
, "vector");
1337 pp_wide_integer (pp
, TYPE_VECTOR_SUBPARTS (node
));
1338 pp_string (pp
, ") ");
1339 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1341 else if (TREE_CODE (node
) == INTEGER_TYPE
)
1343 if (TYPE_PRECISION (node
) == CHAR_TYPE_SIZE
)
1344 pp_string (pp
, (TYPE_UNSIGNED (node
)
1347 else if (TYPE_PRECISION (node
) == SHORT_TYPE_SIZE
)
1348 pp_string (pp
, (TYPE_UNSIGNED (node
)
1351 else if (TYPE_PRECISION (node
) == INT_TYPE_SIZE
)
1352 pp_string (pp
, (TYPE_UNSIGNED (node
)
1355 else if (TYPE_PRECISION (node
) == LONG_TYPE_SIZE
)
1356 pp_string (pp
, (TYPE_UNSIGNED (node
)
1359 else if (TYPE_PRECISION (node
) == LONG_LONG_TYPE_SIZE
)
1360 pp_string (pp
, (TYPE_UNSIGNED (node
)
1361 ? "unsigned long long"
1362 : "signed long long"));
1363 else if (TYPE_PRECISION (node
) >= CHAR_TYPE_SIZE
1364 && pow2p_hwi (TYPE_PRECISION (node
)))
1366 pp_string (pp
, (TYPE_UNSIGNED (node
) ? "uint" : "int"));
1367 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1368 pp_string (pp
, "_t");
1372 pp_string (pp
, (TYPE_UNSIGNED (node
)
1373 ? "<unnamed-unsigned:"
1374 : "<unnamed-signed:"));
1375 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1379 else if (TREE_CODE (node
) == COMPLEX_TYPE
)
1381 pp_string (pp
, "__complex__ ");
1382 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1384 else if (TREE_CODE (node
) == REAL_TYPE
)
1386 pp_string (pp
, "<float:");
1387 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1390 else if (TREE_CODE (node
) == FIXED_POINT_TYPE
)
1392 pp_string (pp
, "<fixed-point-");
1393 pp_string (pp
, TYPE_SATURATING (node
) ? "sat:" : "nonsat:");
1394 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1397 else if (TREE_CODE (node
) == VOID_TYPE
)
1398 pp_string (pp
, "void");
1400 pp_string (pp
, "<unnamed type>");
1406 case REFERENCE_TYPE
:
1407 str
= (TREE_CODE (node
) == POINTER_TYPE
? "*" : "&");
1409 if (TREE_TYPE (node
) == NULL
)
1411 pp_string (pp
, str
);
1412 pp_string (pp
, "<null type>");
1414 else if (TREE_CODE (TREE_TYPE (node
)) == FUNCTION_TYPE
)
1416 tree fnode
= TREE_TYPE (node
);
1418 dump_generic_node (pp
, TREE_TYPE (fnode
), spc
, flags
, false);
1421 pp_string (pp
, str
);
1422 if (TYPE_NAME (node
) && DECL_NAME (TYPE_NAME (node
)))
1423 dump_decl_name (pp
, TYPE_NAME (node
), flags
);
1424 else if (flags
& TDF_NOUID
)
1425 pp_printf (pp
, "<Txxxx>");
1427 pp_printf (pp
, "<T%x>", TYPE_UID (node
));
1429 pp_right_paren (pp
);
1430 dump_function_declaration (pp
, fnode
, spc
, flags
);
1434 unsigned int quals
= TYPE_QUALS (node
);
1436 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1438 pp_string (pp
, str
);
1440 if (quals
& TYPE_QUAL_CONST
)
1441 pp_string (pp
, " const");
1442 if (quals
& TYPE_QUAL_VOLATILE
)
1443 pp_string (pp
, " volatile");
1444 if (quals
& TYPE_QUAL_RESTRICT
)
1445 pp_string (pp
, " restrict");
1447 if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node
)))
1449 pp_string (pp
, " <address-space-");
1450 pp_decimal_int (pp
, TYPE_ADDR_SPACE (node
));
1454 if (TYPE_REF_CAN_ALIAS_ALL (node
))
1455 pp_string (pp
, " {ref-all}");
1465 if (flags
& TDF_GIMPLE
)
1467 pp_string (pp
, "__MEM <");
1468 dump_generic_node (pp
, TREE_TYPE (node
),
1469 spc
, flags
| TDF_SLIM
, false);
1470 if (TYPE_ALIGN (TREE_TYPE (node
))
1471 != TYPE_ALIGN (TYPE_MAIN_VARIANT (TREE_TYPE (node
))))
1473 pp_string (pp
, ", ");
1474 pp_decimal_int (pp
, TYPE_ALIGN (TREE_TYPE (node
)));
1477 pp_string (pp
, " (");
1478 if (TREE_TYPE (TREE_OPERAND (node
, 0))
1479 != TREE_TYPE (TREE_OPERAND (node
, 1)))
1482 dump_generic_node (pp
, TREE_TYPE (TREE_OPERAND (node
, 1)),
1483 spc
, flags
| TDF_SLIM
, false);
1484 pp_right_paren (pp
);
1486 dump_generic_node (pp
, TREE_OPERAND (node
, 0),
1487 spc
, flags
| TDF_SLIM
, false);
1488 if (! integer_zerop (TREE_OPERAND (node
, 1)))
1490 pp_string (pp
, " + ");
1491 dump_generic_node (pp
, TREE_OPERAND (node
, 1),
1492 spc
, flags
| TDF_SLIM
, false);
1494 pp_right_paren (pp
);
1496 else if (integer_zerop (TREE_OPERAND (node
, 1))
1497 /* Dump the types of INTEGER_CSTs explicitly, for we can't
1498 infer them and MEM_ATTR caching will share MEM_REFs
1499 with differently-typed op0s. */
1500 && TREE_CODE (TREE_OPERAND (node
, 0)) != INTEGER_CST
1501 /* Released SSA_NAMES have no TREE_TYPE. */
1502 && TREE_TYPE (TREE_OPERAND (node
, 0)) != NULL_TREE
1503 /* Same pointer types, but ignoring POINTER_TYPE vs.
1505 && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node
, 0)))
1506 == TREE_TYPE (TREE_TYPE (TREE_OPERAND (node
, 1))))
1507 && (TYPE_MODE (TREE_TYPE (TREE_OPERAND (node
, 0)))
1508 == TYPE_MODE (TREE_TYPE (TREE_OPERAND (node
, 1))))
1509 && (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node
, 0)))
1510 == TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node
, 1))))
1511 /* Same value types ignoring qualifiers. */
1512 && (TYPE_MAIN_VARIANT (TREE_TYPE (node
))
1513 == TYPE_MAIN_VARIANT
1514 (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node
, 1)))))
1515 && (!(flags
& TDF_ALIAS
)
1516 || MR_DEPENDENCE_CLIQUE (node
) == 0))
1518 if (TREE_CODE (TREE_OPERAND (node
, 0)) != ADDR_EXPR
)
1521 dump_generic_node (pp
, TREE_OPERAND (node
, 0),
1525 dump_generic_node (pp
,
1526 TREE_OPERAND (TREE_OPERAND (node
, 0), 0),
1533 pp_string (pp
, "MEM[");
1535 ptype
= TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (node
, 1)));
1536 dump_generic_node (pp
, ptype
,
1537 spc
, flags
| TDF_SLIM
, false);
1538 pp_right_paren (pp
);
1539 dump_generic_node (pp
, TREE_OPERAND (node
, 0),
1541 if (!integer_zerop (TREE_OPERAND (node
, 1)))
1543 pp_string (pp
, " + ");
1544 dump_generic_node (pp
, TREE_OPERAND (node
, 1),
1547 if ((flags
& TDF_ALIAS
)
1548 && MR_DEPENDENCE_CLIQUE (node
) != 0)
1550 pp_string (pp
, " clique ");
1551 pp_unsigned_wide_integer (pp
, MR_DEPENDENCE_CLIQUE (node
));
1552 pp_string (pp
, " base ");
1553 pp_unsigned_wide_integer (pp
, MR_DEPENDENCE_BASE (node
));
1555 pp_right_bracket (pp
);
1560 case TARGET_MEM_REF
:
1562 const char *sep
= "";
1565 pp_string (pp
, "MEM[");
1567 if (TREE_CODE (TMR_BASE (node
)) == ADDR_EXPR
)
1569 pp_string (pp
, sep
);
1571 pp_string (pp
, "symbol: ");
1572 dump_generic_node (pp
, TREE_OPERAND (TMR_BASE (node
), 0),
1577 pp_string (pp
, sep
);
1579 pp_string (pp
, "base: ");
1580 dump_generic_node (pp
, TMR_BASE (node
), spc
, flags
, false);
1582 tmp
= TMR_INDEX2 (node
);
1585 pp_string (pp
, sep
);
1587 pp_string (pp
, "base: ");
1588 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1590 tmp
= TMR_INDEX (node
);
1593 pp_string (pp
, sep
);
1595 pp_string (pp
, "index: ");
1596 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1598 tmp
= TMR_STEP (node
);
1601 pp_string (pp
, sep
);
1603 pp_string (pp
, "step: ");
1604 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1606 tmp
= TMR_OFFSET (node
);
1609 pp_string (pp
, sep
);
1611 pp_string (pp
, "offset: ");
1612 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1614 pp_right_bracket (pp
);
1622 /* Print the innermost component type. */
1623 for (tmp
= TREE_TYPE (node
); TREE_CODE (tmp
) == ARRAY_TYPE
;
1624 tmp
= TREE_TYPE (tmp
))
1626 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1628 /* Print the dimensions. */
1629 for (tmp
= node
; TREE_CODE (tmp
) == ARRAY_TYPE
; tmp
= TREE_TYPE (tmp
))
1630 dump_array_domain (pp
, TYPE_DOMAIN (tmp
), spc
, flags
);
1636 case QUAL_UNION_TYPE
:
1638 unsigned int quals
= TYPE_QUALS (node
);
1640 if (quals
& TYPE_QUAL_ATOMIC
)
1641 pp_string (pp
, "atomic ");
1642 if (quals
& TYPE_QUAL_CONST
)
1643 pp_string (pp
, "const ");
1644 if (quals
& TYPE_QUAL_VOLATILE
)
1645 pp_string (pp
, "volatile ");
1647 /* Print the name of the structure. */
1648 if (TREE_CODE (node
) == RECORD_TYPE
)
1649 pp_string (pp
, "struct ");
1650 else if (TREE_CODE (node
) == UNION_TYPE
)
1651 pp_string (pp
, "union ");
1653 if (TYPE_NAME (node
))
1654 dump_generic_node (pp
, TYPE_NAME (node
), spc
, flags
, false);
1655 else if (!(flags
& TDF_SLIM
))
1656 /* FIXME: If we eliminate the 'else' above and attempt
1657 to show the fields for named types, we may get stuck
1658 following a cycle of pointers to structs. The alleged
1659 self-reference check in print_struct_decl will not detect
1660 cycles involving more than one pointer or struct type. */
1661 print_struct_decl (pp
, node
, spc
, flags
);
1670 if (flags
& TDF_GIMPLE
1671 && (POINTER_TYPE_P (TREE_TYPE (node
))
1672 || (TYPE_PRECISION (TREE_TYPE (node
))
1673 < TYPE_PRECISION (integer_type_node
))
1674 || exact_log2 (TYPE_PRECISION (TREE_TYPE (node
))) == -1))
1676 pp_string (pp
, "_Literal (");
1677 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1678 pp_string (pp
, ") ");
1680 if (TREE_CODE (TREE_TYPE (node
)) == POINTER_TYPE
1681 && ! (flags
& TDF_GIMPLE
))
1683 /* In the case of a pointer, one may want to divide by the
1684 size of the pointed-to type. Unfortunately, this not
1685 straightforward. The C front-end maps expressions
1690 in such a way that the two INTEGER_CST nodes for "5" have
1691 different values but identical types. In the latter
1692 case, the 5 is multiplied by sizeof (int) in c-common.c
1693 (pointer_int_sum) to convert it to a byte address, and
1694 yet the type of the node is left unchanged. Argh. What
1695 is consistent though is that the number value corresponds
1696 to bytes (UNITS) offset.
1698 NB: Neither of the following divisors can be trivially
1699 used to recover the original literal:
1701 TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (node)))
1702 TYPE_PRECISION (TREE_TYPE (TREE_TYPE (node))) */
1703 pp_wide_integer (pp
, TREE_INT_CST_LOW (node
));
1704 pp_string (pp
, "B"); /* pseudo-unit */
1706 else if (tree_fits_shwi_p (node
))
1707 pp_wide_integer (pp
, tree_to_shwi (node
));
1708 else if (tree_fits_uhwi_p (node
))
1709 pp_unsigned_wide_integer (pp
, tree_to_uhwi (node
));
1712 wide_int val
= node
;
1714 if (wi::neg_p (val
, TYPE_SIGN (TREE_TYPE (node
))))
1719 print_hex (val
, pp_buffer (pp
)->digit_buffer
);
1720 pp_string (pp
, pp_buffer (pp
)->digit_buffer
);
1722 if ((flags
& TDF_GIMPLE
)
1723 && ! (POINTER_TYPE_P (TREE_TYPE (node
))
1724 || (TYPE_PRECISION (TREE_TYPE (node
))
1725 < TYPE_PRECISION (integer_type_node
))
1726 || exact_log2 (TYPE_PRECISION (TREE_TYPE (node
))) == -1))
1728 if (TYPE_UNSIGNED (TREE_TYPE (node
)))
1729 pp_character (pp
, 'u');
1730 if (TYPE_PRECISION (TREE_TYPE (node
))
1731 == TYPE_PRECISION (unsigned_type_node
))
1733 else if (TYPE_PRECISION (TREE_TYPE (node
))
1734 == TYPE_PRECISION (long_unsigned_type_node
))
1735 pp_character (pp
, 'l');
1736 else if (TYPE_PRECISION (TREE_TYPE (node
))
1737 == TYPE_PRECISION (long_long_unsigned_type_node
))
1738 pp_string (pp
, "ll");
1740 if (TREE_OVERFLOW (node
))
1741 pp_string (pp
, "(OVF)");
1745 /* Code copied from print_node. */
1748 if (TREE_OVERFLOW (node
))
1749 pp_string (pp
, " overflow");
1751 d
= TREE_REAL_CST (node
);
1752 if (REAL_VALUE_ISINF (d
))
1753 pp_string (pp
, REAL_VALUE_NEGATIVE (d
) ? " -Inf" : " Inf");
1754 else if (REAL_VALUE_ISNAN (d
))
1755 pp_string (pp
, " Nan");
1759 real_to_decimal (string
, &d
, sizeof (string
), 0, 1);
1760 pp_string (pp
, string
);
1768 fixed_to_decimal (string
, TREE_FIXED_CST_PTR (node
), sizeof (string
));
1769 pp_string (pp
, string
);
1774 pp_string (pp
, "__complex__ (");
1775 dump_generic_node (pp
, TREE_REALPART (node
), spc
, flags
, false);
1776 pp_string (pp
, ", ");
1777 dump_generic_node (pp
, TREE_IMAGPART (node
), spc
, flags
, false);
1778 pp_right_paren (pp
);
1782 pp_string (pp
, "\"");
1783 pretty_print_string (pp
, TREE_STRING_POINTER (node
));
1784 pp_string (pp
, "\"");
1790 pp_string (pp
, "{ ");
1791 for (i
= 0; i
< VECTOR_CST_NELTS (node
); ++i
)
1794 pp_string (pp
, ", ");
1795 dump_generic_node (pp
, VECTOR_CST_ELT (node
, i
),
1798 pp_string (pp
, " }");
1804 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1806 if (TREE_CODE (node
) == METHOD_TYPE
)
1808 if (TYPE_METHOD_BASETYPE (node
))
1809 dump_decl_name (pp
, TYPE_NAME (TYPE_METHOD_BASETYPE (node
)),
1812 pp_string (pp
, "<null method basetype>");
1813 pp_colon_colon (pp
);
1815 if (TYPE_NAME (node
) && DECL_NAME (TYPE_NAME (node
)))
1816 dump_decl_name (pp
, TYPE_NAME (node
), flags
);
1817 else if (flags
& TDF_NOUID
)
1818 pp_printf (pp
, "<Txxxx>");
1820 pp_printf (pp
, "<T%x>", TYPE_UID (node
));
1821 dump_function_declaration (pp
, node
, spc
, flags
);
1826 dump_decl_name (pp
, node
, flags
);
1830 if (DECL_NAME (node
))
1831 dump_decl_name (pp
, node
, flags
);
1832 else if (LABEL_DECL_UID (node
) != -1)
1834 if (flags
& TDF_GIMPLE
)
1835 pp_printf (pp
, "L%d", (int) LABEL_DECL_UID (node
));
1837 pp_printf (pp
, "<L%d>", (int) LABEL_DECL_UID (node
));
1841 if (flags
& TDF_NOUID
)
1842 pp_string (pp
, "<D.xxxx>");
1845 if (flags
& TDF_GIMPLE
)
1846 pp_printf (pp
, "<D%u>", DECL_UID (node
));
1848 pp_printf (pp
, "<D.%u>", DECL_UID (node
));
1854 if (DECL_IS_BUILTIN (node
))
1856 /* Don't print the declaration of built-in types. */
1859 if (DECL_NAME (node
))
1860 dump_decl_name (pp
, node
, flags
);
1861 else if (TYPE_NAME (TREE_TYPE (node
)) != node
)
1863 pp_string (pp
, (TREE_CODE (TREE_TYPE (node
)) == UNION_TYPE
1864 ? "union" : "struct "));
1865 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1868 pp_string (pp
, "<anon>");
1874 case DEBUG_EXPR_DECL
:
1875 case NAMESPACE_DECL
:
1877 dump_decl_name (pp
, node
, flags
);
1881 pp_string (pp
, "<retval>");
1885 op0
= TREE_OPERAND (node
, 0);
1888 && (TREE_CODE (op0
) == INDIRECT_REF
1889 || (TREE_CODE (op0
) == MEM_REF
1890 && TREE_CODE (TREE_OPERAND (op0
, 0)) != ADDR_EXPR
1891 && integer_zerop (TREE_OPERAND (op0
, 1))
1892 /* Dump the types of INTEGER_CSTs explicitly, for we
1893 can't infer them and MEM_ATTR caching will share
1894 MEM_REFs with differently-typed op0s. */
1895 && TREE_CODE (TREE_OPERAND (op0
, 0)) != INTEGER_CST
1896 /* Released SSA_NAMES have no TREE_TYPE. */
1897 && TREE_TYPE (TREE_OPERAND (op0
, 0)) != NULL_TREE
1898 /* Same pointer types, but ignoring POINTER_TYPE vs.
1900 && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 0)))
1901 == TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 1))))
1902 && (TYPE_MODE (TREE_TYPE (TREE_OPERAND (op0
, 0)))
1903 == TYPE_MODE (TREE_TYPE (TREE_OPERAND (op0
, 1))))
1904 && (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (op0
, 0)))
1905 == TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (op0
, 1))))
1906 /* Same value types ignoring qualifiers. */
1907 && (TYPE_MAIN_VARIANT (TREE_TYPE (op0
))
1908 == TYPE_MAIN_VARIANT
1909 (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 1)))))
1910 && MR_DEPENDENCE_CLIQUE (op0
) == 0)))
1912 op0
= TREE_OPERAND (op0
, 0);
1915 if (op_prio (op0
) < op_prio (node
))
1917 dump_generic_node (pp
, op0
, spc
, flags
, false);
1918 if (op_prio (op0
) < op_prio (node
))
1919 pp_right_paren (pp
);
1920 pp_string (pp
, str
);
1921 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1922 op0
= component_ref_field_offset (node
);
1923 if (op0
&& TREE_CODE (op0
) != INTEGER_CST
)
1925 pp_string (pp
, "{off: ");
1926 dump_generic_node (pp
, op0
, spc
, flags
, false);
1927 pp_right_brace (pp
);
1932 pp_string (pp
, "BIT_FIELD_REF <");
1933 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1934 pp_string (pp
, ", ");
1935 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1936 pp_string (pp
, ", ");
1937 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
1941 case BIT_INSERT_EXPR
:
1942 pp_string (pp
, "BIT_INSERT_EXPR <");
1943 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1944 pp_string (pp
, ", ");
1945 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1946 pp_string (pp
, ", ");
1947 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
1948 pp_string (pp
, " (");
1949 if (INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (node
, 1))))
1951 TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (node
, 1))));
1953 dump_generic_node (pp
, TYPE_SIZE (TREE_TYPE (TREE_OPERAND (node
, 1))),
1955 pp_string (pp
, " bits)>");
1959 case ARRAY_RANGE_REF
:
1960 op0
= TREE_OPERAND (node
, 0);
1961 if (op_prio (op0
) < op_prio (node
))
1963 dump_generic_node (pp
, op0
, spc
, flags
, false);
1964 if (op_prio (op0
) < op_prio (node
))
1965 pp_right_paren (pp
);
1966 pp_left_bracket (pp
);
1967 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1968 if (TREE_CODE (node
) == ARRAY_RANGE_REF
)
1969 pp_string (pp
, " ...");
1970 pp_right_bracket (pp
);
1972 op0
= array_ref_low_bound (node
);
1973 op1
= array_ref_element_size (node
);
1975 if (!integer_zerop (op0
)
1976 || TREE_OPERAND (node
, 2)
1977 || TREE_OPERAND (node
, 3))
1979 pp_string (pp
, "{lb: ");
1980 dump_generic_node (pp
, op0
, spc
, flags
, false);
1981 pp_string (pp
, " sz: ");
1982 dump_generic_node (pp
, op1
, spc
, flags
, false);
1983 pp_right_brace (pp
);
1989 unsigned HOST_WIDE_INT ix
;
1991 bool is_struct_init
= false;
1992 bool is_array_init
= false;
1995 if (TREE_CLOBBER_P (node
))
1996 pp_string (pp
, "CLOBBER");
1997 else if (TREE_CODE (TREE_TYPE (node
)) == RECORD_TYPE
1998 || TREE_CODE (TREE_TYPE (node
)) == UNION_TYPE
)
1999 is_struct_init
= true;
2000 else if (TREE_CODE (TREE_TYPE (node
)) == ARRAY_TYPE
2001 && TYPE_DOMAIN (TREE_TYPE (node
))
2002 && TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
)))
2003 && TREE_CODE (TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
))))
2006 tree minv
= TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
)));
2007 is_array_init
= true;
2008 curidx
= wi::to_widest (minv
);
2010 FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (node
), ix
, field
, val
)
2017 dump_generic_node (pp
, field
, spc
, flags
, false);
2020 else if (is_array_init
2021 && (TREE_CODE (field
) != INTEGER_CST
2022 || curidx
!= wi::to_widest (field
)))
2024 pp_left_bracket (pp
);
2025 if (TREE_CODE (field
) == RANGE_EXPR
)
2027 dump_generic_node (pp
, TREE_OPERAND (field
, 0), spc
,
2029 pp_string (pp
, " ... ");
2030 dump_generic_node (pp
, TREE_OPERAND (field
, 1), spc
,
2032 if (TREE_CODE (TREE_OPERAND (field
, 1)) == INTEGER_CST
)
2033 curidx
= wi::to_widest (TREE_OPERAND (field
, 1));
2036 dump_generic_node (pp
, field
, spc
, flags
, false);
2037 if (TREE_CODE (field
) == INTEGER_CST
)
2038 curidx
= wi::to_widest (field
);
2039 pp_string (pp
, "]=");
2044 if (val
&& TREE_CODE (val
) == ADDR_EXPR
)
2045 if (TREE_CODE (TREE_OPERAND (val
, 0)) == FUNCTION_DECL
)
2046 val
= TREE_OPERAND (val
, 0);
2047 if (val
&& TREE_CODE (val
) == FUNCTION_DECL
)
2048 dump_decl_name (pp
, val
, flags
);
2050 dump_generic_node (pp
, val
, spc
, flags
, false);
2051 if (ix
!= CONSTRUCTOR_NELTS (node
) - 1)
2057 pp_right_brace (pp
);
2064 if (flags
& TDF_SLIM
)
2066 pp_string (pp
, "<COMPOUND_EXPR>");
2070 dump_generic_node (pp
, TREE_OPERAND (node
, 0),
2071 spc
, flags
, !(flags
& TDF_SLIM
));
2072 if (flags
& TDF_SLIM
)
2073 newline_and_indent (pp
, spc
);
2080 for (tp
= &TREE_OPERAND (node
, 1);
2081 TREE_CODE (*tp
) == COMPOUND_EXPR
;
2082 tp
= &TREE_OPERAND (*tp
, 1))
2084 dump_generic_node (pp
, TREE_OPERAND (*tp
, 0),
2085 spc
, flags
, !(flags
& TDF_SLIM
));
2086 if (flags
& TDF_SLIM
)
2087 newline_and_indent (pp
, spc
);
2095 dump_generic_node (pp
, *tp
, spc
, flags
, !(flags
& TDF_SLIM
));
2099 case STATEMENT_LIST
:
2101 tree_stmt_iterator si
;
2104 if (flags
& TDF_SLIM
)
2106 pp_string (pp
, "<STATEMENT_LIST>");
2110 for (si
= tsi_start (node
); !tsi_end_p (si
); tsi_next (&si
))
2113 newline_and_indent (pp
, spc
);
2116 dump_generic_node (pp
, tsi_stmt (si
), spc
, flags
, true);
2123 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
,
2128 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
,
2133 pp_string (pp
, "TARGET_EXPR <");
2134 dump_generic_node (pp
, TARGET_EXPR_SLOT (node
), spc
, flags
, false);
2137 dump_generic_node (pp
, TARGET_EXPR_INITIAL (node
), spc
, flags
, false);
2142 print_declaration (pp
, DECL_EXPR_DECL (node
), spc
, flags
);
2147 if (TREE_TYPE (node
) == NULL
|| TREE_TYPE (node
) == void_type_node
)
2149 pp_string (pp
, "if (");
2150 dump_generic_node (pp
, COND_EXPR_COND (node
), spc
, flags
, false);
2151 pp_right_paren (pp
);
2152 /* The lowered cond_exprs should always be printed in full. */
2153 if (COND_EXPR_THEN (node
)
2154 && (IS_EMPTY_STMT (COND_EXPR_THEN (node
))
2155 || TREE_CODE (COND_EXPR_THEN (node
)) == GOTO_EXPR
)
2156 && COND_EXPR_ELSE (node
)
2157 && (IS_EMPTY_STMT (COND_EXPR_ELSE (node
))
2158 || TREE_CODE (COND_EXPR_ELSE (node
)) == GOTO_EXPR
))
2161 dump_generic_node (pp
, COND_EXPR_THEN (node
),
2163 if (!IS_EMPTY_STMT (COND_EXPR_ELSE (node
)))
2165 pp_string (pp
, " else ");
2166 dump_generic_node (pp
, COND_EXPR_ELSE (node
),
2170 else if (!(flags
& TDF_SLIM
))
2172 /* Output COND_EXPR_THEN. */
2173 if (COND_EXPR_THEN (node
))
2175 newline_and_indent (pp
, spc
+2);
2177 newline_and_indent (pp
, spc
+4);
2178 dump_generic_node (pp
, COND_EXPR_THEN (node
), spc
+4,
2180 newline_and_indent (pp
, spc
+2);
2181 pp_right_brace (pp
);
2184 /* Output COND_EXPR_ELSE. */
2185 if (COND_EXPR_ELSE (node
)
2186 && !IS_EMPTY_STMT (COND_EXPR_ELSE (node
)))
2188 newline_and_indent (pp
, spc
);
2189 pp_string (pp
, "else");
2190 newline_and_indent (pp
, spc
+2);
2192 newline_and_indent (pp
, spc
+4);
2193 dump_generic_node (pp
, COND_EXPR_ELSE (node
), spc
+4,
2195 newline_and_indent (pp
, spc
+2);
2196 pp_right_brace (pp
);
2203 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2207 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2211 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2217 if (!(flags
& TDF_SLIM
))
2219 if (BIND_EXPR_VARS (node
))
2223 for (op0
= BIND_EXPR_VARS (node
); op0
; op0
= DECL_CHAIN (op0
))
2225 print_declaration (pp
, op0
, spc
+2, flags
);
2230 newline_and_indent (pp
, spc
+2);
2231 dump_generic_node (pp
, BIND_EXPR_BODY (node
), spc
+2, flags
, true);
2232 newline_and_indent (pp
, spc
);
2233 pp_right_brace (pp
);
2239 if (CALL_EXPR_FN (node
) != NULL_TREE
)
2240 print_call_name (pp
, CALL_EXPR_FN (node
), flags
);
2242 pp_string (pp
, internal_fn_name (CALL_EXPR_IFN (node
)));
2244 /* Print parameters. */
2249 call_expr_arg_iterator iter
;
2250 FOR_EACH_CALL_EXPR_ARG (arg
, iter
, node
)
2252 dump_generic_node (pp
, arg
, spc
, flags
, false);
2253 if (more_call_expr_args_p (&iter
))
2260 if (CALL_EXPR_VA_ARG_PACK (node
))
2262 if (call_expr_nargs (node
) > 0)
2267 pp_string (pp
, "__builtin_va_arg_pack ()");
2269 pp_right_paren (pp
);
2271 op1
= CALL_EXPR_STATIC_CHAIN (node
);
2274 pp_string (pp
, " [static-chain: ");
2275 dump_generic_node (pp
, op1
, spc
, flags
, false);
2276 pp_right_bracket (pp
);
2279 if (CALL_EXPR_RETURN_SLOT_OPT (node
))
2280 pp_string (pp
, " [return slot optimization]");
2281 if (CALL_EXPR_TAILCALL (node
))
2282 pp_string (pp
, " [tail call]");
2285 case WITH_CLEANUP_EXPR
:
2289 case CLEANUP_POINT_EXPR
:
2290 pp_string (pp
, "<<cleanup_point ");
2291 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2292 pp_string (pp
, ">>");
2295 case PLACEHOLDER_EXPR
:
2296 pp_string (pp
, "<PLACEHOLDER_EXPR ");
2297 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
2301 /* Binary arithmetic and logic expressions. */
2302 case WIDEN_SUM_EXPR
:
2303 case WIDEN_MULT_EXPR
:
2305 case MULT_HIGHPART_EXPR
:
2307 case POINTER_PLUS_EXPR
:
2309 case TRUNC_DIV_EXPR
:
2311 case FLOOR_DIV_EXPR
:
2312 case ROUND_DIV_EXPR
:
2313 case TRUNC_MOD_EXPR
:
2315 case FLOOR_MOD_EXPR
:
2316 case ROUND_MOD_EXPR
:
2318 case EXACT_DIV_EXPR
:
2323 case WIDEN_LSHIFT_EXPR
:
2327 case TRUTH_ANDIF_EXPR
:
2328 case TRUTH_ORIF_EXPR
:
2329 case TRUTH_AND_EXPR
:
2331 case TRUTH_XOR_EXPR
:
2345 case UNORDERED_EXPR
:
2347 const char *op
= op_symbol (node
);
2348 op0
= TREE_OPERAND (node
, 0);
2349 op1
= TREE_OPERAND (node
, 1);
2351 /* When the operands are expressions with less priority,
2352 keep semantics of the tree representation. */
2353 if (op_prio (op0
) <= op_prio (node
))
2356 dump_generic_node (pp
, op0
, spc
, flags
, false);
2357 pp_right_paren (pp
);
2360 dump_generic_node (pp
, op0
, spc
, flags
, false);
2366 /* When the operands are expressions with less priority,
2367 keep semantics of the tree representation. */
2368 if (op_prio (op1
) <= op_prio (node
))
2371 dump_generic_node (pp
, op1
, spc
, flags
, false);
2372 pp_right_paren (pp
);
2375 dump_generic_node (pp
, op1
, spc
, flags
, false);
2379 /* Unary arithmetic and logic expressions. */
2382 case TRUTH_NOT_EXPR
:
2384 case PREDECREMENT_EXPR
:
2385 case PREINCREMENT_EXPR
:
2387 if (TREE_CODE (node
) == ADDR_EXPR
2388 && (TREE_CODE (TREE_OPERAND (node
, 0)) == STRING_CST
2389 || TREE_CODE (TREE_OPERAND (node
, 0)) == FUNCTION_DECL
))
2390 ; /* Do not output '&' for strings and function pointers. */
2392 pp_string (pp
, op_symbol (node
));
2394 if (op_prio (TREE_OPERAND (node
, 0)) < op_prio (node
))
2397 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2398 pp_right_paren (pp
);
2401 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2404 case POSTDECREMENT_EXPR
:
2405 case POSTINCREMENT_EXPR
:
2406 if (op_prio (TREE_OPERAND (node
, 0)) < op_prio (node
))
2409 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2410 pp_right_paren (pp
);
2413 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2414 pp_string (pp
, op_symbol (node
));
2418 pp_string (pp
, "MIN_EXPR <");
2419 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2420 pp_string (pp
, ", ");
2421 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2426 pp_string (pp
, "MAX_EXPR <");
2427 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2428 pp_string (pp
, ", ");
2429 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2434 pp_string (pp
, "ABS_EXPR <");
2435 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2443 case ADDR_SPACE_CONVERT_EXPR
:
2444 case FIXED_CONVERT_EXPR
:
2445 case FIX_TRUNC_EXPR
:
2448 type
= TREE_TYPE (node
);
2449 op0
= TREE_OPERAND (node
, 0);
2450 if (type
!= TREE_TYPE (op0
))
2453 dump_generic_node (pp
, type
, spc
, flags
, false);
2454 pp_string (pp
, ") ");
2456 if (op_prio (op0
) < op_prio (node
))
2458 dump_generic_node (pp
, op0
, spc
, flags
, false);
2459 if (op_prio (op0
) < op_prio (node
))
2460 pp_right_paren (pp
);
2463 case VIEW_CONVERT_EXPR
:
2464 pp_string (pp
, "VIEW_CONVERT_EXPR<");
2465 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
2466 pp_string (pp
, ">(");
2467 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2468 pp_right_paren (pp
);
2472 pp_string (pp
, "((");
2473 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2474 pp_string (pp
, "))");
2477 case NON_LVALUE_EXPR
:
2478 pp_string (pp
, "NON_LVALUE_EXPR <");
2479 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2484 pp_string (pp
, "SAVE_EXPR <");
2485 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2490 pp_string (pp
, "COMPLEX_EXPR <");
2491 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2492 pp_string (pp
, ", ");
2493 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2498 pp_string (pp
, "CONJ_EXPR <");
2499 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2504 if (flags
& TDF_GIMPLE
)
2506 pp_string (pp
, "__real ");
2507 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2511 pp_string (pp
, "REALPART_EXPR <");
2512 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2518 if (flags
& TDF_GIMPLE
)
2520 pp_string (pp
, "__imag ");
2521 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2525 pp_string (pp
, "IMAGPART_EXPR <");
2526 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2532 pp_string (pp
, "VA_ARG_EXPR <");
2533 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2537 case TRY_FINALLY_EXPR
:
2538 case TRY_CATCH_EXPR
:
2539 pp_string (pp
, "try");
2540 newline_and_indent (pp
, spc
+2);
2542 newline_and_indent (pp
, spc
+4);
2543 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
+4, flags
, true);
2544 newline_and_indent (pp
, spc
+2);
2545 pp_right_brace (pp
);
2546 newline_and_indent (pp
, spc
);
2548 (TREE_CODE (node
) == TRY_CATCH_EXPR
) ? "catch" : "finally");
2549 newline_and_indent (pp
, spc
+2);
2551 newline_and_indent (pp
, spc
+4);
2552 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
+4, flags
, true);
2553 newline_and_indent (pp
, spc
+2);
2554 pp_right_brace (pp
);
2559 pp_string (pp
, "catch (");
2560 dump_generic_node (pp
, CATCH_TYPES (node
), spc
+2, flags
, false);
2561 pp_right_paren (pp
);
2562 newline_and_indent (pp
, spc
+2);
2564 newline_and_indent (pp
, spc
+4);
2565 dump_generic_node (pp
, CATCH_BODY (node
), spc
+4, flags
, true);
2566 newline_and_indent (pp
, spc
+2);
2567 pp_right_brace (pp
);
2571 case EH_FILTER_EXPR
:
2572 pp_string (pp
, "<<<eh_filter (");
2573 dump_generic_node (pp
, EH_FILTER_TYPES (node
), spc
+2, flags
, false);
2574 pp_string (pp
, ")>>>");
2575 newline_and_indent (pp
, spc
+2);
2577 newline_and_indent (pp
, spc
+4);
2578 dump_generic_node (pp
, EH_FILTER_FAILURE (node
), spc
+4, flags
, true);
2579 newline_and_indent (pp
, spc
+2);
2580 pp_right_brace (pp
);
2585 op0
= TREE_OPERAND (node
, 0);
2586 /* If this is for break or continue, don't bother printing it. */
2587 if (DECL_NAME (op0
))
2589 const char *name
= IDENTIFIER_POINTER (DECL_NAME (op0
));
2590 if (strcmp (name
, "break") == 0
2591 || strcmp (name
, "continue") == 0)
2594 dump_generic_node (pp
, op0
, spc
, flags
, false);
2596 if (DECL_NONLOCAL (op0
))
2597 pp_string (pp
, " [non-local]");
2601 pp_string (pp
, "while (1)");
2602 if (!(flags
& TDF_SLIM
))
2604 newline_and_indent (pp
, spc
+2);
2606 newline_and_indent (pp
, spc
+4);
2607 dump_generic_node (pp
, LOOP_EXPR_BODY (node
), spc
+4, flags
, true);
2608 newline_and_indent (pp
, spc
+2);
2609 pp_right_brace (pp
);
2615 pp_string (pp
, "// predicted ");
2616 if (PREDICT_EXPR_OUTCOME (node
))
2617 pp_string (pp
, "likely by ");
2619 pp_string (pp
, "unlikely by ");
2620 pp_string (pp
, predictor_name (PREDICT_EXPR_PREDICTOR (node
)));
2621 pp_string (pp
, " predictor.");
2625 pp_string (pp
, "ANNOTATE_EXPR <");
2626 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2627 switch ((enum annot_expr_kind
) TREE_INT_CST_LOW (TREE_OPERAND (node
, 1)))
2629 case annot_expr_ivdep_kind
:
2630 pp_string (pp
, ", ivdep");
2632 case annot_expr_no_vector_kind
:
2633 pp_string (pp
, ", no-vector");
2635 case annot_expr_vector_kind
:
2636 pp_string (pp
, ", vector");
2645 pp_string (pp
, "return");
2646 op0
= TREE_OPERAND (node
, 0);
2650 if (TREE_CODE (op0
) == MODIFY_EXPR
)
2651 dump_generic_node (pp
, TREE_OPERAND (op0
, 1),
2654 dump_generic_node (pp
, op0
, spc
, flags
, false);
2659 pp_string (pp
, "if (");
2660 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2661 pp_string (pp
, ") break");
2665 pp_string (pp
, "switch (");
2666 dump_generic_node (pp
, SWITCH_COND (node
), spc
, flags
, false);
2667 pp_right_paren (pp
);
2668 if (!(flags
& TDF_SLIM
))
2670 newline_and_indent (pp
, spc
+2);
2672 if (SWITCH_BODY (node
))
2674 newline_and_indent (pp
, spc
+4);
2675 dump_generic_node (pp
, SWITCH_BODY (node
), spc
+4, flags
,
2680 tree vec
= SWITCH_LABELS (node
);
2681 size_t i
, n
= TREE_VEC_LENGTH (vec
);
2682 for (i
= 0; i
< n
; ++i
)
2684 tree elt
= TREE_VEC_ELT (vec
, i
);
2685 newline_and_indent (pp
, spc
+4);
2688 dump_generic_node (pp
, elt
, spc
+4, flags
, false);
2689 pp_string (pp
, " goto ");
2690 dump_generic_node (pp
, CASE_LABEL (elt
), spc
+4,
2695 pp_string (pp
, "case ???: goto ???;");
2698 newline_and_indent (pp
, spc
+2);
2699 pp_right_brace (pp
);
2705 op0
= GOTO_DESTINATION (node
);
2706 if (TREE_CODE (op0
) != SSA_NAME
&& DECL_P (op0
) && DECL_NAME (op0
))
2708 const char *name
= IDENTIFIER_POINTER (DECL_NAME (op0
));
2709 if (strcmp (name
, "break") == 0
2710 || strcmp (name
, "continue") == 0)
2712 pp_string (pp
, name
);
2716 pp_string (pp
, "goto ");
2717 dump_generic_node (pp
, op0
, spc
, flags
, false);
2721 pp_string (pp
, "__asm__");
2722 if (ASM_VOLATILE_P (node
))
2723 pp_string (pp
, " __volatile__");
2725 dump_generic_node (pp
, ASM_STRING (node
), spc
, flags
, false);
2727 dump_generic_node (pp
, ASM_OUTPUTS (node
), spc
, flags
, false);
2729 dump_generic_node (pp
, ASM_INPUTS (node
), spc
, flags
, false);
2730 if (ASM_CLOBBERS (node
))
2733 dump_generic_node (pp
, ASM_CLOBBERS (node
), spc
, flags
, false);
2735 pp_right_paren (pp
);
2738 case CASE_LABEL_EXPR
:
2739 if (CASE_LOW (node
) && CASE_HIGH (node
))
2741 pp_string (pp
, "case ");
2742 dump_generic_node (pp
, CASE_LOW (node
), spc
, flags
, false);
2743 pp_string (pp
, " ... ");
2744 dump_generic_node (pp
, CASE_HIGH (node
), spc
, flags
, false);
2746 else if (CASE_LOW (node
))
2748 pp_string (pp
, "case ");
2749 dump_generic_node (pp
, CASE_LOW (node
), spc
, flags
, false);
2752 pp_string (pp
, "default");
2757 pp_string (pp
, "OBJ_TYPE_REF(");
2758 dump_generic_node (pp
, OBJ_TYPE_REF_EXPR (node
), spc
, flags
, false);
2760 if (!(flags
& TDF_SLIM
) && virtual_method_call_p (node
))
2762 pp_string (pp
, "(");
2763 dump_generic_node (pp
, obj_type_ref_class (node
), spc
, flags
, false);
2764 pp_string (pp
, ")");
2766 dump_generic_node (pp
, OBJ_TYPE_REF_OBJECT (node
), spc
, flags
, false);
2768 dump_generic_node (pp
, OBJ_TYPE_REF_TOKEN (node
), spc
, flags
, false);
2769 pp_right_paren (pp
);
2773 if (SSA_NAME_IDENTIFIER (node
))
2775 if ((flags
& TDF_NOUID
)
2776 && SSA_NAME_VAR (node
)
2777 && DECL_NAMELESS (SSA_NAME_VAR (node
)))
2778 dump_fancy_name (pp
, SSA_NAME_IDENTIFIER (node
));
2779 else if (! (flags
& TDF_GIMPLE
)
2780 || SSA_NAME_VAR (node
))
2781 dump_generic_node (pp
, SSA_NAME_IDENTIFIER (node
),
2785 pp_decimal_int (pp
, SSA_NAME_VERSION (node
));
2786 if (SSA_NAME_IS_DEFAULT_DEF (node
))
2787 pp_string (pp
, "(D)");
2788 if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (node
))
2789 pp_string (pp
, "(ab)");
2792 case WITH_SIZE_EXPR
:
2793 pp_string (pp
, "WITH_SIZE_EXPR <");
2794 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2795 pp_string (pp
, ", ");
2796 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2801 pp_string (pp
, "ASSERT_EXPR <");
2802 dump_generic_node (pp
, ASSERT_EXPR_VAR (node
), spc
, flags
, false);
2803 pp_string (pp
, ", ");
2804 dump_generic_node (pp
, ASSERT_EXPR_COND (node
), spc
, flags
, false);
2809 pp_string (pp
, "scev_known");
2812 case SCEV_NOT_KNOWN
:
2813 pp_string (pp
, "scev_not_known");
2816 case POLYNOMIAL_CHREC
:
2818 dump_generic_node (pp
, CHREC_LEFT (node
), spc
, flags
, false);
2819 pp_string (pp
, ", +, ");
2820 dump_generic_node (pp
, CHREC_RIGHT (node
), spc
, flags
, false);
2821 pp_string (pp
, "}_");
2822 dump_generic_node (pp
, CHREC_VAR (node
), spc
, flags
, false);
2826 case REALIGN_LOAD_EXPR
:
2827 pp_string (pp
, "REALIGN_LOAD <");
2828 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2829 pp_string (pp
, ", ");
2830 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2831 pp_string (pp
, ", ");
2832 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2837 pp_string (pp
, " VEC_COND_EXPR < ");
2838 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2839 pp_string (pp
, " , ");
2840 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2841 pp_string (pp
, " , ");
2842 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2843 pp_string (pp
, " > ");
2847 pp_string (pp
, " VEC_PERM_EXPR < ");
2848 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2849 pp_string (pp
, " , ");
2850 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2851 pp_string (pp
, " , ");
2852 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2853 pp_string (pp
, " > ");
2857 pp_string (pp
, " DOT_PROD_EXPR < ");
2858 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2859 pp_string (pp
, ", ");
2860 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2861 pp_string (pp
, ", ");
2862 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2863 pp_string (pp
, " > ");
2866 case WIDEN_MULT_PLUS_EXPR
:
2867 pp_string (pp
, " WIDEN_MULT_PLUS_EXPR < ");
2868 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2869 pp_string (pp
, ", ");
2870 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2871 pp_string (pp
, ", ");
2872 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2873 pp_string (pp
, " > ");
2876 case WIDEN_MULT_MINUS_EXPR
:
2877 pp_string (pp
, " WIDEN_MULT_MINUS_EXPR < ");
2878 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2879 pp_string (pp
, ", ");
2880 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2881 pp_string (pp
, ", ");
2882 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2883 pp_string (pp
, " > ");
2887 pp_string (pp
, " FMA_EXPR < ");
2888 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2889 pp_string (pp
, ", ");
2890 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2891 pp_string (pp
, ", ");
2892 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2893 pp_string (pp
, " > ");
2897 pp_string (pp
, "#pragma acc parallel");
2898 goto dump_omp_clauses_body
;
2901 pp_string (pp
, "#pragma acc kernels");
2902 goto dump_omp_clauses_body
;
2905 pp_string (pp
, "#pragma acc data");
2906 dump_omp_clauses (pp
, OACC_DATA_CLAUSES (node
), spc
, flags
);
2909 case OACC_HOST_DATA
:
2910 pp_string (pp
, "#pragma acc host_data");
2911 dump_omp_clauses (pp
, OACC_HOST_DATA_CLAUSES (node
), spc
, flags
);
2915 pp_string (pp
, "#pragma acc declare");
2916 dump_omp_clauses (pp
, OACC_DECLARE_CLAUSES (node
), spc
, flags
);
2920 pp_string (pp
, "#pragma acc update");
2921 dump_omp_clauses (pp
, OACC_UPDATE_CLAUSES (node
), spc
, flags
);
2924 case OACC_ENTER_DATA
:
2925 pp_string (pp
, "#pragma acc enter data");
2926 dump_omp_clauses (pp
, OACC_ENTER_DATA_CLAUSES (node
), spc
, flags
);
2929 case OACC_EXIT_DATA
:
2930 pp_string (pp
, "#pragma acc exit data");
2931 dump_omp_clauses (pp
, OACC_EXIT_DATA_CLAUSES (node
), spc
, flags
);
2935 pp_string (pp
, "#pragma acc cache");
2936 dump_omp_clauses (pp
, OACC_CACHE_CLAUSES (node
), spc
, flags
);
2940 pp_string (pp
, "#pragma omp parallel");
2941 dump_omp_clauses (pp
, OMP_PARALLEL_CLAUSES (node
), spc
, flags
);
2944 dump_omp_clauses_body
:
2945 dump_omp_clauses (pp
, OMP_CLAUSES (node
), spc
, flags
);
2949 if (!(flags
& TDF_SLIM
) && OMP_BODY (node
))
2951 newline_and_indent (pp
, spc
+ 2);
2953 newline_and_indent (pp
, spc
+ 4);
2954 dump_generic_node (pp
, OMP_BODY (node
), spc
+ 4, flags
, false);
2955 newline_and_indent (pp
, spc
+ 2);
2956 pp_right_brace (pp
);
2962 pp_string (pp
, "#pragma omp task");
2963 dump_omp_clauses (pp
, OMP_TASK_CLAUSES (node
), spc
, flags
);
2967 pp_string (pp
, "#pragma omp for");
2971 pp_string (pp
, "#pragma omp simd");
2975 pp_string (pp
, "#pragma simd");
2979 /* This label points one line after dumping the clauses.
2980 For _Cilk_for the clauses are dumped after the _Cilk_for (...)
2981 parameters are printed out. */
2982 goto dump_omp_loop_cilk_for
;
2984 case OMP_DISTRIBUTE
:
2985 pp_string (pp
, "#pragma omp distribute");
2989 pp_string (pp
, "#pragma omp taskloop");
2993 pp_string (pp
, "#pragma acc loop");
2997 pp_string (pp
, "#pragma omp teams");
2998 dump_omp_clauses (pp
, OMP_TEAMS_CLAUSES (node
), spc
, flags
);
3001 case OMP_TARGET_DATA
:
3002 pp_string (pp
, "#pragma omp target data");
3003 dump_omp_clauses (pp
, OMP_TARGET_DATA_CLAUSES (node
), spc
, flags
);
3006 case OMP_TARGET_ENTER_DATA
:
3007 pp_string (pp
, "#pragma omp target enter data");
3008 dump_omp_clauses (pp
, OMP_TARGET_ENTER_DATA_CLAUSES (node
), spc
, flags
);
3012 case OMP_TARGET_EXIT_DATA
:
3013 pp_string (pp
, "#pragma omp target exit data");
3014 dump_omp_clauses (pp
, OMP_TARGET_EXIT_DATA_CLAUSES (node
), spc
, flags
);
3019 pp_string (pp
, "#pragma omp target");
3020 dump_omp_clauses (pp
, OMP_TARGET_CLAUSES (node
), spc
, flags
);
3023 case OMP_TARGET_UPDATE
:
3024 pp_string (pp
, "#pragma omp target update");
3025 dump_omp_clauses (pp
, OMP_TARGET_UPDATE_CLAUSES (node
), spc
, flags
);
3030 dump_omp_clauses (pp
, OMP_FOR_CLAUSES (node
), spc
, flags
);
3032 dump_omp_loop_cilk_for
:
3033 if (!(flags
& TDF_SLIM
))
3037 if (OMP_FOR_PRE_BODY (node
))
3039 if (TREE_CODE (node
) == CILK_FOR
)
3040 pp_string (pp
, " ");
3042 newline_and_indent (pp
, spc
+ 2);
3045 newline_and_indent (pp
, spc
);
3046 dump_generic_node (pp
, OMP_FOR_PRE_BODY (node
),
3049 if (OMP_FOR_INIT (node
))
3052 for (i
= 0; i
< TREE_VEC_LENGTH (OMP_FOR_INIT (node
)); i
++)
3055 if (TREE_CODE (node
) != CILK_FOR
|| OMP_FOR_PRE_BODY (node
))
3056 newline_and_indent (pp
, spc
);
3057 if (TREE_CODE (node
) == CILK_FOR
)
3058 pp_string (pp
, "_Cilk_for (");
3060 pp_string (pp
, "for (");
3061 dump_generic_node (pp
,
3062 TREE_VEC_ELT (OMP_FOR_INIT (node
), i
),
3064 pp_string (pp
, "; ");
3065 dump_generic_node (pp
,
3066 TREE_VEC_ELT (OMP_FOR_COND (node
), i
),
3068 pp_string (pp
, "; ");
3069 dump_generic_node (pp
,
3070 TREE_VEC_ELT (OMP_FOR_INCR (node
), i
),
3072 pp_right_paren (pp
);
3074 if (TREE_CODE (node
) == CILK_FOR
)
3075 dump_omp_clauses (pp
, OMP_FOR_CLAUSES (node
), spc
, flags
);
3077 if (OMP_FOR_BODY (node
))
3079 newline_and_indent (pp
, spc
+ 2);
3081 newline_and_indent (pp
, spc
+ 4);
3082 dump_generic_node (pp
, OMP_FOR_BODY (node
), spc
+ 4, flags
,
3084 newline_and_indent (pp
, spc
+ 2);
3085 pp_right_brace (pp
);
3087 if (OMP_FOR_INIT (node
))
3088 spc
-= 2 * TREE_VEC_LENGTH (OMP_FOR_INIT (node
)) - 2;
3089 if (OMP_FOR_PRE_BODY (node
))
3092 newline_and_indent (pp
, spc
+ 2);
3093 pp_right_brace (pp
);
3100 pp_string (pp
, "#pragma omp sections");
3101 dump_omp_clauses (pp
, OMP_SECTIONS_CLAUSES (node
), spc
, flags
);
3105 pp_string (pp
, "#pragma omp section");
3109 pp_string (pp
, "#pragma omp master");
3113 pp_string (pp
, "#pragma omp taskgroup");
3117 pp_string (pp
, "#pragma omp ordered");
3118 dump_omp_clauses (pp
, OMP_ORDERED_CLAUSES (node
), spc
, flags
);
3122 pp_string (pp
, "#pragma omp critical");
3123 if (OMP_CRITICAL_NAME (node
))
3127 dump_generic_node (pp
, OMP_CRITICAL_NAME (node
), spc
,
3129 pp_right_paren (pp
);
3131 dump_omp_clauses (pp
, OMP_CRITICAL_CLAUSES (node
), spc
, flags
);
3135 pp_string (pp
, "#pragma omp atomic");
3136 if (OMP_ATOMIC_SEQ_CST (node
))
3137 pp_string (pp
, " seq_cst");
3138 newline_and_indent (pp
, spc
+ 2);
3139 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3143 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3146 case OMP_ATOMIC_READ
:
3147 pp_string (pp
, "#pragma omp atomic read");
3148 if (OMP_ATOMIC_SEQ_CST (node
))
3149 pp_string (pp
, " seq_cst");
3150 newline_and_indent (pp
, spc
+ 2);
3151 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3155 case OMP_ATOMIC_CAPTURE_OLD
:
3156 case OMP_ATOMIC_CAPTURE_NEW
:
3157 pp_string (pp
, "#pragma omp atomic capture");
3158 if (OMP_ATOMIC_SEQ_CST (node
))
3159 pp_string (pp
, " seq_cst");
3160 newline_and_indent (pp
, spc
+ 2);
3161 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3165 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3169 pp_string (pp
, "#pragma omp single");
3170 dump_omp_clauses (pp
, OMP_SINGLE_CLAUSES (node
), spc
, flags
);
3174 dump_omp_clause (pp
, node
, spc
, flags
);
3178 case TRANSACTION_EXPR
:
3179 if (TRANSACTION_EXPR_OUTER (node
))
3180 pp_string (pp
, "__transaction_atomic [[outer]]");
3181 else if (TRANSACTION_EXPR_RELAXED (node
))
3182 pp_string (pp
, "__transaction_relaxed");
3184 pp_string (pp
, "__transaction_atomic");
3185 if (!(flags
& TDF_SLIM
) && TRANSACTION_EXPR_BODY (node
))
3187 newline_and_indent (pp
, spc
);
3189 newline_and_indent (pp
, spc
+ 2);
3190 dump_generic_node (pp
, TRANSACTION_EXPR_BODY (node
),
3191 spc
+ 2, flags
, false);
3192 newline_and_indent (pp
, spc
);
3193 pp_right_brace (pp
);
3198 case REDUC_MAX_EXPR
:
3199 pp_string (pp
, " REDUC_MAX_EXPR < ");
3200 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3201 pp_string (pp
, " > ");
3204 case REDUC_MIN_EXPR
:
3205 pp_string (pp
, " REDUC_MIN_EXPR < ");
3206 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3207 pp_string (pp
, " > ");
3210 case REDUC_PLUS_EXPR
:
3211 pp_string (pp
, " REDUC_PLUS_EXPR < ");
3212 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3213 pp_string (pp
, " > ");
3216 case VEC_WIDEN_MULT_HI_EXPR
:
3217 case VEC_WIDEN_MULT_LO_EXPR
:
3218 case VEC_WIDEN_MULT_EVEN_EXPR
:
3219 case VEC_WIDEN_MULT_ODD_EXPR
:
3220 case VEC_WIDEN_LSHIFT_HI_EXPR
:
3221 case VEC_WIDEN_LSHIFT_LO_EXPR
:
3223 for (str
= get_tree_code_name (code
); *str
; str
++)
3224 pp_character (pp
, TOUPPER (*str
));
3225 pp_string (pp
, " < ");
3226 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3227 pp_string (pp
, ", ");
3228 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3229 pp_string (pp
, " > ");
3232 case VEC_UNPACK_HI_EXPR
:
3233 pp_string (pp
, " VEC_UNPACK_HI_EXPR < ");
3234 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3235 pp_string (pp
, " > ");
3238 case VEC_UNPACK_LO_EXPR
:
3239 pp_string (pp
, " VEC_UNPACK_LO_EXPR < ");
3240 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3241 pp_string (pp
, " > ");
3244 case VEC_UNPACK_FLOAT_HI_EXPR
:
3245 pp_string (pp
, " VEC_UNPACK_FLOAT_HI_EXPR < ");
3246 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3247 pp_string (pp
, " > ");
3250 case VEC_UNPACK_FLOAT_LO_EXPR
:
3251 pp_string (pp
, " VEC_UNPACK_FLOAT_LO_EXPR < ");
3252 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3253 pp_string (pp
, " > ");
3256 case VEC_PACK_TRUNC_EXPR
:
3257 pp_string (pp
, " VEC_PACK_TRUNC_EXPR < ");
3258 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3259 pp_string (pp
, ", ");
3260 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3261 pp_string (pp
, " > ");
3264 case VEC_PACK_SAT_EXPR
:
3265 pp_string (pp
, " VEC_PACK_SAT_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_FIX_TRUNC_EXPR
:
3273 pp_string (pp
, " VEC_PACK_FIX_TRUNC_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
, " > ");
3281 dump_block_node (pp
, node
, spc
, flags
);
3284 case CILK_SPAWN_STMT
:
3285 pp_string (pp
, "_Cilk_spawn ");
3286 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3289 case CILK_SYNC_STMT
:
3290 pp_string (pp
, "_Cilk_sync");
3297 if (is_stmt
&& is_expr
)
3303 /* Print the declaration of a variable. */
3306 print_declaration (pretty_printer
*pp
, tree t
, int spc
, dump_flags_t flags
)
3310 if (TREE_CODE(t
) == NAMELIST_DECL
)
3312 pp_string(pp
, "namelist ");
3313 dump_decl_name (pp
, t
, flags
);
3318 if (TREE_CODE (t
) == TYPE_DECL
)
3319 pp_string (pp
, "typedef ");
3321 if (CODE_CONTAINS_STRUCT (TREE_CODE (t
), TS_DECL_WRTL
) && DECL_REGISTER (t
))
3322 pp_string (pp
, "register ");
3324 if (TREE_PUBLIC (t
) && DECL_EXTERNAL (t
))
3325 pp_string (pp
, "extern ");
3326 else if (TREE_STATIC (t
))
3327 pp_string (pp
, "static ");
3329 /* Print the type and name. */
3330 if (TREE_TYPE (t
) && TREE_CODE (TREE_TYPE (t
)) == ARRAY_TYPE
)
3334 /* Print array's type. */
3335 tmp
= TREE_TYPE (t
);
3336 while (TREE_CODE (TREE_TYPE (tmp
)) == ARRAY_TYPE
)
3337 tmp
= TREE_TYPE (tmp
);
3338 dump_generic_node (pp
, TREE_TYPE (tmp
), spc
, flags
, false);
3340 /* Print variable's name. */
3342 dump_generic_node (pp
, t
, spc
, flags
, false);
3344 /* Print the dimensions. */
3345 tmp
= TREE_TYPE (t
);
3346 while (TREE_CODE (tmp
) == ARRAY_TYPE
)
3348 dump_array_domain (pp
, TYPE_DOMAIN (tmp
), spc
, flags
);
3349 tmp
= TREE_TYPE (tmp
);
3352 else if (TREE_CODE (t
) == FUNCTION_DECL
)
3354 dump_generic_node (pp
, TREE_TYPE (TREE_TYPE (t
)), spc
, flags
, false);
3356 dump_decl_name (pp
, t
, flags
);
3357 dump_function_declaration (pp
, TREE_TYPE (t
), spc
, flags
);
3361 /* Print type declaration. */
3362 dump_generic_node (pp
, TREE_TYPE (t
), spc
, flags
, false);
3364 /* Print variable's name. */
3366 dump_generic_node (pp
, t
, spc
, flags
, false);
3369 if (VAR_P (t
) && DECL_HARD_REGISTER (t
))
3371 pp_string (pp
, " __asm__ ");
3373 dump_generic_node (pp
, DECL_ASSEMBLER_NAME (t
), spc
, flags
, false);
3374 pp_right_paren (pp
);
3377 /* The initial value of a function serves to determine whether the function
3378 is declared or defined. So the following does not apply to function
3380 if (TREE_CODE (t
) != FUNCTION_DECL
)
3382 /* Print the initial value. */
3383 if (DECL_INITIAL (t
))
3388 dump_generic_node (pp
, DECL_INITIAL (t
), spc
, flags
, false);
3392 if (VAR_P (t
) && DECL_HAS_VALUE_EXPR_P (t
))
3394 pp_string (pp
, " [value-expr: ");
3395 dump_generic_node (pp
, DECL_VALUE_EXPR (t
), spc
, flags
, false);
3396 pp_right_bracket (pp
);
3403 /* Prints a structure: name, fields, and methods.
3404 FIXME: Still incomplete. */
3407 print_struct_decl (pretty_printer
*pp
, const_tree node
, int spc
,
3410 /* Print the name of the structure. */
3411 if (TYPE_NAME (node
))
3414 if (TREE_CODE (node
) == RECORD_TYPE
)
3415 pp_string (pp
, "struct ");
3416 else if ((TREE_CODE (node
) == UNION_TYPE
3417 || TREE_CODE (node
) == QUAL_UNION_TYPE
))
3418 pp_string (pp
, "union ");
3420 dump_generic_node (pp
, TYPE_NAME (node
), spc
, 0, false);
3423 /* Print the contents of the structure. */
3429 /* Print the fields of the structure. */
3432 tmp
= TYPE_FIELDS (node
);
3435 /* Avoid to print recursively the structure. */
3436 /* FIXME : Not implemented correctly...,
3437 what about the case when we have a cycle in the contain graph? ...
3438 Maybe this could be solved by looking at the scope in which the
3439 structure was declared. */
3440 if (TREE_TYPE (tmp
) != node
3441 && (TREE_CODE (TREE_TYPE (tmp
)) != POINTER_TYPE
3442 || TREE_TYPE (TREE_TYPE (tmp
)) != node
))
3444 print_declaration (pp
, tmp
, spc
+2, flags
);
3447 tmp
= DECL_CHAIN (tmp
);
3451 pp_right_brace (pp
);
3454 /* Return the priority of the operator CODE.
3456 From lowest to highest precedence with either left-to-right (L-R)
3457 or right-to-left (R-L) associativity]:
3460 2 [R-L] = += -= *= /= %= &= ^= |= <<= >>=
3472 14 [R-L] ! ~ ++ -- + - * & (type) sizeof
3473 15 [L-R] fn() [] -> .
3475 unary +, - and * have higher precedence than the corresponding binary
3479 op_code_prio (enum tree_code code
)
3496 case TRUTH_ORIF_EXPR
:
3499 case TRUTH_AND_EXPR
:
3500 case TRUTH_ANDIF_EXPR
:
3507 case TRUTH_XOR_EXPR
:
3524 case UNORDERED_EXPR
:
3535 case VEC_WIDEN_LSHIFT_HI_EXPR
:
3536 case VEC_WIDEN_LSHIFT_LO_EXPR
:
3537 case WIDEN_LSHIFT_EXPR
:
3540 case WIDEN_SUM_EXPR
:
3542 case POINTER_PLUS_EXPR
:
3546 case VEC_WIDEN_MULT_HI_EXPR
:
3547 case VEC_WIDEN_MULT_LO_EXPR
:
3548 case WIDEN_MULT_EXPR
:
3550 case WIDEN_MULT_PLUS_EXPR
:
3551 case WIDEN_MULT_MINUS_EXPR
:
3553 case MULT_HIGHPART_EXPR
:
3554 case TRUNC_DIV_EXPR
:
3556 case FLOOR_DIV_EXPR
:
3557 case ROUND_DIV_EXPR
:
3559 case EXACT_DIV_EXPR
:
3560 case TRUNC_MOD_EXPR
:
3562 case FLOOR_MOD_EXPR
:
3563 case ROUND_MOD_EXPR
:
3567 case TRUTH_NOT_EXPR
:
3569 case POSTINCREMENT_EXPR
:
3570 case POSTDECREMENT_EXPR
:
3571 case PREINCREMENT_EXPR
:
3572 case PREDECREMENT_EXPR
:
3578 case FIX_TRUNC_EXPR
:
3584 case ARRAY_RANGE_REF
:
3588 /* Special expressions. */
3594 case REDUC_MAX_EXPR
:
3595 case REDUC_MIN_EXPR
:
3596 case REDUC_PLUS_EXPR
:
3597 case VEC_UNPACK_HI_EXPR
:
3598 case VEC_UNPACK_LO_EXPR
:
3599 case VEC_UNPACK_FLOAT_HI_EXPR
:
3600 case VEC_UNPACK_FLOAT_LO_EXPR
:
3601 case VEC_PACK_TRUNC_EXPR
:
3602 case VEC_PACK_SAT_EXPR
:
3606 /* Return an arbitrarily high precedence to avoid surrounding single
3607 VAR_DECLs in ()s. */
3612 /* Return the priority of the operator OP. */
3615 op_prio (const_tree op
)
3617 enum tree_code code
;
3622 code
= TREE_CODE (op
);
3623 if (code
== SAVE_EXPR
|| code
== NON_LVALUE_EXPR
)
3624 return op_prio (TREE_OPERAND (op
, 0));
3626 return op_code_prio (code
);
3629 /* Return the symbol associated with operator CODE. */
3632 op_symbol_code (enum tree_code code
)
3640 case TRUTH_ORIF_EXPR
:
3643 case TRUTH_AND_EXPR
:
3644 case TRUTH_ANDIF_EXPR
:
3650 case TRUTH_XOR_EXPR
:
3660 case UNORDERED_EXPR
:
3706 case WIDEN_LSHIFT_EXPR
:
3709 case POINTER_PLUS_EXPR
:
3715 case REDUC_PLUS_EXPR
:
3718 case WIDEN_SUM_EXPR
:
3721 case WIDEN_MULT_EXPR
:
3724 case MULT_HIGHPART_EXPR
:
3734 case TRUTH_NOT_EXPR
:
3741 case TRUNC_DIV_EXPR
:
3748 case FLOOR_DIV_EXPR
:
3751 case ROUND_DIV_EXPR
:
3754 case EXACT_DIV_EXPR
:
3757 case TRUNC_MOD_EXPR
:
3763 case FLOOR_MOD_EXPR
:
3766 case ROUND_MOD_EXPR
:
3769 case PREDECREMENT_EXPR
:
3772 case PREINCREMENT_EXPR
:
3775 case POSTDECREMENT_EXPR
:
3778 case POSTINCREMENT_EXPR
:
3788 return "<<< ??? >>>";
3792 /* Return the symbol associated with operator OP. */
3795 op_symbol (const_tree op
)
3797 return op_symbol_code (TREE_CODE (op
));
3800 /* Prints the name of a call. NODE is the CALL_EXPR_FN of a CALL_EXPR or
3801 the gimple_call_fn of a GIMPLE_CALL. */
3804 print_call_name (pretty_printer
*pp
, tree node
, dump_flags_t flags
)
3808 if (TREE_CODE (op0
) == NON_LVALUE_EXPR
)
3809 op0
= TREE_OPERAND (op0
, 0);
3812 switch (TREE_CODE (op0
))
3817 dump_function_name (pp
, op0
, flags
);
3823 op0
= TREE_OPERAND (op0
, 0);
3828 dump_generic_node (pp
, TREE_OPERAND (op0
, 0), 0, flags
, false);
3829 pp_string (pp
, ") ? ");
3830 dump_generic_node (pp
, TREE_OPERAND (op0
, 1), 0, flags
, false);
3831 pp_string (pp
, " : ");
3832 dump_generic_node (pp
, TREE_OPERAND (op0
, 2), 0, flags
, false);
3836 if (TREE_CODE (TREE_OPERAND (op0
, 0)) == VAR_DECL
)
3837 dump_function_name (pp
, TREE_OPERAND (op0
, 0), flags
);
3839 dump_generic_node (pp
, op0
, 0, flags
, false);
3843 if (integer_zerop (TREE_OPERAND (op0
, 1)))
3845 op0
= TREE_OPERAND (op0
, 0);
3852 dump_generic_node (pp
, op0
, 0, flags
, false);
3860 /* Parses the string STR and replaces new-lines by '\n', tabs by '\t', ... */
3863 pretty_print_string (pretty_printer
*pp
, const char *str
)
3873 pp_string (pp
, "\\b");
3877 pp_string (pp
, "\\f");
3881 pp_string (pp
, "\\n");
3885 pp_string (pp
, "\\r");
3889 pp_string (pp
, "\\t");
3893 pp_string (pp
, "\\v");
3897 pp_string (pp
, "\\\\");
3901 pp_string (pp
, "\\\"");
3905 pp_string (pp
, "\\'");
3908 /* No need to handle \0; the loop terminates on \0. */
3911 pp_string (pp
, "\\1");
3915 pp_string (pp
, "\\2");
3919 pp_string (pp
, "\\3");
3923 pp_string (pp
, "\\4");
3927 pp_string (pp
, "\\5");
3931 pp_string (pp
, "\\6");
3935 pp_string (pp
, "\\7");
3939 if (!ISPRINT (str
[0]))
3942 sprintf (buf
, "\\x%x", (unsigned char)str
[0]);
3943 pp_string (pp
, buf
);
3946 pp_character (pp
, str
[0]);
3954 maybe_init_pretty_print (FILE *file
)
3958 tree_pp
= new pretty_printer ();
3959 pp_needs_newline (tree_pp
) = true;
3960 pp_translate_identifiers (tree_pp
) = false;
3963 tree_pp
->buffer
->stream
= file
;
3967 newline_and_indent (pretty_printer
*pp
, int spc
)
3973 /* Handle a %K format for TEXT. Separate from default_tree_printer so
3974 it can also be used in front ends.
3975 %K: a statement, from which EXPR_LOCATION and TREE_BLOCK will be recorded.
3979 percent_K_format (text_info
*text
)
3981 tree t
= va_arg (*text
->args_ptr
, tree
), block
;
3982 text
->set_location (0, EXPR_LOCATION (t
), true);
3983 gcc_assert (pp_ti_abstract_origin (text
) != NULL
);
3984 block
= TREE_BLOCK (t
);
3985 *pp_ti_abstract_origin (text
) = NULL
;
3989 /* ??? LTO drops all BLOCK_ABSTRACT_ORIGINs apart from those
3990 representing the outermost block of an inlined function.
3991 So walk the BLOCK tree until we hit such a scope. */
3993 && TREE_CODE (block
) == BLOCK
)
3995 if (inlined_function_outer_scope_p (block
))
3997 *pp_ti_abstract_origin (text
) = block
;
4000 block
= BLOCK_SUPERCONTEXT (block
);
4006 && TREE_CODE (block
) == BLOCK
4007 && BLOCK_ABSTRACT_ORIGIN (block
))
4009 tree ao
= BLOCK_ABSTRACT_ORIGIN (block
);
4011 while (TREE_CODE (ao
) == BLOCK
4012 && BLOCK_ABSTRACT_ORIGIN (ao
)
4013 && BLOCK_ABSTRACT_ORIGIN (ao
) != ao
)
4014 ao
= BLOCK_ABSTRACT_ORIGIN (ao
);
4016 if (TREE_CODE (ao
) == FUNCTION_DECL
)
4018 *pp_ti_abstract_origin (text
) = block
;
4021 block
= BLOCK_SUPERCONTEXT (block
);
4025 /* Print the identifier ID to PRETTY-PRINTER. */
4028 pp_tree_identifier (pretty_printer
*pp
, tree id
)
4030 if (pp_translate_identifiers (pp
))
4032 const char *text
= identifier_to_locale (IDENTIFIER_POINTER (id
));
4033 pp_append_text (pp
, text
, text
+ strlen (text
));
4036 pp_append_text (pp
, IDENTIFIER_POINTER (id
),
4037 IDENTIFIER_POINTER (id
) + IDENTIFIER_LENGTH (id
));
4040 /* A helper function that is used to dump function information before the
4044 dump_function_header (FILE *dump_file
, tree fdecl
, dump_flags_t flags
)
4046 const char *dname
, *aname
;
4047 struct cgraph_node
*node
= cgraph_node::get (fdecl
);
4048 struct function
*fun
= DECL_STRUCT_FUNCTION (fdecl
);
4050 dname
= lang_hooks
.decl_printable_name (fdecl
, 2);
4052 if (DECL_ASSEMBLER_NAME_SET_P (fdecl
))
4053 aname
= (IDENTIFIER_POINTER
4054 (DECL_ASSEMBLER_NAME (fdecl
)));
4056 aname
= "<unset-asm-name>";
4058 fprintf (dump_file
, "\n;; Function %s (%s, funcdef_no=%d",
4059 dname
, aname
, fun
->funcdef_no
);
4060 if (!(flags
& TDF_NOUID
))
4061 fprintf (dump_file
, ", decl_uid=%d", DECL_UID (fdecl
));
4064 fprintf (dump_file
, ", cgraph_uid=%d", node
->uid
);
4065 fprintf (dump_file
, ", symbol_order=%d)%s\n\n", node
->order
,
4066 node
->frequency
== NODE_FREQUENCY_HOT
4068 : node
->frequency
== NODE_FREQUENCY_UNLIKELY_EXECUTED
4069 ? " (unlikely executed)"
4070 : node
->frequency
== NODE_FREQUENCY_EXECUTED_ONCE
4071 ? " (executed once)"
4075 fprintf (dump_file
, ")\n\n");
4078 /* Dump double_int D to pretty_printer PP. UNS is true
4079 if D is unsigned and false otherwise. */
4081 pp_double_int (pretty_printer
*pp
, double_int d
, bool uns
)
4084 pp_wide_integer (pp
, d
.low
);
4085 else if (d
.fits_uhwi ())
4086 pp_unsigned_wide_integer (pp
, d
.low
);
4089 unsigned HOST_WIDE_INT low
= d
.low
;
4090 HOST_WIDE_INT high
= d
.high
;
4091 if (!uns
&& d
.is_negative ())
4094 high
= ~high
+ !low
;
4097 /* Would "%x%0*x" or "%x%*0x" get zero-padding on all
4099 sprintf (pp_buffer (pp
)->digit_buffer
,
4100 HOST_WIDE_INT_PRINT_DOUBLE_HEX
,
4101 (unsigned HOST_WIDE_INT
) high
, low
);
4102 pp_string (pp
, pp_buffer (pp
)->digit_buffer
);