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 if ((TREE_CODE (TREE_TYPE (node
)) == RECORD_TYPE
1864 || TREE_CODE (TREE_TYPE (node
)) == UNION_TYPE
)
1865 && TYPE_METHODS (TREE_TYPE (node
)))
1867 /* The type is a c++ class: all structures have at least
1869 pp_string (pp
, "class ");
1870 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1875 (TREE_CODE (TREE_TYPE (node
)) == UNION_TYPE
1876 ? "union" : "struct "));
1877 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1881 pp_string (pp
, "<anon>");
1887 case DEBUG_EXPR_DECL
:
1888 case NAMESPACE_DECL
:
1890 dump_decl_name (pp
, node
, flags
);
1894 pp_string (pp
, "<retval>");
1898 op0
= TREE_OPERAND (node
, 0);
1901 && (TREE_CODE (op0
) == INDIRECT_REF
1902 || (TREE_CODE (op0
) == MEM_REF
1903 && TREE_CODE (TREE_OPERAND (op0
, 0)) != ADDR_EXPR
1904 && integer_zerop (TREE_OPERAND (op0
, 1))
1905 /* Dump the types of INTEGER_CSTs explicitly, for we
1906 can't infer them and MEM_ATTR caching will share
1907 MEM_REFs with differently-typed op0s. */
1908 && TREE_CODE (TREE_OPERAND (op0
, 0)) != INTEGER_CST
1909 /* Released SSA_NAMES have no TREE_TYPE. */
1910 && TREE_TYPE (TREE_OPERAND (op0
, 0)) != NULL_TREE
1911 /* Same pointer types, but ignoring POINTER_TYPE vs.
1913 && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 0)))
1914 == TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 1))))
1915 && (TYPE_MODE (TREE_TYPE (TREE_OPERAND (op0
, 0)))
1916 == TYPE_MODE (TREE_TYPE (TREE_OPERAND (op0
, 1))))
1917 && (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (op0
, 0)))
1918 == TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (op0
, 1))))
1919 /* Same value types ignoring qualifiers. */
1920 && (TYPE_MAIN_VARIANT (TREE_TYPE (op0
))
1921 == TYPE_MAIN_VARIANT
1922 (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 1)))))
1923 && MR_DEPENDENCE_CLIQUE (op0
) == 0)))
1925 op0
= TREE_OPERAND (op0
, 0);
1928 if (op_prio (op0
) < op_prio (node
))
1930 dump_generic_node (pp
, op0
, spc
, flags
, false);
1931 if (op_prio (op0
) < op_prio (node
))
1932 pp_right_paren (pp
);
1933 pp_string (pp
, str
);
1934 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1935 op0
= component_ref_field_offset (node
);
1936 if (op0
&& TREE_CODE (op0
) != INTEGER_CST
)
1938 pp_string (pp
, "{off: ");
1939 dump_generic_node (pp
, op0
, spc
, flags
, false);
1940 pp_right_brace (pp
);
1945 pp_string (pp
, "BIT_FIELD_REF <");
1946 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1947 pp_string (pp
, ", ");
1948 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1949 pp_string (pp
, ", ");
1950 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
1954 case BIT_INSERT_EXPR
:
1955 pp_string (pp
, "BIT_INSERT_EXPR <");
1956 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1957 pp_string (pp
, ", ");
1958 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1959 pp_string (pp
, ", ");
1960 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
1961 pp_string (pp
, " (");
1962 if (INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (node
, 1))))
1964 TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (node
, 1))));
1966 dump_generic_node (pp
, TYPE_SIZE (TREE_TYPE (TREE_OPERAND (node
, 1))),
1968 pp_string (pp
, " bits)>");
1972 case ARRAY_RANGE_REF
:
1973 op0
= TREE_OPERAND (node
, 0);
1974 if (op_prio (op0
) < op_prio (node
))
1976 dump_generic_node (pp
, op0
, spc
, flags
, false);
1977 if (op_prio (op0
) < op_prio (node
))
1978 pp_right_paren (pp
);
1979 pp_left_bracket (pp
);
1980 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1981 if (TREE_CODE (node
) == ARRAY_RANGE_REF
)
1982 pp_string (pp
, " ...");
1983 pp_right_bracket (pp
);
1985 op0
= array_ref_low_bound (node
);
1986 op1
= array_ref_element_size (node
);
1988 if (!integer_zerop (op0
)
1989 || TREE_OPERAND (node
, 2)
1990 || TREE_OPERAND (node
, 3))
1992 pp_string (pp
, "{lb: ");
1993 dump_generic_node (pp
, op0
, spc
, flags
, false);
1994 pp_string (pp
, " sz: ");
1995 dump_generic_node (pp
, op1
, spc
, flags
, false);
1996 pp_right_brace (pp
);
2002 unsigned HOST_WIDE_INT ix
;
2004 bool is_struct_init
= false;
2005 bool is_array_init
= false;
2008 if (TREE_CLOBBER_P (node
))
2009 pp_string (pp
, "CLOBBER");
2010 else if (TREE_CODE (TREE_TYPE (node
)) == RECORD_TYPE
2011 || TREE_CODE (TREE_TYPE (node
)) == UNION_TYPE
)
2012 is_struct_init
= true;
2013 else if (TREE_CODE (TREE_TYPE (node
)) == ARRAY_TYPE
2014 && TYPE_DOMAIN (TREE_TYPE (node
))
2015 && TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
)))
2016 && TREE_CODE (TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
))))
2019 tree minv
= TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
)));
2020 is_array_init
= true;
2021 curidx
= wi::to_widest (minv
);
2023 FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (node
), ix
, field
, val
)
2030 dump_generic_node (pp
, field
, spc
, flags
, false);
2033 else if (is_array_init
2034 && (TREE_CODE (field
) != INTEGER_CST
2035 || curidx
!= wi::to_widest (field
)))
2037 pp_left_bracket (pp
);
2038 if (TREE_CODE (field
) == RANGE_EXPR
)
2040 dump_generic_node (pp
, TREE_OPERAND (field
, 0), spc
,
2042 pp_string (pp
, " ... ");
2043 dump_generic_node (pp
, TREE_OPERAND (field
, 1), spc
,
2045 if (TREE_CODE (TREE_OPERAND (field
, 1)) == INTEGER_CST
)
2046 curidx
= wi::to_widest (TREE_OPERAND (field
, 1));
2049 dump_generic_node (pp
, field
, spc
, flags
, false);
2050 if (TREE_CODE (field
) == INTEGER_CST
)
2051 curidx
= wi::to_widest (field
);
2052 pp_string (pp
, "]=");
2057 if (val
&& TREE_CODE (val
) == ADDR_EXPR
)
2058 if (TREE_CODE (TREE_OPERAND (val
, 0)) == FUNCTION_DECL
)
2059 val
= TREE_OPERAND (val
, 0);
2060 if (val
&& TREE_CODE (val
) == FUNCTION_DECL
)
2061 dump_decl_name (pp
, val
, flags
);
2063 dump_generic_node (pp
, val
, spc
, flags
, false);
2064 if (ix
!= CONSTRUCTOR_NELTS (node
) - 1)
2070 pp_right_brace (pp
);
2077 if (flags
& TDF_SLIM
)
2079 pp_string (pp
, "<COMPOUND_EXPR>");
2083 dump_generic_node (pp
, TREE_OPERAND (node
, 0),
2084 spc
, flags
, !(flags
& TDF_SLIM
));
2085 if (flags
& TDF_SLIM
)
2086 newline_and_indent (pp
, spc
);
2093 for (tp
= &TREE_OPERAND (node
, 1);
2094 TREE_CODE (*tp
) == COMPOUND_EXPR
;
2095 tp
= &TREE_OPERAND (*tp
, 1))
2097 dump_generic_node (pp
, TREE_OPERAND (*tp
, 0),
2098 spc
, flags
, !(flags
& TDF_SLIM
));
2099 if (flags
& TDF_SLIM
)
2100 newline_and_indent (pp
, spc
);
2108 dump_generic_node (pp
, *tp
, spc
, flags
, !(flags
& TDF_SLIM
));
2112 case STATEMENT_LIST
:
2114 tree_stmt_iterator si
;
2117 if (flags
& TDF_SLIM
)
2119 pp_string (pp
, "<STATEMENT_LIST>");
2123 for (si
= tsi_start (node
); !tsi_end_p (si
); tsi_next (&si
))
2126 newline_and_indent (pp
, spc
);
2129 dump_generic_node (pp
, tsi_stmt (si
), spc
, flags
, true);
2136 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
,
2141 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
,
2146 pp_string (pp
, "TARGET_EXPR <");
2147 dump_generic_node (pp
, TARGET_EXPR_SLOT (node
), spc
, flags
, false);
2150 dump_generic_node (pp
, TARGET_EXPR_INITIAL (node
), spc
, flags
, false);
2155 print_declaration (pp
, DECL_EXPR_DECL (node
), spc
, flags
);
2160 if (TREE_TYPE (node
) == NULL
|| TREE_TYPE (node
) == void_type_node
)
2162 pp_string (pp
, "if (");
2163 dump_generic_node (pp
, COND_EXPR_COND (node
), spc
, flags
, false);
2164 pp_right_paren (pp
);
2165 /* The lowered cond_exprs should always be printed in full. */
2166 if (COND_EXPR_THEN (node
)
2167 && (IS_EMPTY_STMT (COND_EXPR_THEN (node
))
2168 || TREE_CODE (COND_EXPR_THEN (node
)) == GOTO_EXPR
)
2169 && COND_EXPR_ELSE (node
)
2170 && (IS_EMPTY_STMT (COND_EXPR_ELSE (node
))
2171 || TREE_CODE (COND_EXPR_ELSE (node
)) == GOTO_EXPR
))
2174 dump_generic_node (pp
, COND_EXPR_THEN (node
),
2176 if (!IS_EMPTY_STMT (COND_EXPR_ELSE (node
)))
2178 pp_string (pp
, " else ");
2179 dump_generic_node (pp
, COND_EXPR_ELSE (node
),
2183 else if (!(flags
& TDF_SLIM
))
2185 /* Output COND_EXPR_THEN. */
2186 if (COND_EXPR_THEN (node
))
2188 newline_and_indent (pp
, spc
+2);
2190 newline_and_indent (pp
, spc
+4);
2191 dump_generic_node (pp
, COND_EXPR_THEN (node
), spc
+4,
2193 newline_and_indent (pp
, spc
+2);
2194 pp_right_brace (pp
);
2197 /* Output COND_EXPR_ELSE. */
2198 if (COND_EXPR_ELSE (node
)
2199 && !IS_EMPTY_STMT (COND_EXPR_ELSE (node
)))
2201 newline_and_indent (pp
, spc
);
2202 pp_string (pp
, "else");
2203 newline_and_indent (pp
, spc
+2);
2205 newline_and_indent (pp
, spc
+4);
2206 dump_generic_node (pp
, COND_EXPR_ELSE (node
), spc
+4,
2208 newline_and_indent (pp
, spc
+2);
2209 pp_right_brace (pp
);
2216 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2220 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2224 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2230 if (!(flags
& TDF_SLIM
))
2232 if (BIND_EXPR_VARS (node
))
2236 for (op0
= BIND_EXPR_VARS (node
); op0
; op0
= DECL_CHAIN (op0
))
2238 print_declaration (pp
, op0
, spc
+2, flags
);
2243 newline_and_indent (pp
, spc
+2);
2244 dump_generic_node (pp
, BIND_EXPR_BODY (node
), spc
+2, flags
, true);
2245 newline_and_indent (pp
, spc
);
2246 pp_right_brace (pp
);
2252 if (CALL_EXPR_FN (node
) != NULL_TREE
)
2253 print_call_name (pp
, CALL_EXPR_FN (node
), flags
);
2255 pp_string (pp
, internal_fn_name (CALL_EXPR_IFN (node
)));
2257 /* Print parameters. */
2262 call_expr_arg_iterator iter
;
2263 FOR_EACH_CALL_EXPR_ARG (arg
, iter
, node
)
2265 dump_generic_node (pp
, arg
, spc
, flags
, false);
2266 if (more_call_expr_args_p (&iter
))
2273 if (CALL_EXPR_VA_ARG_PACK (node
))
2275 if (call_expr_nargs (node
) > 0)
2280 pp_string (pp
, "__builtin_va_arg_pack ()");
2282 pp_right_paren (pp
);
2284 op1
= CALL_EXPR_STATIC_CHAIN (node
);
2287 pp_string (pp
, " [static-chain: ");
2288 dump_generic_node (pp
, op1
, spc
, flags
, false);
2289 pp_right_bracket (pp
);
2292 if (CALL_EXPR_RETURN_SLOT_OPT (node
))
2293 pp_string (pp
, " [return slot optimization]");
2294 if (CALL_EXPR_TAILCALL (node
))
2295 pp_string (pp
, " [tail call]");
2298 case WITH_CLEANUP_EXPR
:
2302 case CLEANUP_POINT_EXPR
:
2303 pp_string (pp
, "<<cleanup_point ");
2304 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2305 pp_string (pp
, ">>");
2308 case PLACEHOLDER_EXPR
:
2309 pp_string (pp
, "<PLACEHOLDER_EXPR ");
2310 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
2314 /* Binary arithmetic and logic expressions. */
2315 case WIDEN_SUM_EXPR
:
2316 case WIDEN_MULT_EXPR
:
2318 case MULT_HIGHPART_EXPR
:
2320 case POINTER_PLUS_EXPR
:
2322 case TRUNC_DIV_EXPR
:
2324 case FLOOR_DIV_EXPR
:
2325 case ROUND_DIV_EXPR
:
2326 case TRUNC_MOD_EXPR
:
2328 case FLOOR_MOD_EXPR
:
2329 case ROUND_MOD_EXPR
:
2331 case EXACT_DIV_EXPR
:
2336 case WIDEN_LSHIFT_EXPR
:
2340 case TRUTH_ANDIF_EXPR
:
2341 case TRUTH_ORIF_EXPR
:
2342 case TRUTH_AND_EXPR
:
2344 case TRUTH_XOR_EXPR
:
2358 case UNORDERED_EXPR
:
2360 const char *op
= op_symbol (node
);
2361 op0
= TREE_OPERAND (node
, 0);
2362 op1
= TREE_OPERAND (node
, 1);
2364 /* When the operands are expressions with less priority,
2365 keep semantics of the tree representation. */
2366 if (op_prio (op0
) <= op_prio (node
))
2369 dump_generic_node (pp
, op0
, spc
, flags
, false);
2370 pp_right_paren (pp
);
2373 dump_generic_node (pp
, op0
, spc
, flags
, false);
2379 /* When the operands are expressions with less priority,
2380 keep semantics of the tree representation. */
2381 if (op_prio (op1
) <= op_prio (node
))
2384 dump_generic_node (pp
, op1
, spc
, flags
, false);
2385 pp_right_paren (pp
);
2388 dump_generic_node (pp
, op1
, spc
, flags
, false);
2392 /* Unary arithmetic and logic expressions. */
2395 case TRUTH_NOT_EXPR
:
2397 case PREDECREMENT_EXPR
:
2398 case PREINCREMENT_EXPR
:
2400 if (TREE_CODE (node
) == ADDR_EXPR
2401 && (TREE_CODE (TREE_OPERAND (node
, 0)) == STRING_CST
2402 || TREE_CODE (TREE_OPERAND (node
, 0)) == FUNCTION_DECL
))
2403 ; /* Do not output '&' for strings and function pointers. */
2405 pp_string (pp
, op_symbol (node
));
2407 if (op_prio (TREE_OPERAND (node
, 0)) < op_prio (node
))
2410 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2411 pp_right_paren (pp
);
2414 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2417 case POSTDECREMENT_EXPR
:
2418 case POSTINCREMENT_EXPR
:
2419 if (op_prio (TREE_OPERAND (node
, 0)) < op_prio (node
))
2422 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2423 pp_right_paren (pp
);
2426 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2427 pp_string (pp
, op_symbol (node
));
2431 pp_string (pp
, "MIN_EXPR <");
2432 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2433 pp_string (pp
, ", ");
2434 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2439 pp_string (pp
, "MAX_EXPR <");
2440 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2441 pp_string (pp
, ", ");
2442 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2447 pp_string (pp
, "ABS_EXPR <");
2448 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2456 case ADDR_SPACE_CONVERT_EXPR
:
2457 case FIXED_CONVERT_EXPR
:
2458 case FIX_TRUNC_EXPR
:
2461 type
= TREE_TYPE (node
);
2462 op0
= TREE_OPERAND (node
, 0);
2463 if (type
!= TREE_TYPE (op0
))
2466 dump_generic_node (pp
, type
, spc
, flags
, false);
2467 pp_string (pp
, ") ");
2469 if (op_prio (op0
) < op_prio (node
))
2471 dump_generic_node (pp
, op0
, spc
, flags
, false);
2472 if (op_prio (op0
) < op_prio (node
))
2473 pp_right_paren (pp
);
2476 case VIEW_CONVERT_EXPR
:
2477 pp_string (pp
, "VIEW_CONVERT_EXPR<");
2478 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
2479 pp_string (pp
, ">(");
2480 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2481 pp_right_paren (pp
);
2485 pp_string (pp
, "((");
2486 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2487 pp_string (pp
, "))");
2490 case NON_LVALUE_EXPR
:
2491 pp_string (pp
, "NON_LVALUE_EXPR <");
2492 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2497 pp_string (pp
, "SAVE_EXPR <");
2498 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2503 pp_string (pp
, "COMPLEX_EXPR <");
2504 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2505 pp_string (pp
, ", ");
2506 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2511 pp_string (pp
, "CONJ_EXPR <");
2512 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2517 if (flags
& TDF_GIMPLE
)
2519 pp_string (pp
, "__real ");
2520 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2524 pp_string (pp
, "REALPART_EXPR <");
2525 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2531 if (flags
& TDF_GIMPLE
)
2533 pp_string (pp
, "__imag ");
2534 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2538 pp_string (pp
, "IMAGPART_EXPR <");
2539 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2545 pp_string (pp
, "VA_ARG_EXPR <");
2546 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2550 case TRY_FINALLY_EXPR
:
2551 case TRY_CATCH_EXPR
:
2552 pp_string (pp
, "try");
2553 newline_and_indent (pp
, spc
+2);
2555 newline_and_indent (pp
, spc
+4);
2556 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
+4, flags
, true);
2557 newline_and_indent (pp
, spc
+2);
2558 pp_right_brace (pp
);
2559 newline_and_indent (pp
, spc
);
2561 (TREE_CODE (node
) == TRY_CATCH_EXPR
) ? "catch" : "finally");
2562 newline_and_indent (pp
, spc
+2);
2564 newline_and_indent (pp
, spc
+4);
2565 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
+4, flags
, true);
2566 newline_and_indent (pp
, spc
+2);
2567 pp_right_brace (pp
);
2572 pp_string (pp
, "catch (");
2573 dump_generic_node (pp
, CATCH_TYPES (node
), spc
+2, flags
, false);
2574 pp_right_paren (pp
);
2575 newline_and_indent (pp
, spc
+2);
2577 newline_and_indent (pp
, spc
+4);
2578 dump_generic_node (pp
, CATCH_BODY (node
), spc
+4, flags
, true);
2579 newline_and_indent (pp
, spc
+2);
2580 pp_right_brace (pp
);
2584 case EH_FILTER_EXPR
:
2585 pp_string (pp
, "<<<eh_filter (");
2586 dump_generic_node (pp
, EH_FILTER_TYPES (node
), spc
+2, flags
, false);
2587 pp_string (pp
, ")>>>");
2588 newline_and_indent (pp
, spc
+2);
2590 newline_and_indent (pp
, spc
+4);
2591 dump_generic_node (pp
, EH_FILTER_FAILURE (node
), spc
+4, flags
, true);
2592 newline_and_indent (pp
, spc
+2);
2593 pp_right_brace (pp
);
2598 op0
= TREE_OPERAND (node
, 0);
2599 /* If this is for break or continue, don't bother printing it. */
2600 if (DECL_NAME (op0
))
2602 const char *name
= IDENTIFIER_POINTER (DECL_NAME (op0
));
2603 if (strcmp (name
, "break") == 0
2604 || strcmp (name
, "continue") == 0)
2607 dump_generic_node (pp
, op0
, spc
, flags
, false);
2609 if (DECL_NONLOCAL (op0
))
2610 pp_string (pp
, " [non-local]");
2614 pp_string (pp
, "while (1)");
2615 if (!(flags
& TDF_SLIM
))
2617 newline_and_indent (pp
, spc
+2);
2619 newline_and_indent (pp
, spc
+4);
2620 dump_generic_node (pp
, LOOP_EXPR_BODY (node
), spc
+4, flags
, true);
2621 newline_and_indent (pp
, spc
+2);
2622 pp_right_brace (pp
);
2628 pp_string (pp
, "// predicted ");
2629 if (PREDICT_EXPR_OUTCOME (node
))
2630 pp_string (pp
, "likely by ");
2632 pp_string (pp
, "unlikely by ");
2633 pp_string (pp
, predictor_name (PREDICT_EXPR_PREDICTOR (node
)));
2634 pp_string (pp
, " predictor.");
2638 pp_string (pp
, "ANNOTATE_EXPR <");
2639 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2640 switch ((enum annot_expr_kind
) TREE_INT_CST_LOW (TREE_OPERAND (node
, 1)))
2642 case annot_expr_ivdep_kind
:
2643 pp_string (pp
, ", ivdep");
2645 case annot_expr_no_vector_kind
:
2646 pp_string (pp
, ", no-vector");
2648 case annot_expr_vector_kind
:
2649 pp_string (pp
, ", vector");
2658 pp_string (pp
, "return");
2659 op0
= TREE_OPERAND (node
, 0);
2663 if (TREE_CODE (op0
) == MODIFY_EXPR
)
2664 dump_generic_node (pp
, TREE_OPERAND (op0
, 1),
2667 dump_generic_node (pp
, op0
, spc
, flags
, false);
2672 pp_string (pp
, "if (");
2673 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2674 pp_string (pp
, ") break");
2678 pp_string (pp
, "switch (");
2679 dump_generic_node (pp
, SWITCH_COND (node
), spc
, flags
, false);
2680 pp_right_paren (pp
);
2681 if (!(flags
& TDF_SLIM
))
2683 newline_and_indent (pp
, spc
+2);
2685 if (SWITCH_BODY (node
))
2687 newline_and_indent (pp
, spc
+4);
2688 dump_generic_node (pp
, SWITCH_BODY (node
), spc
+4, flags
,
2693 tree vec
= SWITCH_LABELS (node
);
2694 size_t i
, n
= TREE_VEC_LENGTH (vec
);
2695 for (i
= 0; i
< n
; ++i
)
2697 tree elt
= TREE_VEC_ELT (vec
, i
);
2698 newline_and_indent (pp
, spc
+4);
2701 dump_generic_node (pp
, elt
, spc
+4, flags
, false);
2702 pp_string (pp
, " goto ");
2703 dump_generic_node (pp
, CASE_LABEL (elt
), spc
+4,
2708 pp_string (pp
, "case ???: goto ???;");
2711 newline_and_indent (pp
, spc
+2);
2712 pp_right_brace (pp
);
2718 op0
= GOTO_DESTINATION (node
);
2719 if (TREE_CODE (op0
) != SSA_NAME
&& DECL_P (op0
) && DECL_NAME (op0
))
2721 const char *name
= IDENTIFIER_POINTER (DECL_NAME (op0
));
2722 if (strcmp (name
, "break") == 0
2723 || strcmp (name
, "continue") == 0)
2725 pp_string (pp
, name
);
2729 pp_string (pp
, "goto ");
2730 dump_generic_node (pp
, op0
, spc
, flags
, false);
2734 pp_string (pp
, "__asm__");
2735 if (ASM_VOLATILE_P (node
))
2736 pp_string (pp
, " __volatile__");
2738 dump_generic_node (pp
, ASM_STRING (node
), spc
, flags
, false);
2740 dump_generic_node (pp
, ASM_OUTPUTS (node
), spc
, flags
, false);
2742 dump_generic_node (pp
, ASM_INPUTS (node
), spc
, flags
, false);
2743 if (ASM_CLOBBERS (node
))
2746 dump_generic_node (pp
, ASM_CLOBBERS (node
), spc
, flags
, false);
2748 pp_right_paren (pp
);
2751 case CASE_LABEL_EXPR
:
2752 if (CASE_LOW (node
) && CASE_HIGH (node
))
2754 pp_string (pp
, "case ");
2755 dump_generic_node (pp
, CASE_LOW (node
), spc
, flags
, false);
2756 pp_string (pp
, " ... ");
2757 dump_generic_node (pp
, CASE_HIGH (node
), spc
, flags
, false);
2759 else if (CASE_LOW (node
))
2761 pp_string (pp
, "case ");
2762 dump_generic_node (pp
, CASE_LOW (node
), spc
, flags
, false);
2765 pp_string (pp
, "default");
2770 pp_string (pp
, "OBJ_TYPE_REF(");
2771 dump_generic_node (pp
, OBJ_TYPE_REF_EXPR (node
), spc
, flags
, false);
2773 if (!(flags
& TDF_SLIM
) && virtual_method_call_p (node
))
2775 pp_string (pp
, "(");
2776 dump_generic_node (pp
, obj_type_ref_class (node
), spc
, flags
, false);
2777 pp_string (pp
, ")");
2779 dump_generic_node (pp
, OBJ_TYPE_REF_OBJECT (node
), spc
, flags
, false);
2781 dump_generic_node (pp
, OBJ_TYPE_REF_TOKEN (node
), spc
, flags
, false);
2782 pp_right_paren (pp
);
2786 if (SSA_NAME_IDENTIFIER (node
))
2788 if ((flags
& TDF_NOUID
)
2789 && SSA_NAME_VAR (node
)
2790 && DECL_NAMELESS (SSA_NAME_VAR (node
)))
2791 dump_fancy_name (pp
, SSA_NAME_IDENTIFIER (node
));
2792 else if (! (flags
& TDF_GIMPLE
)
2793 || SSA_NAME_VAR (node
))
2794 dump_generic_node (pp
, SSA_NAME_IDENTIFIER (node
),
2798 pp_decimal_int (pp
, SSA_NAME_VERSION (node
));
2799 if (SSA_NAME_IS_DEFAULT_DEF (node
))
2800 pp_string (pp
, "(D)");
2801 if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (node
))
2802 pp_string (pp
, "(ab)");
2805 case WITH_SIZE_EXPR
:
2806 pp_string (pp
, "WITH_SIZE_EXPR <");
2807 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2808 pp_string (pp
, ", ");
2809 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2814 pp_string (pp
, "ASSERT_EXPR <");
2815 dump_generic_node (pp
, ASSERT_EXPR_VAR (node
), spc
, flags
, false);
2816 pp_string (pp
, ", ");
2817 dump_generic_node (pp
, ASSERT_EXPR_COND (node
), spc
, flags
, false);
2822 pp_string (pp
, "scev_known");
2825 case SCEV_NOT_KNOWN
:
2826 pp_string (pp
, "scev_not_known");
2829 case POLYNOMIAL_CHREC
:
2831 dump_generic_node (pp
, CHREC_LEFT (node
), spc
, flags
, false);
2832 pp_string (pp
, ", +, ");
2833 dump_generic_node (pp
, CHREC_RIGHT (node
), spc
, flags
, false);
2834 pp_string (pp
, "}_");
2835 dump_generic_node (pp
, CHREC_VAR (node
), spc
, flags
, false);
2839 case REALIGN_LOAD_EXPR
:
2840 pp_string (pp
, "REALIGN_LOAD <");
2841 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2842 pp_string (pp
, ", ");
2843 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2844 pp_string (pp
, ", ");
2845 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2850 pp_string (pp
, " VEC_COND_EXPR < ");
2851 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2852 pp_string (pp
, " , ");
2853 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2854 pp_string (pp
, " , ");
2855 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2856 pp_string (pp
, " > ");
2860 pp_string (pp
, " VEC_PERM_EXPR < ");
2861 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2862 pp_string (pp
, " , ");
2863 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2864 pp_string (pp
, " , ");
2865 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2866 pp_string (pp
, " > ");
2870 pp_string (pp
, " DOT_PROD_EXPR < ");
2871 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2872 pp_string (pp
, ", ");
2873 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2874 pp_string (pp
, ", ");
2875 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2876 pp_string (pp
, " > ");
2879 case WIDEN_MULT_PLUS_EXPR
:
2880 pp_string (pp
, " WIDEN_MULT_PLUS_EXPR < ");
2881 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2882 pp_string (pp
, ", ");
2883 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2884 pp_string (pp
, ", ");
2885 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2886 pp_string (pp
, " > ");
2889 case WIDEN_MULT_MINUS_EXPR
:
2890 pp_string (pp
, " WIDEN_MULT_MINUS_EXPR < ");
2891 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2892 pp_string (pp
, ", ");
2893 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2894 pp_string (pp
, ", ");
2895 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2896 pp_string (pp
, " > ");
2900 pp_string (pp
, " FMA_EXPR < ");
2901 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2902 pp_string (pp
, ", ");
2903 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2904 pp_string (pp
, ", ");
2905 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2906 pp_string (pp
, " > ");
2910 pp_string (pp
, "#pragma acc parallel");
2911 goto dump_omp_clauses_body
;
2914 pp_string (pp
, "#pragma acc kernels");
2915 goto dump_omp_clauses_body
;
2918 pp_string (pp
, "#pragma acc data");
2919 dump_omp_clauses (pp
, OACC_DATA_CLAUSES (node
), spc
, flags
);
2922 case OACC_HOST_DATA
:
2923 pp_string (pp
, "#pragma acc host_data");
2924 dump_omp_clauses (pp
, OACC_HOST_DATA_CLAUSES (node
), spc
, flags
);
2928 pp_string (pp
, "#pragma acc declare");
2929 dump_omp_clauses (pp
, OACC_DECLARE_CLAUSES (node
), spc
, flags
);
2933 pp_string (pp
, "#pragma acc update");
2934 dump_omp_clauses (pp
, OACC_UPDATE_CLAUSES (node
), spc
, flags
);
2937 case OACC_ENTER_DATA
:
2938 pp_string (pp
, "#pragma acc enter data");
2939 dump_omp_clauses (pp
, OACC_ENTER_DATA_CLAUSES (node
), spc
, flags
);
2942 case OACC_EXIT_DATA
:
2943 pp_string (pp
, "#pragma acc exit data");
2944 dump_omp_clauses (pp
, OACC_EXIT_DATA_CLAUSES (node
), spc
, flags
);
2948 pp_string (pp
, "#pragma acc cache");
2949 dump_omp_clauses (pp
, OACC_CACHE_CLAUSES (node
), spc
, flags
);
2953 pp_string (pp
, "#pragma omp parallel");
2954 dump_omp_clauses (pp
, OMP_PARALLEL_CLAUSES (node
), spc
, flags
);
2957 dump_omp_clauses_body
:
2958 dump_omp_clauses (pp
, OMP_CLAUSES (node
), spc
, flags
);
2962 if (!(flags
& TDF_SLIM
) && OMP_BODY (node
))
2964 newline_and_indent (pp
, spc
+ 2);
2966 newline_and_indent (pp
, spc
+ 4);
2967 dump_generic_node (pp
, OMP_BODY (node
), spc
+ 4, flags
, false);
2968 newline_and_indent (pp
, spc
+ 2);
2969 pp_right_brace (pp
);
2975 pp_string (pp
, "#pragma omp task");
2976 dump_omp_clauses (pp
, OMP_TASK_CLAUSES (node
), spc
, flags
);
2980 pp_string (pp
, "#pragma omp for");
2984 pp_string (pp
, "#pragma omp simd");
2988 pp_string (pp
, "#pragma simd");
2992 /* This label points one line after dumping the clauses.
2993 For _Cilk_for the clauses are dumped after the _Cilk_for (...)
2994 parameters are printed out. */
2995 goto dump_omp_loop_cilk_for
;
2997 case OMP_DISTRIBUTE
:
2998 pp_string (pp
, "#pragma omp distribute");
3002 pp_string (pp
, "#pragma omp taskloop");
3006 pp_string (pp
, "#pragma acc loop");
3010 pp_string (pp
, "#pragma omp teams");
3011 dump_omp_clauses (pp
, OMP_TEAMS_CLAUSES (node
), spc
, flags
);
3014 case OMP_TARGET_DATA
:
3015 pp_string (pp
, "#pragma omp target data");
3016 dump_omp_clauses (pp
, OMP_TARGET_DATA_CLAUSES (node
), spc
, flags
);
3019 case OMP_TARGET_ENTER_DATA
:
3020 pp_string (pp
, "#pragma omp target enter data");
3021 dump_omp_clauses (pp
, OMP_TARGET_ENTER_DATA_CLAUSES (node
), spc
, flags
);
3025 case OMP_TARGET_EXIT_DATA
:
3026 pp_string (pp
, "#pragma omp target exit data");
3027 dump_omp_clauses (pp
, OMP_TARGET_EXIT_DATA_CLAUSES (node
), spc
, flags
);
3032 pp_string (pp
, "#pragma omp target");
3033 dump_omp_clauses (pp
, OMP_TARGET_CLAUSES (node
), spc
, flags
);
3036 case OMP_TARGET_UPDATE
:
3037 pp_string (pp
, "#pragma omp target update");
3038 dump_omp_clauses (pp
, OMP_TARGET_UPDATE_CLAUSES (node
), spc
, flags
);
3043 dump_omp_clauses (pp
, OMP_FOR_CLAUSES (node
), spc
, flags
);
3045 dump_omp_loop_cilk_for
:
3046 if (!(flags
& TDF_SLIM
))
3050 if (OMP_FOR_PRE_BODY (node
))
3052 if (TREE_CODE (node
) == CILK_FOR
)
3053 pp_string (pp
, " ");
3055 newline_and_indent (pp
, spc
+ 2);
3058 newline_and_indent (pp
, spc
);
3059 dump_generic_node (pp
, OMP_FOR_PRE_BODY (node
),
3062 if (OMP_FOR_INIT (node
))
3065 for (i
= 0; i
< TREE_VEC_LENGTH (OMP_FOR_INIT (node
)); i
++)
3068 if (TREE_CODE (node
) != CILK_FOR
|| OMP_FOR_PRE_BODY (node
))
3069 newline_and_indent (pp
, spc
);
3070 if (TREE_CODE (node
) == CILK_FOR
)
3071 pp_string (pp
, "_Cilk_for (");
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
);
3087 if (TREE_CODE (node
) == CILK_FOR
)
3088 dump_omp_clauses (pp
, OMP_FOR_CLAUSES (node
), spc
, flags
);
3090 if (OMP_FOR_BODY (node
))
3092 newline_and_indent (pp
, spc
+ 2);
3094 newline_and_indent (pp
, spc
+ 4);
3095 dump_generic_node (pp
, OMP_FOR_BODY (node
), spc
+ 4, flags
,
3097 newline_and_indent (pp
, spc
+ 2);
3098 pp_right_brace (pp
);
3100 if (OMP_FOR_INIT (node
))
3101 spc
-= 2 * TREE_VEC_LENGTH (OMP_FOR_INIT (node
)) - 2;
3102 if (OMP_FOR_PRE_BODY (node
))
3105 newline_and_indent (pp
, spc
+ 2);
3106 pp_right_brace (pp
);
3113 pp_string (pp
, "#pragma omp sections");
3114 dump_omp_clauses (pp
, OMP_SECTIONS_CLAUSES (node
), spc
, flags
);
3118 pp_string (pp
, "#pragma omp section");
3122 pp_string (pp
, "#pragma omp master");
3126 pp_string (pp
, "#pragma omp taskgroup");
3130 pp_string (pp
, "#pragma omp ordered");
3131 dump_omp_clauses (pp
, OMP_ORDERED_CLAUSES (node
), spc
, flags
);
3135 pp_string (pp
, "#pragma omp critical");
3136 if (OMP_CRITICAL_NAME (node
))
3140 dump_generic_node (pp
, OMP_CRITICAL_NAME (node
), spc
,
3142 pp_right_paren (pp
);
3144 dump_omp_clauses (pp
, OMP_CRITICAL_CLAUSES (node
), spc
, flags
);
3148 pp_string (pp
, "#pragma omp atomic");
3149 if (OMP_ATOMIC_SEQ_CST (node
))
3150 pp_string (pp
, " seq_cst");
3151 newline_and_indent (pp
, spc
+ 2);
3152 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3156 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3159 case OMP_ATOMIC_READ
:
3160 pp_string (pp
, "#pragma omp atomic read");
3161 if (OMP_ATOMIC_SEQ_CST (node
))
3162 pp_string (pp
, " seq_cst");
3163 newline_and_indent (pp
, spc
+ 2);
3164 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3168 case OMP_ATOMIC_CAPTURE_OLD
:
3169 case OMP_ATOMIC_CAPTURE_NEW
:
3170 pp_string (pp
, "#pragma omp atomic capture");
3171 if (OMP_ATOMIC_SEQ_CST (node
))
3172 pp_string (pp
, " seq_cst");
3173 newline_and_indent (pp
, spc
+ 2);
3174 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3178 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3182 pp_string (pp
, "#pragma omp single");
3183 dump_omp_clauses (pp
, OMP_SINGLE_CLAUSES (node
), spc
, flags
);
3187 dump_omp_clause (pp
, node
, spc
, flags
);
3191 case TRANSACTION_EXPR
:
3192 if (TRANSACTION_EXPR_OUTER (node
))
3193 pp_string (pp
, "__transaction_atomic [[outer]]");
3194 else if (TRANSACTION_EXPR_RELAXED (node
))
3195 pp_string (pp
, "__transaction_relaxed");
3197 pp_string (pp
, "__transaction_atomic");
3198 if (!(flags
& TDF_SLIM
) && TRANSACTION_EXPR_BODY (node
))
3200 newline_and_indent (pp
, spc
);
3202 newline_and_indent (pp
, spc
+ 2);
3203 dump_generic_node (pp
, TRANSACTION_EXPR_BODY (node
),
3204 spc
+ 2, flags
, false);
3205 newline_and_indent (pp
, spc
);
3206 pp_right_brace (pp
);
3211 case REDUC_MAX_EXPR
:
3212 pp_string (pp
, " REDUC_MAX_EXPR < ");
3213 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3214 pp_string (pp
, " > ");
3217 case REDUC_MIN_EXPR
:
3218 pp_string (pp
, " REDUC_MIN_EXPR < ");
3219 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3220 pp_string (pp
, " > ");
3223 case REDUC_PLUS_EXPR
:
3224 pp_string (pp
, " REDUC_PLUS_EXPR < ");
3225 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3226 pp_string (pp
, " > ");
3229 case VEC_WIDEN_MULT_HI_EXPR
:
3230 case VEC_WIDEN_MULT_LO_EXPR
:
3231 case VEC_WIDEN_MULT_EVEN_EXPR
:
3232 case VEC_WIDEN_MULT_ODD_EXPR
:
3233 case VEC_WIDEN_LSHIFT_HI_EXPR
:
3234 case VEC_WIDEN_LSHIFT_LO_EXPR
:
3236 for (str
= get_tree_code_name (code
); *str
; str
++)
3237 pp_character (pp
, TOUPPER (*str
));
3238 pp_string (pp
, " < ");
3239 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3240 pp_string (pp
, ", ");
3241 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3242 pp_string (pp
, " > ");
3245 case VEC_UNPACK_HI_EXPR
:
3246 pp_string (pp
, " VEC_UNPACK_HI_EXPR < ");
3247 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3248 pp_string (pp
, " > ");
3251 case VEC_UNPACK_LO_EXPR
:
3252 pp_string (pp
, " VEC_UNPACK_LO_EXPR < ");
3253 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3254 pp_string (pp
, " > ");
3257 case VEC_UNPACK_FLOAT_HI_EXPR
:
3258 pp_string (pp
, " VEC_UNPACK_FLOAT_HI_EXPR < ");
3259 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3260 pp_string (pp
, " > ");
3263 case VEC_UNPACK_FLOAT_LO_EXPR
:
3264 pp_string (pp
, " VEC_UNPACK_FLOAT_LO_EXPR < ");
3265 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3266 pp_string (pp
, " > ");
3269 case VEC_PACK_TRUNC_EXPR
:
3270 pp_string (pp
, " VEC_PACK_TRUNC_EXPR < ");
3271 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3272 pp_string (pp
, ", ");
3273 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3274 pp_string (pp
, " > ");
3277 case VEC_PACK_SAT_EXPR
:
3278 pp_string (pp
, " VEC_PACK_SAT_EXPR < ");
3279 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3280 pp_string (pp
, ", ");
3281 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3282 pp_string (pp
, " > ");
3285 case VEC_PACK_FIX_TRUNC_EXPR
:
3286 pp_string (pp
, " VEC_PACK_FIX_TRUNC_EXPR < ");
3287 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3288 pp_string (pp
, ", ");
3289 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3290 pp_string (pp
, " > ");
3294 dump_block_node (pp
, node
, spc
, flags
);
3297 case CILK_SPAWN_STMT
:
3298 pp_string (pp
, "_Cilk_spawn ");
3299 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3302 case CILK_SYNC_STMT
:
3303 pp_string (pp
, "_Cilk_sync");
3310 if (is_stmt
&& is_expr
)
3316 /* Print the declaration of a variable. */
3319 print_declaration (pretty_printer
*pp
, tree t
, int spc
, dump_flags_t flags
)
3323 if (TREE_CODE(t
) == NAMELIST_DECL
)
3325 pp_string(pp
, "namelist ");
3326 dump_decl_name (pp
, t
, flags
);
3331 if (TREE_CODE (t
) == TYPE_DECL
)
3332 pp_string (pp
, "typedef ");
3334 if (CODE_CONTAINS_STRUCT (TREE_CODE (t
), TS_DECL_WRTL
) && DECL_REGISTER (t
))
3335 pp_string (pp
, "register ");
3337 if (TREE_PUBLIC (t
) && DECL_EXTERNAL (t
))
3338 pp_string (pp
, "extern ");
3339 else if (TREE_STATIC (t
))
3340 pp_string (pp
, "static ");
3342 /* Print the type and name. */
3343 if (TREE_TYPE (t
) && TREE_CODE (TREE_TYPE (t
)) == ARRAY_TYPE
)
3347 /* Print array's type. */
3348 tmp
= TREE_TYPE (t
);
3349 while (TREE_CODE (TREE_TYPE (tmp
)) == ARRAY_TYPE
)
3350 tmp
= TREE_TYPE (tmp
);
3351 dump_generic_node (pp
, TREE_TYPE (tmp
), spc
, flags
, false);
3353 /* Print variable's name. */
3355 dump_generic_node (pp
, t
, spc
, flags
, false);
3357 /* Print the dimensions. */
3358 tmp
= TREE_TYPE (t
);
3359 while (TREE_CODE (tmp
) == ARRAY_TYPE
)
3361 dump_array_domain (pp
, TYPE_DOMAIN (tmp
), spc
, flags
);
3362 tmp
= TREE_TYPE (tmp
);
3365 else if (TREE_CODE (t
) == FUNCTION_DECL
)
3367 dump_generic_node (pp
, TREE_TYPE (TREE_TYPE (t
)), spc
, flags
, false);
3369 dump_decl_name (pp
, t
, flags
);
3370 dump_function_declaration (pp
, TREE_TYPE (t
), spc
, flags
);
3374 /* Print type declaration. */
3375 dump_generic_node (pp
, TREE_TYPE (t
), spc
, flags
, false);
3377 /* Print variable's name. */
3379 dump_generic_node (pp
, t
, spc
, flags
, false);
3382 if (VAR_P (t
) && DECL_HARD_REGISTER (t
))
3384 pp_string (pp
, " __asm__ ");
3386 dump_generic_node (pp
, DECL_ASSEMBLER_NAME (t
), spc
, flags
, false);
3387 pp_right_paren (pp
);
3390 /* The initial value of a function serves to determine whether the function
3391 is declared or defined. So the following does not apply to function
3393 if (TREE_CODE (t
) != FUNCTION_DECL
)
3395 /* Print the initial value. */
3396 if (DECL_INITIAL (t
))
3401 dump_generic_node (pp
, DECL_INITIAL (t
), spc
, flags
, false);
3405 if (VAR_P (t
) && DECL_HAS_VALUE_EXPR_P (t
))
3407 pp_string (pp
, " [value-expr: ");
3408 dump_generic_node (pp
, DECL_VALUE_EXPR (t
), spc
, flags
, false);
3409 pp_right_bracket (pp
);
3416 /* Prints a structure: name, fields, and methods.
3417 FIXME: Still incomplete. */
3420 print_struct_decl (pretty_printer
*pp
, const_tree node
, int spc
,
3423 /* Print the name of the structure. */
3424 if (TYPE_NAME (node
))
3427 if (TREE_CODE (node
) == RECORD_TYPE
)
3428 pp_string (pp
, "struct ");
3429 else if ((TREE_CODE (node
) == UNION_TYPE
3430 || TREE_CODE (node
) == QUAL_UNION_TYPE
))
3431 pp_string (pp
, "union ");
3433 dump_generic_node (pp
, TYPE_NAME (node
), spc
, 0, false);
3436 /* Print the contents of the structure. */
3442 /* Print the fields of the structure. */
3445 tmp
= TYPE_FIELDS (node
);
3448 /* Avoid to print recursively the structure. */
3449 /* FIXME : Not implemented correctly...,
3450 what about the case when we have a cycle in the contain graph? ...
3451 Maybe this could be solved by looking at the scope in which the
3452 structure was declared. */
3453 if (TREE_TYPE (tmp
) != node
3454 && (TREE_CODE (TREE_TYPE (tmp
)) != POINTER_TYPE
3455 || TREE_TYPE (TREE_TYPE (tmp
)) != node
))
3457 print_declaration (pp
, tmp
, spc
+2, flags
);
3460 tmp
= DECL_CHAIN (tmp
);
3464 pp_right_brace (pp
);
3467 /* Return the priority of the operator CODE.
3469 From lowest to highest precedence with either left-to-right (L-R)
3470 or right-to-left (R-L) associativity]:
3473 2 [R-L] = += -= *= /= %= &= ^= |= <<= >>=
3485 14 [R-L] ! ~ ++ -- + - * & (type) sizeof
3486 15 [L-R] fn() [] -> .
3488 unary +, - and * have higher precedence than the corresponding binary
3492 op_code_prio (enum tree_code code
)
3509 case TRUTH_ORIF_EXPR
:
3512 case TRUTH_AND_EXPR
:
3513 case TRUTH_ANDIF_EXPR
:
3520 case TRUTH_XOR_EXPR
:
3537 case UNORDERED_EXPR
:
3548 case VEC_WIDEN_LSHIFT_HI_EXPR
:
3549 case VEC_WIDEN_LSHIFT_LO_EXPR
:
3550 case WIDEN_LSHIFT_EXPR
:
3553 case WIDEN_SUM_EXPR
:
3555 case POINTER_PLUS_EXPR
:
3559 case VEC_WIDEN_MULT_HI_EXPR
:
3560 case VEC_WIDEN_MULT_LO_EXPR
:
3561 case WIDEN_MULT_EXPR
:
3563 case WIDEN_MULT_PLUS_EXPR
:
3564 case WIDEN_MULT_MINUS_EXPR
:
3566 case MULT_HIGHPART_EXPR
:
3567 case TRUNC_DIV_EXPR
:
3569 case FLOOR_DIV_EXPR
:
3570 case ROUND_DIV_EXPR
:
3572 case EXACT_DIV_EXPR
:
3573 case TRUNC_MOD_EXPR
:
3575 case FLOOR_MOD_EXPR
:
3576 case ROUND_MOD_EXPR
:
3580 case TRUTH_NOT_EXPR
:
3582 case POSTINCREMENT_EXPR
:
3583 case POSTDECREMENT_EXPR
:
3584 case PREINCREMENT_EXPR
:
3585 case PREDECREMENT_EXPR
:
3591 case FIX_TRUNC_EXPR
:
3597 case ARRAY_RANGE_REF
:
3601 /* Special expressions. */
3607 case REDUC_MAX_EXPR
:
3608 case REDUC_MIN_EXPR
:
3609 case REDUC_PLUS_EXPR
:
3610 case VEC_UNPACK_HI_EXPR
:
3611 case VEC_UNPACK_LO_EXPR
:
3612 case VEC_UNPACK_FLOAT_HI_EXPR
:
3613 case VEC_UNPACK_FLOAT_LO_EXPR
:
3614 case VEC_PACK_TRUNC_EXPR
:
3615 case VEC_PACK_SAT_EXPR
:
3619 /* Return an arbitrarily high precedence to avoid surrounding single
3620 VAR_DECLs in ()s. */
3625 /* Return the priority of the operator OP. */
3628 op_prio (const_tree op
)
3630 enum tree_code code
;
3635 code
= TREE_CODE (op
);
3636 if (code
== SAVE_EXPR
|| code
== NON_LVALUE_EXPR
)
3637 return op_prio (TREE_OPERAND (op
, 0));
3639 return op_code_prio (code
);
3642 /* Return the symbol associated with operator CODE. */
3645 op_symbol_code (enum tree_code code
)
3653 case TRUTH_ORIF_EXPR
:
3656 case TRUTH_AND_EXPR
:
3657 case TRUTH_ANDIF_EXPR
:
3663 case TRUTH_XOR_EXPR
:
3673 case UNORDERED_EXPR
:
3719 case WIDEN_LSHIFT_EXPR
:
3722 case POINTER_PLUS_EXPR
:
3728 case REDUC_PLUS_EXPR
:
3731 case WIDEN_SUM_EXPR
:
3734 case WIDEN_MULT_EXPR
:
3737 case MULT_HIGHPART_EXPR
:
3747 case TRUTH_NOT_EXPR
:
3754 case TRUNC_DIV_EXPR
:
3761 case FLOOR_DIV_EXPR
:
3764 case ROUND_DIV_EXPR
:
3767 case EXACT_DIV_EXPR
:
3770 case TRUNC_MOD_EXPR
:
3776 case FLOOR_MOD_EXPR
:
3779 case ROUND_MOD_EXPR
:
3782 case PREDECREMENT_EXPR
:
3785 case PREINCREMENT_EXPR
:
3788 case POSTDECREMENT_EXPR
:
3791 case POSTINCREMENT_EXPR
:
3801 return "<<< ??? >>>";
3805 /* Return the symbol associated with operator OP. */
3808 op_symbol (const_tree op
)
3810 return op_symbol_code (TREE_CODE (op
));
3813 /* Prints the name of a call. NODE is the CALL_EXPR_FN of a CALL_EXPR or
3814 the gimple_call_fn of a GIMPLE_CALL. */
3817 print_call_name (pretty_printer
*pp
, tree node
, dump_flags_t flags
)
3821 if (TREE_CODE (op0
) == NON_LVALUE_EXPR
)
3822 op0
= TREE_OPERAND (op0
, 0);
3825 switch (TREE_CODE (op0
))
3830 dump_function_name (pp
, op0
, flags
);
3836 op0
= TREE_OPERAND (op0
, 0);
3841 dump_generic_node (pp
, TREE_OPERAND (op0
, 0), 0, flags
, false);
3842 pp_string (pp
, ") ? ");
3843 dump_generic_node (pp
, TREE_OPERAND (op0
, 1), 0, flags
, false);
3844 pp_string (pp
, " : ");
3845 dump_generic_node (pp
, TREE_OPERAND (op0
, 2), 0, flags
, false);
3849 if (TREE_CODE (TREE_OPERAND (op0
, 0)) == VAR_DECL
)
3850 dump_function_name (pp
, TREE_OPERAND (op0
, 0), flags
);
3852 dump_generic_node (pp
, op0
, 0, flags
, false);
3856 if (integer_zerop (TREE_OPERAND (op0
, 1)))
3858 op0
= TREE_OPERAND (op0
, 0);
3865 dump_generic_node (pp
, op0
, 0, flags
, false);
3873 /* Parses the string STR and replaces new-lines by '\n', tabs by '\t', ... */
3876 pretty_print_string (pretty_printer
*pp
, const char *str
)
3886 pp_string (pp
, "\\b");
3890 pp_string (pp
, "\\f");
3894 pp_string (pp
, "\\n");
3898 pp_string (pp
, "\\r");
3902 pp_string (pp
, "\\t");
3906 pp_string (pp
, "\\v");
3910 pp_string (pp
, "\\\\");
3914 pp_string (pp
, "\\\"");
3918 pp_string (pp
, "\\'");
3921 /* No need to handle \0; the loop terminates on \0. */
3924 pp_string (pp
, "\\1");
3928 pp_string (pp
, "\\2");
3932 pp_string (pp
, "\\3");
3936 pp_string (pp
, "\\4");
3940 pp_string (pp
, "\\5");
3944 pp_string (pp
, "\\6");
3948 pp_string (pp
, "\\7");
3952 if (!ISPRINT (str
[0]))
3955 sprintf (buf
, "\\x%x", (unsigned char)str
[0]);
3956 pp_string (pp
, buf
);
3959 pp_character (pp
, str
[0]);
3967 maybe_init_pretty_print (FILE *file
)
3971 tree_pp
= new pretty_printer ();
3972 pp_needs_newline (tree_pp
) = true;
3973 pp_translate_identifiers (tree_pp
) = false;
3976 tree_pp
->buffer
->stream
= file
;
3980 newline_and_indent (pretty_printer
*pp
, int spc
)
3986 /* Handle a %K format for TEXT. Separate from default_tree_printer so
3987 it can also be used in front ends.
3988 %K: a statement, from which EXPR_LOCATION and TREE_BLOCK will be recorded.
3992 percent_K_format (text_info
*text
)
3994 tree t
= va_arg (*text
->args_ptr
, tree
), block
;
3995 text
->set_location (0, EXPR_LOCATION (t
), true);
3996 gcc_assert (pp_ti_abstract_origin (text
) != NULL
);
3997 block
= TREE_BLOCK (t
);
3998 *pp_ti_abstract_origin (text
) = NULL
;
4002 /* ??? LTO drops all BLOCK_ABSTRACT_ORIGINs apart from those
4003 representing the outermost block of an inlined function.
4004 So walk the BLOCK tree until we hit such a scope. */
4006 && TREE_CODE (block
) == BLOCK
)
4008 if (inlined_function_outer_scope_p (block
))
4010 *pp_ti_abstract_origin (text
) = block
;
4013 block
= BLOCK_SUPERCONTEXT (block
);
4019 && TREE_CODE (block
) == BLOCK
4020 && BLOCK_ABSTRACT_ORIGIN (block
))
4022 tree ao
= BLOCK_ABSTRACT_ORIGIN (block
);
4024 while (TREE_CODE (ao
) == BLOCK
4025 && BLOCK_ABSTRACT_ORIGIN (ao
)
4026 && BLOCK_ABSTRACT_ORIGIN (ao
) != ao
)
4027 ao
= BLOCK_ABSTRACT_ORIGIN (ao
);
4029 if (TREE_CODE (ao
) == FUNCTION_DECL
)
4031 *pp_ti_abstract_origin (text
) = block
;
4034 block
= BLOCK_SUPERCONTEXT (block
);
4038 /* Print the identifier ID to PRETTY-PRINTER. */
4041 pp_tree_identifier (pretty_printer
*pp
, tree id
)
4043 if (pp_translate_identifiers (pp
))
4045 const char *text
= identifier_to_locale (IDENTIFIER_POINTER (id
));
4046 pp_append_text (pp
, text
, text
+ strlen (text
));
4049 pp_append_text (pp
, IDENTIFIER_POINTER (id
),
4050 IDENTIFIER_POINTER (id
) + IDENTIFIER_LENGTH (id
));
4053 /* A helper function that is used to dump function information before the
4057 dump_function_header (FILE *dump_file
, tree fdecl
, dump_flags_t flags
)
4059 const char *dname
, *aname
;
4060 struct cgraph_node
*node
= cgraph_node::get (fdecl
);
4061 struct function
*fun
= DECL_STRUCT_FUNCTION (fdecl
);
4063 dname
= lang_hooks
.decl_printable_name (fdecl
, 2);
4065 if (DECL_ASSEMBLER_NAME_SET_P (fdecl
))
4066 aname
= (IDENTIFIER_POINTER
4067 (DECL_ASSEMBLER_NAME (fdecl
)));
4069 aname
= "<unset-asm-name>";
4071 fprintf (dump_file
, "\n;; Function %s (%s, funcdef_no=%d",
4072 dname
, aname
, fun
->funcdef_no
);
4073 if (!(flags
& TDF_NOUID
))
4074 fprintf (dump_file
, ", decl_uid=%d", DECL_UID (fdecl
));
4077 fprintf (dump_file
, ", cgraph_uid=%d", node
->uid
);
4078 fprintf (dump_file
, ", symbol_order=%d)%s\n\n", node
->order
,
4079 node
->frequency
== NODE_FREQUENCY_HOT
4081 : node
->frequency
== NODE_FREQUENCY_UNLIKELY_EXECUTED
4082 ? " (unlikely executed)"
4083 : node
->frequency
== NODE_FREQUENCY_EXECUTED_ONCE
4084 ? " (executed once)"
4088 fprintf (dump_file
, ")\n\n");
4091 /* Dump double_int D to pretty_printer PP. UNS is true
4092 if D is unsigned and false otherwise. */
4094 pp_double_int (pretty_printer
*pp
, double_int d
, bool uns
)
4097 pp_wide_integer (pp
, d
.low
);
4098 else if (d
.fits_uhwi ())
4099 pp_unsigned_wide_integer (pp
, d
.low
);
4102 unsigned HOST_WIDE_INT low
= d
.low
;
4103 HOST_WIDE_INT high
= d
.high
;
4104 if (!uns
&& d
.is_negative ())
4107 high
= ~high
+ !low
;
4110 /* Would "%x%0*x" or "%x%*0x" get zero-padding on all
4112 sprintf (pp_buffer (pp
)->digit_buffer
,
4113 HOST_WIDE_INT_PRINT_DOUBLE_HEX
,
4114 (unsigned HOST_WIDE_INT
) high
, low
);
4115 pp_string (pp
, pp_buffer (pp
)->digit_buffer
);