1 /* Pretty formatting of GENERIC trees in C syntax.
2 Copyright (C) 2001-2018 Free Software Foundation, Inc.
3 Adapted from c-pretty-print.c by Diego Novillo <dnovillo@redhat.com>
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 3, or (at your option) any later
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
23 #include "coretypes.h"
29 #include "tree-pretty-print.h"
30 #include "stor-layout.h"
31 #include "langhooks.h"
32 #include "tree-iterator.h"
34 #include "internal-fn.h"
35 #include "gomp-constants.h"
38 /* Local functions, macros and variables. */
39 static const char *op_symbol (const_tree
);
40 static void pretty_print_string (pretty_printer
*, const char*);
41 static void newline_and_indent (pretty_printer
*, int);
42 static void maybe_init_pretty_print (FILE *);
43 static void print_struct_decl (pretty_printer
*, const_tree
, int, dump_flags_t
);
44 static void do_niy (pretty_printer
*, const_tree
, dump_flags_t
);
46 #define INDENT(SPACE) do { \
47 int i; for (i = 0; i<SPACE; i++) pp_space (pp); } while (0)
49 #define NIY do_niy (pp, node, flags)
51 static pretty_printer
*tree_pp
;
53 /* Try to print something for an unknown tree code. */
56 do_niy (pretty_printer
*pp
, const_tree node
, dump_flags_t flags
)
60 pp_string (pp
, "<<< Unknown tree: ");
61 pp_string (pp
, get_tree_code_name (TREE_CODE (node
)));
65 len
= TREE_OPERAND_LENGTH (node
);
66 for (i
= 0; i
< len
; ++i
)
68 newline_and_indent (pp
, 2);
69 dump_generic_node (pp
, TREE_OPERAND (node
, i
), 2, flags
, false);
73 pp_string (pp
, " >>>");
76 /* Debugging function to print out a generic expression. */
79 debug_generic_expr (tree t
)
81 print_generic_expr (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
);
82 fprintf (stderr
, "\n");
85 /* Debugging function to print out a generic statement. */
88 debug_generic_stmt (tree t
)
90 print_generic_stmt (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
);
91 fprintf (stderr
, "\n");
94 /* Debugging function to print out a chain of trees . */
97 debug_tree_chain (tree t
)
103 print_generic_expr (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
|TDF_UID
);
104 fprintf (stderr
, " ");
108 fprintf (stderr
, "... [cycled back to ");
109 print_generic_expr (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
|TDF_UID
);
110 fprintf (stderr
, "]");
114 fprintf (stderr
, "\n");
117 /* Prints declaration DECL to the FILE with details specified by FLAGS. */
119 print_generic_decl (FILE *file
, tree decl
, dump_flags_t flags
)
121 maybe_init_pretty_print (file
);
122 print_declaration (tree_pp
, decl
, 2, flags
);
123 pp_write_text_to_stream (tree_pp
);
126 /* Print tree T, and its successors, on file FILE. FLAGS specifies details
127 to show in the dump. See TDF_* in dumpfile.h. */
130 print_generic_stmt (FILE *file
, tree t
, dump_flags_t flags
)
132 maybe_init_pretty_print (file
);
133 dump_generic_node (tree_pp
, t
, 0, flags
, true);
134 pp_newline_and_flush (tree_pp
);
137 /* Print tree T, and its successors, on file FILE. FLAGS specifies details
138 to show in the dump. See TDF_* in dumpfile.h. The output is indented by
142 print_generic_stmt_indented (FILE *file
, tree t
, dump_flags_t flags
, int indent
)
146 maybe_init_pretty_print (file
);
148 for (i
= 0; i
< indent
; i
++)
150 dump_generic_node (tree_pp
, t
, indent
, flags
, true);
151 pp_newline_and_flush (tree_pp
);
154 /* Print a single expression T on file FILE. FLAGS specifies details to show
155 in the dump. See TDF_* in dumpfile.h. */
158 print_generic_expr (FILE *file
, tree t
, dump_flags_t flags
)
160 maybe_init_pretty_print (file
);
161 dump_generic_node (tree_pp
, t
, 0, flags
, false);
165 /* Dump NAME, an IDENTIFIER_POINTER, sanitized so that D<num> sequences
166 in it are replaced with Dxxxx, as long as they are at the start or
167 preceded by $ and at the end or followed by $. See make_fancy_name
171 dump_fancy_name (pretty_printer
*pp
, tree name
)
174 int length
= IDENTIFIER_LENGTH (name
);
175 const char *n
= IDENTIFIER_POINTER (name
);
182 && (n
== IDENTIFIER_POINTER (name
) || n
[-1] == '$'))
185 while (ISDIGIT (n
[l
]))
187 if (n
[l
] == '\0' || n
[l
] == '$')
200 pp_tree_identifier (pp
, name
);
204 char *str
= XNEWVEC (char, length
+ 1);
207 q
= n
= IDENTIFIER_POINTER (name
);
214 && (q
== IDENTIFIER_POINTER (name
) || q
[-1] == '$'))
217 while (ISDIGIT (q
[l
]))
219 if (q
[l
] == '\0' || q
[l
] == '$')
221 memcpy (p
, n
, q
- n
);
222 memcpy (p
+ (q
- n
), "Dxxxx", 5);
232 memcpy (p
, n
, IDENTIFIER_LENGTH (name
) - (n
- IDENTIFIER_POINTER (name
)));
234 if (pp_translate_identifiers (pp
))
236 const char *text
= identifier_to_locale (str
);
237 pp_append_text (pp
, text
, text
+ strlen (text
));
240 pp_append_text (pp
, str
, str
+ length
);
244 /* Dump the name of a _DECL node and its DECL_UID if TDF_UID is set
248 dump_decl_name (pretty_printer
*pp
, tree node
, dump_flags_t flags
)
250 if (DECL_NAME (node
))
252 if ((flags
& TDF_ASMNAME
)
253 && HAS_DECL_ASSEMBLER_NAME_P (node
)
254 && DECL_ASSEMBLER_NAME_SET_P (node
))
255 pp_tree_identifier (pp
, DECL_ASSEMBLER_NAME_RAW (node
));
256 /* For DECL_NAMELESS names look for embedded uids in the
257 names and sanitize them for TDF_NOUID. */
258 else if ((flags
& TDF_NOUID
) && DECL_NAMELESS (node
))
259 dump_fancy_name (pp
, DECL_NAME (node
));
261 pp_tree_identifier (pp
, DECL_NAME (node
));
263 char uid_sep
= (flags
& TDF_GIMPLE
) ? '_' : '.';
264 if ((flags
& TDF_UID
) || DECL_NAME (node
) == NULL_TREE
)
266 if (TREE_CODE (node
) == LABEL_DECL
&& LABEL_DECL_UID (node
) != -1)
267 pp_printf (pp
, "L%c%d", uid_sep
, (int) LABEL_DECL_UID (node
));
268 else if (TREE_CODE (node
) == DEBUG_EXPR_DECL
)
270 if (flags
& TDF_NOUID
)
271 pp_string (pp
, "D#xxxx");
273 pp_printf (pp
, "D#%i", DEBUG_TEMP_UID (node
));
277 char c
= TREE_CODE (node
) == CONST_DECL
? 'C' : 'D';
278 if (flags
& TDF_NOUID
)
279 pp_printf (pp
, "%c.xxxx", c
);
281 pp_printf (pp
, "%c%c%u", c
, uid_sep
, DECL_UID (node
));
284 if ((flags
& TDF_ALIAS
) && DECL_PT_UID (node
) != DECL_UID (node
))
286 if (flags
& TDF_NOUID
)
287 pp_printf (pp
, "ptD.xxxx");
289 pp_printf (pp
, "ptD.%u", DECL_PT_UID (node
));
293 /* Like the above, but used for pretty printing function calls. */
296 dump_function_name (pretty_printer
*pp
, tree node
, dump_flags_t flags
)
298 if (CONVERT_EXPR_P (node
))
299 node
= TREE_OPERAND (node
, 0);
300 if (DECL_NAME (node
) && (flags
& TDF_ASMNAME
) == 0)
301 pp_string (pp
, lang_hooks
.decl_printable_name (node
, 1));
303 dump_decl_name (pp
, node
, flags
);
306 /* Dump a function declaration. NODE is the FUNCTION_TYPE. PP, SPC and
307 FLAGS are as in dump_generic_node. */
310 dump_function_declaration (pretty_printer
*pp
, tree node
,
311 int spc
, dump_flags_t flags
)
313 bool wrote_arg
= false;
319 /* Print the argument types. */
320 arg
= TYPE_ARG_TYPES (node
);
321 while (arg
&& arg
!= void_list_node
&& arg
!= error_mark_node
)
329 dump_generic_node (pp
, TREE_VALUE (arg
), spc
, flags
, false);
330 arg
= TREE_CHAIN (arg
);
333 /* Drop the trailing void_type_node if we had any previous argument. */
334 if (arg
== void_list_node
&& !wrote_arg
)
335 pp_string (pp
, "void");
336 /* Properly dump vararg function types. */
337 else if (!arg
&& wrote_arg
)
338 pp_string (pp
, ", ...");
339 /* Avoid printing any arg for unprototyped functions. */
344 /* Dump the domain associated with an array. */
347 dump_array_domain (pretty_printer
*pp
, tree domain
, int spc
, dump_flags_t flags
)
349 pp_left_bracket (pp
);
352 tree min
= TYPE_MIN_VALUE (domain
);
353 tree max
= TYPE_MAX_VALUE (domain
);
356 && integer_zerop (min
)
357 && tree_fits_shwi_p (max
))
358 pp_wide_integer (pp
, tree_to_shwi (max
) + 1);
362 dump_generic_node (pp
, min
, spc
, flags
, false);
365 dump_generic_node (pp
, max
, spc
, flags
, false);
369 pp_string (pp
, "<unknown>");
370 pp_right_bracket (pp
);
374 /* Dump OpenMP clause CLAUSE. PP, CLAUSE, SPC and FLAGS are as in
375 dump_generic_node. */
378 dump_omp_clause (pretty_printer
*pp
, tree clause
, int spc
, dump_flags_t flags
)
382 switch (OMP_CLAUSE_CODE (clause
))
384 case OMP_CLAUSE_PRIVATE
:
387 case OMP_CLAUSE_SHARED
:
390 case OMP_CLAUSE_FIRSTPRIVATE
:
391 name
= "firstprivate";
393 case OMP_CLAUSE_LASTPRIVATE
:
394 name
= "lastprivate";
396 case OMP_CLAUSE_COPYIN
:
399 case OMP_CLAUSE_COPYPRIVATE
:
400 name
= "copyprivate";
402 case OMP_CLAUSE_UNIFORM
:
405 case OMP_CLAUSE_USE_DEVICE_PTR
:
406 name
= "use_device_ptr";
408 case OMP_CLAUSE_IS_DEVICE_PTR
:
409 name
= "is_device_ptr";
411 case OMP_CLAUSE__LOOPTEMP_
:
414 case OMP_CLAUSE_TO_DECLARE
:
417 case OMP_CLAUSE_LINK
:
421 pp_string (pp
, name
);
423 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
428 case OMP_CLAUSE_REDUCTION
:
429 pp_string (pp
, "reduction(");
430 if (OMP_CLAUSE_REDUCTION_CODE (clause
) != ERROR_MARK
)
433 op_symbol_code (OMP_CLAUSE_REDUCTION_CODE (clause
)));
436 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
442 pp_string (pp
, "if(");
443 switch (OMP_CLAUSE_IF_MODIFIER (clause
))
445 case ERROR_MARK
: break;
446 case OMP_PARALLEL
: pp_string (pp
, "parallel:"); break;
447 case OMP_TASK
: pp_string (pp
, "task:"); break;
448 case OMP_TASKLOOP
: pp_string (pp
, "taskloop:"); break;
449 case OMP_TARGET_DATA
: pp_string (pp
, "target data:"); break;
450 case OMP_TARGET
: pp_string (pp
, "target:"); break;
451 case OMP_TARGET_UPDATE
: pp_string (pp
, "target update:"); break;
452 case OMP_TARGET_ENTER_DATA
:
453 pp_string (pp
, "target enter data:"); break;
454 case OMP_TARGET_EXIT_DATA
: pp_string (pp
, "target exit data:"); break;
455 default: gcc_unreachable ();
457 dump_generic_node (pp
, OMP_CLAUSE_IF_EXPR (clause
),
462 case OMP_CLAUSE_NUM_THREADS
:
463 pp_string (pp
, "num_threads(");
464 dump_generic_node (pp
, OMP_CLAUSE_NUM_THREADS_EXPR (clause
),
469 case OMP_CLAUSE_NOWAIT
:
470 pp_string (pp
, "nowait");
472 case OMP_CLAUSE_ORDERED
:
473 pp_string (pp
, "ordered");
474 if (OMP_CLAUSE_ORDERED_EXPR (clause
))
477 dump_generic_node (pp
, OMP_CLAUSE_ORDERED_EXPR (clause
),
483 case OMP_CLAUSE_DEFAULT
:
484 pp_string (pp
, "default(");
485 switch (OMP_CLAUSE_DEFAULT_KIND (clause
))
487 case OMP_CLAUSE_DEFAULT_UNSPECIFIED
:
489 case OMP_CLAUSE_DEFAULT_SHARED
:
490 pp_string (pp
, "shared");
492 case OMP_CLAUSE_DEFAULT_NONE
:
493 pp_string (pp
, "none");
495 case OMP_CLAUSE_DEFAULT_PRIVATE
:
496 pp_string (pp
, "private");
498 case OMP_CLAUSE_DEFAULT_FIRSTPRIVATE
:
499 pp_string (pp
, "firstprivate");
501 case OMP_CLAUSE_DEFAULT_PRESENT
:
502 pp_string (pp
, "present");
510 case OMP_CLAUSE_SCHEDULE
:
511 pp_string (pp
, "schedule(");
512 if (OMP_CLAUSE_SCHEDULE_KIND (clause
)
513 & (OMP_CLAUSE_SCHEDULE_MONOTONIC
514 | OMP_CLAUSE_SCHEDULE_NONMONOTONIC
))
516 if (OMP_CLAUSE_SCHEDULE_KIND (clause
)
517 & OMP_CLAUSE_SCHEDULE_MONOTONIC
)
518 pp_string (pp
, "monotonic");
520 pp_string (pp
, "nonmonotonic");
521 if (OMP_CLAUSE_SCHEDULE_SIMD (clause
))
526 if (OMP_CLAUSE_SCHEDULE_SIMD (clause
))
527 pp_string (pp
, "simd:");
529 switch (OMP_CLAUSE_SCHEDULE_KIND (clause
) & OMP_CLAUSE_SCHEDULE_MASK
)
531 case OMP_CLAUSE_SCHEDULE_STATIC
:
532 pp_string (pp
, "static");
534 case OMP_CLAUSE_SCHEDULE_DYNAMIC
:
535 pp_string (pp
, "dynamic");
537 case OMP_CLAUSE_SCHEDULE_GUIDED
:
538 pp_string (pp
, "guided");
540 case OMP_CLAUSE_SCHEDULE_RUNTIME
:
541 pp_string (pp
, "runtime");
543 case OMP_CLAUSE_SCHEDULE_AUTO
:
544 pp_string (pp
, "auto");
549 if (OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (clause
))
552 dump_generic_node (pp
, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (clause
),
558 case OMP_CLAUSE_UNTIED
:
559 pp_string (pp
, "untied");
562 case OMP_CLAUSE_COLLAPSE
:
563 pp_string (pp
, "collapse(");
564 dump_generic_node (pp
, OMP_CLAUSE_COLLAPSE_EXPR (clause
),
569 case OMP_CLAUSE_FINAL
:
570 pp_string (pp
, "final(");
571 dump_generic_node (pp
, OMP_CLAUSE_FINAL_EXPR (clause
),
576 case OMP_CLAUSE_MERGEABLE
:
577 pp_string (pp
, "mergeable");
580 case OMP_CLAUSE_LINEAR
:
581 pp_string (pp
, "linear(");
582 switch (OMP_CLAUSE_LINEAR_KIND (clause
))
584 case OMP_CLAUSE_LINEAR_DEFAULT
:
586 case OMP_CLAUSE_LINEAR_REF
:
587 pp_string (pp
, "ref(");
589 case OMP_CLAUSE_LINEAR_VAL
:
590 pp_string (pp
, "val(");
592 case OMP_CLAUSE_LINEAR_UVAL
:
593 pp_string (pp
, "uval(");
598 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
600 if (OMP_CLAUSE_LINEAR_KIND (clause
) != OMP_CLAUSE_LINEAR_DEFAULT
)
603 dump_generic_node (pp
, OMP_CLAUSE_LINEAR_STEP (clause
),
608 case OMP_CLAUSE_ALIGNED
:
609 pp_string (pp
, "aligned(");
610 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
612 if (OMP_CLAUSE_ALIGNED_ALIGNMENT (clause
))
615 dump_generic_node (pp
, OMP_CLAUSE_ALIGNED_ALIGNMENT (clause
),
621 case OMP_CLAUSE_DEPEND
:
622 pp_string (pp
, "depend(");
623 switch (OMP_CLAUSE_DEPEND_KIND (clause
))
625 case OMP_CLAUSE_DEPEND_IN
:
626 pp_string (pp
, "in");
628 case OMP_CLAUSE_DEPEND_OUT
:
629 pp_string (pp
, "out");
631 case OMP_CLAUSE_DEPEND_INOUT
:
632 pp_string (pp
, "inout");
634 case OMP_CLAUSE_DEPEND_SOURCE
:
635 pp_string (pp
, "source)");
637 case OMP_CLAUSE_DEPEND_SINK
:
638 pp_string (pp
, "sink:");
639 for (tree t
= OMP_CLAUSE_DECL (clause
); t
; t
= TREE_CHAIN (t
))
640 if (TREE_CODE (t
) == TREE_LIST
)
642 dump_generic_node (pp
, TREE_VALUE (t
), spc
, flags
, false);
643 if (TREE_PURPOSE (t
) != integer_zero_node
)
645 if (OMP_CLAUSE_DEPEND_SINK_NEGATIVE (t
))
649 dump_generic_node (pp
, TREE_PURPOSE (t
), spc
, flags
,
663 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
669 pp_string (pp
, "map(");
670 switch (OMP_CLAUSE_MAP_KIND (clause
))
673 case GOMP_MAP_POINTER
:
674 pp_string (pp
, "alloc");
677 case GOMP_MAP_TO_PSET
:
678 pp_string (pp
, "to");
681 pp_string (pp
, "from");
683 case GOMP_MAP_TOFROM
:
684 pp_string (pp
, "tofrom");
686 case GOMP_MAP_FORCE_ALLOC
:
687 pp_string (pp
, "force_alloc");
689 case GOMP_MAP_FORCE_TO
:
690 pp_string (pp
, "force_to");
692 case GOMP_MAP_FORCE_FROM
:
693 pp_string (pp
, "force_from");
695 case GOMP_MAP_FORCE_TOFROM
:
696 pp_string (pp
, "force_tofrom");
698 case GOMP_MAP_FORCE_PRESENT
:
699 pp_string (pp
, "force_present");
701 case GOMP_MAP_DELETE
:
702 pp_string (pp
, "delete");
704 case GOMP_MAP_FORCE_DEVICEPTR
:
705 pp_string (pp
, "force_deviceptr");
707 case GOMP_MAP_ALWAYS_TO
:
708 pp_string (pp
, "always,to");
710 case GOMP_MAP_ALWAYS_FROM
:
711 pp_string (pp
, "always,from");
713 case GOMP_MAP_ALWAYS_TOFROM
:
714 pp_string (pp
, "always,tofrom");
716 case GOMP_MAP_RELEASE
:
717 pp_string (pp
, "release");
719 case GOMP_MAP_FIRSTPRIVATE_POINTER
:
720 pp_string (pp
, "firstprivate");
722 case GOMP_MAP_FIRSTPRIVATE_REFERENCE
:
723 pp_string (pp
, "firstprivate ref");
725 case GOMP_MAP_STRUCT
:
726 pp_string (pp
, "struct");
728 case GOMP_MAP_ALWAYS_POINTER
:
729 pp_string (pp
, "always_pointer");
731 case GOMP_MAP_DEVICE_RESIDENT
:
732 pp_string (pp
, "device_resident");
735 pp_string (pp
, "link");
741 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
744 if (OMP_CLAUSE_SIZE (clause
))
746 switch (OMP_CLAUSE_CODE (clause
) == OMP_CLAUSE_MAP
747 ? OMP_CLAUSE_MAP_KIND (clause
) : GOMP_MAP_TO
)
749 case GOMP_MAP_POINTER
:
750 case GOMP_MAP_FIRSTPRIVATE_POINTER
:
751 case GOMP_MAP_FIRSTPRIVATE_REFERENCE
:
752 case GOMP_MAP_ALWAYS_POINTER
:
753 pp_string (pp
, " [pointer assign, bias: ");
755 case GOMP_MAP_TO_PSET
:
756 pp_string (pp
, " [pointer set, len: ");
759 pp_string (pp
, " [len: ");
762 dump_generic_node (pp
, OMP_CLAUSE_SIZE (clause
),
764 pp_right_bracket (pp
);
769 case OMP_CLAUSE_FROM
:
770 pp_string (pp
, "from(");
771 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
773 goto print_clause_size
;
776 pp_string (pp
, "to(");
777 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
779 goto print_clause_size
;
781 case OMP_CLAUSE__CACHE_
:
783 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
785 goto print_clause_size
;
787 case OMP_CLAUSE_NUM_TEAMS
:
788 pp_string (pp
, "num_teams(");
789 dump_generic_node (pp
, OMP_CLAUSE_NUM_TEAMS_EXPR (clause
),
794 case OMP_CLAUSE_THREAD_LIMIT
:
795 pp_string (pp
, "thread_limit(");
796 dump_generic_node (pp
, OMP_CLAUSE_THREAD_LIMIT_EXPR (clause
),
801 case OMP_CLAUSE_DEVICE
:
802 pp_string (pp
, "device(");
803 dump_generic_node (pp
, OMP_CLAUSE_DEVICE_ID (clause
),
808 case OMP_CLAUSE_DIST_SCHEDULE
:
809 pp_string (pp
, "dist_schedule(static");
810 if (OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR (clause
))
813 dump_generic_node (pp
,
814 OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR (clause
),
820 case OMP_CLAUSE_PROC_BIND
:
821 pp_string (pp
, "proc_bind(");
822 switch (OMP_CLAUSE_PROC_BIND_KIND (clause
))
824 case OMP_CLAUSE_PROC_BIND_MASTER
:
825 pp_string (pp
, "master");
827 case OMP_CLAUSE_PROC_BIND_CLOSE
:
828 pp_string (pp
, "close");
830 case OMP_CLAUSE_PROC_BIND_SPREAD
:
831 pp_string (pp
, "spread");
839 case OMP_CLAUSE_SAFELEN
:
840 pp_string (pp
, "safelen(");
841 dump_generic_node (pp
, OMP_CLAUSE_SAFELEN_EXPR (clause
),
846 case OMP_CLAUSE_SIMDLEN
:
847 pp_string (pp
, "simdlen(");
848 dump_generic_node (pp
, OMP_CLAUSE_SIMDLEN_EXPR (clause
),
853 case OMP_CLAUSE_PRIORITY
:
854 pp_string (pp
, "priority(");
855 dump_generic_node (pp
, OMP_CLAUSE_PRIORITY_EXPR (clause
),
860 case OMP_CLAUSE_GRAINSIZE
:
861 pp_string (pp
, "grainsize(");
862 dump_generic_node (pp
, OMP_CLAUSE_GRAINSIZE_EXPR (clause
),
867 case OMP_CLAUSE_NUM_TASKS
:
868 pp_string (pp
, "num_tasks(");
869 dump_generic_node (pp
, OMP_CLAUSE_NUM_TASKS_EXPR (clause
),
874 case OMP_CLAUSE_HINT
:
875 pp_string (pp
, "hint(");
876 dump_generic_node (pp
, OMP_CLAUSE_HINT_EXPR (clause
),
881 case OMP_CLAUSE_DEFAULTMAP
:
882 pp_string (pp
, "defaultmap(tofrom:scalar)");
885 case OMP_CLAUSE__SIMDUID_
:
886 pp_string (pp
, "_simduid_(");
887 dump_generic_node (pp
, OMP_CLAUSE__SIMDUID__DECL (clause
),
892 case OMP_CLAUSE__SIMT_
:
893 pp_string (pp
, "_simt_");
896 case OMP_CLAUSE_GANG
:
897 pp_string (pp
, "gang");
898 if (OMP_CLAUSE_GANG_EXPR (clause
) != NULL_TREE
)
900 pp_string (pp
, "(num: ");
901 dump_generic_node (pp
, OMP_CLAUSE_GANG_EXPR (clause
),
904 if (OMP_CLAUSE_GANG_STATIC_EXPR (clause
) != NULL_TREE
)
906 if (OMP_CLAUSE_GANG_EXPR (clause
) == NULL_TREE
)
910 pp_string (pp
, "static:");
911 if (OMP_CLAUSE_GANG_STATIC_EXPR (clause
)
912 == integer_minus_one_node
)
913 pp_character (pp
, '*');
915 dump_generic_node (pp
, OMP_CLAUSE_GANG_STATIC_EXPR (clause
),
918 if (OMP_CLAUSE_GANG_EXPR (clause
) != NULL_TREE
919 || OMP_CLAUSE_GANG_STATIC_EXPR (clause
) != NULL_TREE
)
923 case OMP_CLAUSE_ASYNC
:
924 pp_string (pp
, "async");
925 if (OMP_CLAUSE_ASYNC_EXPR (clause
))
927 pp_character(pp
, '(');
928 dump_generic_node (pp
, OMP_CLAUSE_ASYNC_EXPR (clause
),
930 pp_character(pp
, ')');
934 case OMP_CLAUSE_AUTO
:
936 pp_string (pp
, omp_clause_code_name
[OMP_CLAUSE_CODE (clause
)]);
939 case OMP_CLAUSE_WAIT
:
940 pp_string (pp
, "wait(");
941 dump_generic_node (pp
, OMP_CLAUSE_WAIT_EXPR (clause
),
943 pp_character(pp
, ')');
946 case OMP_CLAUSE_WORKER
:
947 pp_string (pp
, "worker");
948 if (OMP_CLAUSE_WORKER_EXPR (clause
) != NULL_TREE
)
951 dump_generic_node (pp
, OMP_CLAUSE_WORKER_EXPR (clause
),
957 case OMP_CLAUSE_VECTOR
:
958 pp_string (pp
, "vector");
959 if (OMP_CLAUSE_VECTOR_EXPR (clause
) != NULL_TREE
)
962 dump_generic_node (pp
, OMP_CLAUSE_VECTOR_EXPR (clause
),
968 case OMP_CLAUSE_NUM_GANGS
:
969 pp_string (pp
, "num_gangs(");
970 dump_generic_node (pp
, OMP_CLAUSE_NUM_GANGS_EXPR (clause
),
972 pp_character (pp
, ')');
975 case OMP_CLAUSE_NUM_WORKERS
:
976 pp_string (pp
, "num_workers(");
977 dump_generic_node (pp
, OMP_CLAUSE_NUM_WORKERS_EXPR (clause
),
979 pp_character (pp
, ')');
982 case OMP_CLAUSE_VECTOR_LENGTH
:
983 pp_string (pp
, "vector_length(");
984 dump_generic_node (pp
, OMP_CLAUSE_VECTOR_LENGTH_EXPR (clause
),
986 pp_character (pp
, ')');
989 case OMP_CLAUSE_INBRANCH
:
990 pp_string (pp
, "inbranch");
992 case OMP_CLAUSE_NOTINBRANCH
:
993 pp_string (pp
, "notinbranch");
996 pp_string (pp
, "for");
998 case OMP_CLAUSE_PARALLEL
:
999 pp_string (pp
, "parallel");
1001 case OMP_CLAUSE_SECTIONS
:
1002 pp_string (pp
, "sections");
1004 case OMP_CLAUSE_TASKGROUP
:
1005 pp_string (pp
, "taskgroup");
1007 case OMP_CLAUSE_NOGROUP
:
1008 pp_string (pp
, "nogroup");
1010 case OMP_CLAUSE_THREADS
:
1011 pp_string (pp
, "threads");
1013 case OMP_CLAUSE_SIMD
:
1014 pp_string (pp
, "simd");
1016 case OMP_CLAUSE_INDEPENDENT
:
1017 pp_string (pp
, "independent");
1019 case OMP_CLAUSE_TILE
:
1020 pp_string (pp
, "tile(");
1021 dump_generic_node (pp
, OMP_CLAUSE_TILE_LIST (clause
),
1023 pp_right_paren (pp
);
1026 case OMP_CLAUSE__GRIDDIM_
:
1027 pp_string (pp
, "_griddim_(");
1028 pp_unsigned_wide_integer (pp
, OMP_CLAUSE__GRIDDIM__DIMENSION (clause
));
1030 dump_generic_node (pp
, OMP_CLAUSE__GRIDDIM__SIZE (clause
), spc
, flags
,
1033 dump_generic_node (pp
, OMP_CLAUSE__GRIDDIM__GROUP (clause
), spc
, flags
,
1035 pp_right_paren (pp
);
1039 /* Should never happen. */
1040 dump_generic_node (pp
, clause
, spc
, flags
, false);
1046 /* Dump the list of OpenMP clauses. PP, SPC and FLAGS are as in
1047 dump_generic_node. */
1050 dump_omp_clauses (pretty_printer
*pp
, tree clause
, int spc
, dump_flags_t flags
)
1058 dump_omp_clause (pp
, clause
, spc
, flags
);
1059 clause
= OMP_CLAUSE_CHAIN (clause
);
1067 /* Dump location LOC to PP. */
1070 dump_location (pretty_printer
*pp
, location_t loc
)
1072 expanded_location xloc
= expand_location (loc
);
1074 pp_left_bracket (pp
);
1077 pp_string (pp
, xloc
.file
);
1078 pp_string (pp
, ":");
1080 pp_decimal_int (pp
, xloc
.line
);
1082 pp_decimal_int (pp
, xloc
.column
);
1083 pp_string (pp
, "] ");
1087 /* Dump lexical block BLOCK. PP, SPC and FLAGS are as in
1088 dump_generic_node. */
1091 dump_block_node (pretty_printer
*pp
, tree block
, int spc
, dump_flags_t flags
)
1095 pp_printf (pp
, "BLOCK #%d ", BLOCK_NUMBER (block
));
1097 if (flags
& TDF_ADDRESS
)
1098 pp_printf (pp
, "[%p] ", (void *) block
);
1100 if (BLOCK_ABSTRACT (block
))
1101 pp_string (pp
, "[abstract] ");
1103 if (TREE_ASM_WRITTEN (block
))
1104 pp_string (pp
, "[written] ");
1106 if (flags
& TDF_SLIM
)
1109 if (BLOCK_SOURCE_LOCATION (block
))
1110 dump_location (pp
, BLOCK_SOURCE_LOCATION (block
));
1112 newline_and_indent (pp
, spc
+ 2);
1114 if (BLOCK_SUPERCONTEXT (block
))
1116 pp_string (pp
, "SUPERCONTEXT: ");
1117 dump_generic_node (pp
, BLOCK_SUPERCONTEXT (block
), 0,
1118 flags
| TDF_SLIM
, false);
1119 newline_and_indent (pp
, spc
+ 2);
1122 if (BLOCK_SUBBLOCKS (block
))
1124 pp_string (pp
, "SUBBLOCKS: ");
1125 for (t
= BLOCK_SUBBLOCKS (block
); t
; t
= BLOCK_CHAIN (t
))
1127 dump_generic_node (pp
, t
, 0, flags
| TDF_SLIM
, false);
1130 newline_and_indent (pp
, spc
+ 2);
1133 if (BLOCK_CHAIN (block
))
1135 pp_string (pp
, "SIBLINGS: ");
1136 for (t
= BLOCK_CHAIN (block
); t
; t
= BLOCK_CHAIN (t
))
1138 dump_generic_node (pp
, t
, 0, flags
| TDF_SLIM
, false);
1141 newline_and_indent (pp
, spc
+ 2);
1144 if (BLOCK_VARS (block
))
1146 pp_string (pp
, "VARS: ");
1147 for (t
= BLOCK_VARS (block
); t
; t
= TREE_CHAIN (t
))
1149 dump_generic_node (pp
, t
, 0, flags
, false);
1152 newline_and_indent (pp
, spc
+ 2);
1155 if (vec_safe_length (BLOCK_NONLOCALIZED_VARS (block
)) > 0)
1158 vec
<tree
, va_gc
> *nlv
= BLOCK_NONLOCALIZED_VARS (block
);
1160 pp_string (pp
, "NONLOCALIZED_VARS: ");
1161 FOR_EACH_VEC_ELT (*nlv
, i
, t
)
1163 dump_generic_node (pp
, t
, 0, flags
, false);
1166 newline_and_indent (pp
, spc
+ 2);
1169 if (BLOCK_ABSTRACT_ORIGIN (block
))
1171 pp_string (pp
, "ABSTRACT_ORIGIN: ");
1172 dump_generic_node (pp
, BLOCK_ABSTRACT_ORIGIN (block
), 0,
1173 flags
| TDF_SLIM
, false);
1174 newline_and_indent (pp
, spc
+ 2);
1177 if (BLOCK_FRAGMENT_ORIGIN (block
))
1179 pp_string (pp
, "FRAGMENT_ORIGIN: ");
1180 dump_generic_node (pp
, BLOCK_FRAGMENT_ORIGIN (block
), 0,
1181 flags
| TDF_SLIM
, false);
1182 newline_and_indent (pp
, spc
+ 2);
1185 if (BLOCK_FRAGMENT_CHAIN (block
))
1187 pp_string (pp
, "FRAGMENT_CHAIN: ");
1188 for (t
= BLOCK_FRAGMENT_CHAIN (block
); t
; t
= BLOCK_FRAGMENT_CHAIN (t
))
1190 dump_generic_node (pp
, t
, 0, flags
| TDF_SLIM
, false);
1193 newline_and_indent (pp
, spc
+ 2);
1198 /* Dump the node NODE on the pretty_printer PP, SPC spaces of
1199 indent. FLAGS specifies details to show in the dump (see TDF_* in
1200 dumpfile.h). If IS_STMT is true, the object printed is considered
1201 to be a statement and it is terminated by ';' if appropriate. */
1204 dump_generic_node (pretty_printer
*pp
, tree node
, int spc
, dump_flags_t flags
,
1211 enum tree_code code
;
1213 if (node
== NULL_TREE
)
1216 is_expr
= EXPR_P (node
);
1218 if (is_stmt
&& (flags
& TDF_STMTADDR
))
1219 pp_printf (pp
, "<&%p> ", (void *)node
);
1221 if ((flags
& TDF_LINENO
) && EXPR_HAS_LOCATION (node
))
1222 dump_location (pp
, EXPR_LOCATION (node
));
1224 code
= TREE_CODE (node
);
1228 pp_string (pp
, "<<< error >>>");
1231 case IDENTIFIER_NODE
:
1232 pp_tree_identifier (pp
, node
);
1236 while (node
&& node
!= error_mark_node
)
1238 if (TREE_PURPOSE (node
))
1240 dump_generic_node (pp
, TREE_PURPOSE (node
), spc
, flags
, false);
1243 dump_generic_node (pp
, TREE_VALUE (node
), spc
, flags
, false);
1244 node
= TREE_CHAIN (node
);
1245 if (node
&& TREE_CODE (node
) == TREE_LIST
)
1254 dump_generic_node (pp
, BINFO_TYPE (node
), spc
, flags
, false);
1260 if (TREE_VEC_LENGTH (node
) > 0)
1262 size_t len
= TREE_VEC_LENGTH (node
);
1263 for (i
= 0; i
< len
- 1; i
++)
1265 dump_generic_node (pp
, TREE_VEC_ELT (node
, i
), spc
, flags
,
1270 dump_generic_node (pp
, TREE_VEC_ELT (node
, len
- 1), spc
,
1277 case POINTER_BOUNDS_TYPE
:
1280 case FIXED_POINT_TYPE
:
1286 unsigned int quals
= TYPE_QUALS (node
);
1287 enum tree_code_class tclass
;
1289 if (quals
& TYPE_QUAL_ATOMIC
)
1290 pp_string (pp
, "atomic ");
1291 if (quals
& TYPE_QUAL_CONST
)
1292 pp_string (pp
, "const ");
1293 else if (quals
& TYPE_QUAL_VOLATILE
)
1294 pp_string (pp
, "volatile ");
1295 else if (quals
& TYPE_QUAL_RESTRICT
)
1296 pp_string (pp
, "restrict ");
1298 if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node
)))
1300 pp_string (pp
, "<address-space-");
1301 pp_decimal_int (pp
, TYPE_ADDR_SPACE (node
));
1302 pp_string (pp
, "> ");
1305 tclass
= TREE_CODE_CLASS (TREE_CODE (node
));
1307 if (tclass
== tcc_declaration
)
1309 if (DECL_NAME (node
))
1310 dump_decl_name (pp
, node
, flags
);
1312 pp_string (pp
, "<unnamed type decl>");
1314 else if (tclass
== tcc_type
)
1316 if (TYPE_NAME (node
))
1318 if (TREE_CODE (TYPE_NAME (node
)) == IDENTIFIER_NODE
)
1319 pp_tree_identifier (pp
, TYPE_NAME (node
));
1320 else if (TREE_CODE (TYPE_NAME (node
)) == TYPE_DECL
1321 && DECL_NAME (TYPE_NAME (node
)))
1322 dump_decl_name (pp
, TYPE_NAME (node
), flags
);
1324 pp_string (pp
, "<unnamed type>");
1326 else if (TREE_CODE (node
) == VECTOR_TYPE
)
1328 pp_string (pp
, "vector");
1330 pp_wide_integer (pp
, TYPE_VECTOR_SUBPARTS (node
));
1331 pp_string (pp
, ") ");
1332 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1334 else if (TREE_CODE (node
) == INTEGER_TYPE
)
1336 if (TYPE_PRECISION (node
) == CHAR_TYPE_SIZE
)
1337 pp_string (pp
, (TYPE_UNSIGNED (node
)
1340 else if (TYPE_PRECISION (node
) == SHORT_TYPE_SIZE
)
1341 pp_string (pp
, (TYPE_UNSIGNED (node
)
1344 else if (TYPE_PRECISION (node
) == INT_TYPE_SIZE
)
1345 pp_string (pp
, (TYPE_UNSIGNED (node
)
1348 else if (TYPE_PRECISION (node
) == LONG_TYPE_SIZE
)
1349 pp_string (pp
, (TYPE_UNSIGNED (node
)
1352 else if (TYPE_PRECISION (node
) == LONG_LONG_TYPE_SIZE
)
1353 pp_string (pp
, (TYPE_UNSIGNED (node
)
1354 ? "unsigned long long"
1355 : "signed long long"));
1356 else if (TYPE_PRECISION (node
) >= CHAR_TYPE_SIZE
1357 && pow2p_hwi (TYPE_PRECISION (node
)))
1359 pp_string (pp
, (TYPE_UNSIGNED (node
) ? "uint" : "int"));
1360 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1361 pp_string (pp
, "_t");
1365 pp_string (pp
, (TYPE_UNSIGNED (node
)
1366 ? "<unnamed-unsigned:"
1367 : "<unnamed-signed:"));
1368 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1372 else if (TREE_CODE (node
) == COMPLEX_TYPE
)
1374 pp_string (pp
, "__complex__ ");
1375 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1377 else if (TREE_CODE (node
) == REAL_TYPE
)
1379 pp_string (pp
, "<float:");
1380 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1383 else if (TREE_CODE (node
) == FIXED_POINT_TYPE
)
1385 pp_string (pp
, "<fixed-point-");
1386 pp_string (pp
, TYPE_SATURATING (node
) ? "sat:" : "nonsat:");
1387 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1390 else if (TREE_CODE (node
) == VOID_TYPE
)
1391 pp_string (pp
, "void");
1393 pp_string (pp
, "<unnamed type>");
1399 case REFERENCE_TYPE
:
1400 str
= (TREE_CODE (node
) == POINTER_TYPE
? "*" : "&");
1402 if (TREE_TYPE (node
) == NULL
)
1404 pp_string (pp
, str
);
1405 pp_string (pp
, "<null type>");
1407 else if (TREE_CODE (TREE_TYPE (node
)) == FUNCTION_TYPE
)
1409 tree fnode
= TREE_TYPE (node
);
1411 dump_generic_node (pp
, TREE_TYPE (fnode
), spc
, flags
, false);
1414 pp_string (pp
, str
);
1415 if (TYPE_NAME (node
) && DECL_NAME (TYPE_NAME (node
)))
1416 dump_decl_name (pp
, TYPE_NAME (node
), flags
);
1417 else if (flags
& TDF_NOUID
)
1418 pp_printf (pp
, "<Txxxx>");
1420 pp_printf (pp
, "<T%x>", TYPE_UID (node
));
1422 pp_right_paren (pp
);
1423 dump_function_declaration (pp
, fnode
, spc
, flags
);
1427 unsigned int quals
= TYPE_QUALS (node
);
1429 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1431 pp_string (pp
, str
);
1433 if (quals
& TYPE_QUAL_CONST
)
1434 pp_string (pp
, " const");
1435 if (quals
& TYPE_QUAL_VOLATILE
)
1436 pp_string (pp
, " volatile");
1437 if (quals
& TYPE_QUAL_RESTRICT
)
1438 pp_string (pp
, " restrict");
1440 if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node
)))
1442 pp_string (pp
, " <address-space-");
1443 pp_decimal_int (pp
, TYPE_ADDR_SPACE (node
));
1447 if (TYPE_REF_CAN_ALIAS_ALL (node
))
1448 pp_string (pp
, " {ref-all}");
1458 if (flags
& TDF_GIMPLE
)
1460 pp_string (pp
, "__MEM <");
1461 dump_generic_node (pp
, TREE_TYPE (node
),
1462 spc
, flags
| TDF_SLIM
, false);
1463 if (TYPE_ALIGN (TREE_TYPE (node
))
1464 != TYPE_ALIGN (TYPE_MAIN_VARIANT (TREE_TYPE (node
))))
1466 pp_string (pp
, ", ");
1467 pp_decimal_int (pp
, TYPE_ALIGN (TREE_TYPE (node
)));
1470 pp_string (pp
, " (");
1471 if (TREE_TYPE (TREE_OPERAND (node
, 0))
1472 != TREE_TYPE (TREE_OPERAND (node
, 1)))
1475 dump_generic_node (pp
, TREE_TYPE (TREE_OPERAND (node
, 1)),
1476 spc
, flags
| TDF_SLIM
, false);
1477 pp_right_paren (pp
);
1479 dump_generic_node (pp
, TREE_OPERAND (node
, 0),
1480 spc
, flags
| TDF_SLIM
, false);
1481 if (! integer_zerop (TREE_OPERAND (node
, 1)))
1483 pp_string (pp
, " + ");
1484 dump_generic_node (pp
, TREE_OPERAND (node
, 1),
1485 spc
, flags
| TDF_SLIM
, false);
1487 pp_right_paren (pp
);
1489 else if (integer_zerop (TREE_OPERAND (node
, 1))
1490 /* Dump the types of INTEGER_CSTs explicitly, for we can't
1491 infer them and MEM_ATTR caching will share MEM_REFs
1492 with differently-typed op0s. */
1493 && TREE_CODE (TREE_OPERAND (node
, 0)) != INTEGER_CST
1494 /* Released SSA_NAMES have no TREE_TYPE. */
1495 && TREE_TYPE (TREE_OPERAND (node
, 0)) != NULL_TREE
1496 /* Same pointer types, but ignoring POINTER_TYPE vs.
1498 && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node
, 0)))
1499 == TREE_TYPE (TREE_TYPE (TREE_OPERAND (node
, 1))))
1500 && (TYPE_MODE (TREE_TYPE (TREE_OPERAND (node
, 0)))
1501 == TYPE_MODE (TREE_TYPE (TREE_OPERAND (node
, 1))))
1502 && (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node
, 0)))
1503 == TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node
, 1))))
1504 /* Same value types ignoring qualifiers. */
1505 && (TYPE_MAIN_VARIANT (TREE_TYPE (node
))
1506 == TYPE_MAIN_VARIANT
1507 (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node
, 1)))))
1508 && (!(flags
& TDF_ALIAS
)
1509 || MR_DEPENDENCE_CLIQUE (node
) == 0))
1511 if (TREE_CODE (TREE_OPERAND (node
, 0)) != ADDR_EXPR
)
1514 dump_generic_node (pp
, TREE_OPERAND (node
, 0),
1518 dump_generic_node (pp
,
1519 TREE_OPERAND (TREE_OPERAND (node
, 0), 0),
1526 pp_string (pp
, "MEM[");
1528 ptype
= TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (node
, 1)));
1529 dump_generic_node (pp
, ptype
,
1530 spc
, flags
| TDF_SLIM
, false);
1531 pp_right_paren (pp
);
1532 dump_generic_node (pp
, TREE_OPERAND (node
, 0),
1534 if (!integer_zerop (TREE_OPERAND (node
, 1)))
1536 pp_string (pp
, " + ");
1537 dump_generic_node (pp
, TREE_OPERAND (node
, 1),
1540 if ((flags
& TDF_ALIAS
)
1541 && MR_DEPENDENCE_CLIQUE (node
) != 0)
1543 pp_string (pp
, " clique ");
1544 pp_unsigned_wide_integer (pp
, MR_DEPENDENCE_CLIQUE (node
));
1545 pp_string (pp
, " base ");
1546 pp_unsigned_wide_integer (pp
, MR_DEPENDENCE_BASE (node
));
1548 pp_right_bracket (pp
);
1553 case TARGET_MEM_REF
:
1555 const char *sep
= "";
1558 pp_string (pp
, "MEM[");
1560 if (TREE_CODE (TMR_BASE (node
)) == ADDR_EXPR
)
1562 pp_string (pp
, sep
);
1564 pp_string (pp
, "symbol: ");
1565 dump_generic_node (pp
, TREE_OPERAND (TMR_BASE (node
), 0),
1570 pp_string (pp
, sep
);
1572 pp_string (pp
, "base: ");
1573 dump_generic_node (pp
, TMR_BASE (node
), spc
, flags
, false);
1575 tmp
= TMR_INDEX2 (node
);
1578 pp_string (pp
, sep
);
1580 pp_string (pp
, "base: ");
1581 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1583 tmp
= TMR_INDEX (node
);
1586 pp_string (pp
, sep
);
1588 pp_string (pp
, "index: ");
1589 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1591 tmp
= TMR_STEP (node
);
1594 pp_string (pp
, sep
);
1596 pp_string (pp
, "step: ");
1597 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1599 tmp
= TMR_OFFSET (node
);
1602 pp_string (pp
, sep
);
1604 pp_string (pp
, "offset: ");
1605 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1607 pp_right_bracket (pp
);
1615 /* Print the innermost component type. */
1616 for (tmp
= TREE_TYPE (node
); TREE_CODE (tmp
) == ARRAY_TYPE
;
1617 tmp
= TREE_TYPE (tmp
))
1619 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1621 /* Print the dimensions. */
1622 for (tmp
= node
; TREE_CODE (tmp
) == ARRAY_TYPE
; tmp
= TREE_TYPE (tmp
))
1623 dump_array_domain (pp
, TYPE_DOMAIN (tmp
), spc
, flags
);
1629 case QUAL_UNION_TYPE
:
1631 unsigned int quals
= TYPE_QUALS (node
);
1633 if (quals
& TYPE_QUAL_ATOMIC
)
1634 pp_string (pp
, "atomic ");
1635 if (quals
& TYPE_QUAL_CONST
)
1636 pp_string (pp
, "const ");
1637 if (quals
& TYPE_QUAL_VOLATILE
)
1638 pp_string (pp
, "volatile ");
1640 /* Print the name of the structure. */
1641 if (TREE_CODE (node
) == RECORD_TYPE
)
1642 pp_string (pp
, "struct ");
1643 else if (TREE_CODE (node
) == UNION_TYPE
)
1644 pp_string (pp
, "union ");
1646 if (TYPE_NAME (node
))
1647 dump_generic_node (pp
, TYPE_NAME (node
), spc
, flags
, false);
1648 else if (!(flags
& TDF_SLIM
))
1649 /* FIXME: If we eliminate the 'else' above and attempt
1650 to show the fields for named types, we may get stuck
1651 following a cycle of pointers to structs. The alleged
1652 self-reference check in print_struct_decl will not detect
1653 cycles involving more than one pointer or struct type. */
1654 print_struct_decl (pp
, node
, spc
, flags
);
1663 if (flags
& TDF_GIMPLE
1664 && (POINTER_TYPE_P (TREE_TYPE (node
))
1665 || (TYPE_PRECISION (TREE_TYPE (node
))
1666 < TYPE_PRECISION (integer_type_node
))
1667 || exact_log2 (TYPE_PRECISION (TREE_TYPE (node
))) == -1))
1669 pp_string (pp
, "_Literal (");
1670 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1671 pp_string (pp
, ") ");
1673 if (TREE_CODE (TREE_TYPE (node
)) == POINTER_TYPE
1674 && ! (flags
& TDF_GIMPLE
))
1676 /* In the case of a pointer, one may want to divide by the
1677 size of the pointed-to type. Unfortunately, this not
1678 straightforward. The C front-end maps expressions
1683 in such a way that the two INTEGER_CST nodes for "5" have
1684 different values but identical types. In the latter
1685 case, the 5 is multiplied by sizeof (int) in c-common.c
1686 (pointer_int_sum) to convert it to a byte address, and
1687 yet the type of the node is left unchanged. Argh. What
1688 is consistent though is that the number value corresponds
1689 to bytes (UNITS) offset.
1691 NB: Neither of the following divisors can be trivially
1692 used to recover the original literal:
1694 TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (node)))
1695 TYPE_PRECISION (TREE_TYPE (TREE_TYPE (node))) */
1696 pp_wide_integer (pp
, TREE_INT_CST_LOW (node
));
1697 pp_string (pp
, "B"); /* pseudo-unit */
1699 else if (tree_fits_shwi_p (node
))
1700 pp_wide_integer (pp
, tree_to_shwi (node
));
1701 else if (tree_fits_uhwi_p (node
))
1702 pp_unsigned_wide_integer (pp
, tree_to_uhwi (node
));
1705 wide_int val
= wi::to_wide (node
);
1707 if (wi::neg_p (val
, TYPE_SIGN (TREE_TYPE (node
))))
1712 print_hex (val
, pp_buffer (pp
)->digit_buffer
);
1713 pp_string (pp
, pp_buffer (pp
)->digit_buffer
);
1715 if ((flags
& TDF_GIMPLE
)
1716 && ! (POINTER_TYPE_P (TREE_TYPE (node
))
1717 || (TYPE_PRECISION (TREE_TYPE (node
))
1718 < TYPE_PRECISION (integer_type_node
))
1719 || exact_log2 (TYPE_PRECISION (TREE_TYPE (node
))) == -1))
1721 if (TYPE_UNSIGNED (TREE_TYPE (node
)))
1722 pp_character (pp
, 'u');
1723 if (TYPE_PRECISION (TREE_TYPE (node
))
1724 == TYPE_PRECISION (unsigned_type_node
))
1726 else if (TYPE_PRECISION (TREE_TYPE (node
))
1727 == TYPE_PRECISION (long_unsigned_type_node
))
1728 pp_character (pp
, 'l');
1729 else if (TYPE_PRECISION (TREE_TYPE (node
))
1730 == TYPE_PRECISION (long_long_unsigned_type_node
))
1731 pp_string (pp
, "ll");
1733 if (TREE_OVERFLOW (node
))
1734 pp_string (pp
, "(OVF)");
1738 pp_string (pp
, "POLY_INT_CST [");
1739 dump_generic_node (pp
, POLY_INT_CST_COEFF (node
, 0), spc
, flags
, false);
1740 for (unsigned int i
= 1; i
< NUM_POLY_INT_COEFFS
; ++i
)
1742 pp_string (pp
, ", ");
1743 dump_generic_node (pp
, POLY_INT_CST_COEFF (node
, i
),
1746 pp_string (pp
, "]");
1750 /* Code copied from print_node. */
1753 if (TREE_OVERFLOW (node
))
1754 pp_string (pp
, " overflow");
1756 d
= TREE_REAL_CST (node
);
1757 if (REAL_VALUE_ISINF (d
))
1758 pp_string (pp
, REAL_VALUE_NEGATIVE (d
) ? " -Inf" : " Inf");
1759 else if (REAL_VALUE_ISNAN (d
))
1760 pp_string (pp
, " Nan");
1764 real_to_decimal (string
, &d
, sizeof (string
), 0, 1);
1765 pp_string (pp
, string
);
1773 fixed_to_decimal (string
, TREE_FIXED_CST_PTR (node
), sizeof (string
));
1774 pp_string (pp
, string
);
1779 pp_string (pp
, "__complex__ (");
1780 dump_generic_node (pp
, TREE_REALPART (node
), spc
, flags
, false);
1781 pp_string (pp
, ", ");
1782 dump_generic_node (pp
, TREE_IMAGPART (node
), spc
, flags
, false);
1783 pp_right_paren (pp
);
1787 pp_string (pp
, "\"");
1788 pretty_print_string (pp
, TREE_STRING_POINTER (node
));
1789 pp_string (pp
, "\"");
1795 pp_string (pp
, "{ ");
1796 unsigned HOST_WIDE_INT nunits
;
1797 if (!VECTOR_CST_NELTS (node
).is_constant (&nunits
))
1798 nunits
= vector_cst_encoded_nelts (node
);
1799 for (i
= 0; i
< nunits
; ++i
)
1802 pp_string (pp
, ", ");
1803 dump_generic_node (pp
, VECTOR_CST_ELT (node
, i
),
1806 if (!VECTOR_CST_NELTS (node
).is_constant ())
1807 pp_string (pp
, ", ...");
1808 pp_string (pp
, " }");
1814 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1816 if (TREE_CODE (node
) == METHOD_TYPE
)
1818 if (TYPE_METHOD_BASETYPE (node
))
1819 dump_decl_name (pp
, TYPE_NAME (TYPE_METHOD_BASETYPE (node
)),
1822 pp_string (pp
, "<null method basetype>");
1823 pp_colon_colon (pp
);
1825 if (TYPE_NAME (node
) && DECL_NAME (TYPE_NAME (node
)))
1826 dump_decl_name (pp
, TYPE_NAME (node
), flags
);
1827 else if (flags
& TDF_NOUID
)
1828 pp_printf (pp
, "<Txxxx>");
1830 pp_printf (pp
, "<T%x>", TYPE_UID (node
));
1831 dump_function_declaration (pp
, node
, spc
, flags
);
1836 dump_decl_name (pp
, node
, flags
);
1840 if (DECL_NAME (node
))
1841 dump_decl_name (pp
, node
, flags
);
1842 else if (LABEL_DECL_UID (node
) != -1)
1844 if (flags
& TDF_GIMPLE
)
1845 pp_printf (pp
, "L%d", (int) LABEL_DECL_UID (node
));
1847 pp_printf (pp
, "<L%d>", (int) LABEL_DECL_UID (node
));
1851 if (flags
& TDF_NOUID
)
1852 pp_string (pp
, "<D.xxxx>");
1855 if (flags
& TDF_GIMPLE
)
1856 pp_printf (pp
, "<D%u>", DECL_UID (node
));
1858 pp_printf (pp
, "<D.%u>", DECL_UID (node
));
1864 if (DECL_IS_BUILTIN (node
))
1866 /* Don't print the declaration of built-in types. */
1869 if (DECL_NAME (node
))
1870 dump_decl_name (pp
, node
, flags
);
1871 else if (TYPE_NAME (TREE_TYPE (node
)) != node
)
1873 pp_string (pp
, (TREE_CODE (TREE_TYPE (node
)) == UNION_TYPE
1874 ? "union" : "struct "));
1875 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1878 pp_string (pp
, "<anon>");
1884 case DEBUG_EXPR_DECL
:
1885 case NAMESPACE_DECL
:
1887 dump_decl_name (pp
, node
, flags
);
1891 pp_string (pp
, "<retval>");
1895 op0
= TREE_OPERAND (node
, 0);
1898 && (TREE_CODE (op0
) == INDIRECT_REF
1899 || (TREE_CODE (op0
) == MEM_REF
1900 && TREE_CODE (TREE_OPERAND (op0
, 0)) != ADDR_EXPR
1901 && integer_zerop (TREE_OPERAND (op0
, 1))
1902 /* Dump the types of INTEGER_CSTs explicitly, for we
1903 can't infer them and MEM_ATTR caching will share
1904 MEM_REFs with differently-typed op0s. */
1905 && TREE_CODE (TREE_OPERAND (op0
, 0)) != INTEGER_CST
1906 /* Released SSA_NAMES have no TREE_TYPE. */
1907 && TREE_TYPE (TREE_OPERAND (op0
, 0)) != NULL_TREE
1908 /* Same pointer types, but ignoring POINTER_TYPE vs.
1910 && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 0)))
1911 == TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 1))))
1912 && (TYPE_MODE (TREE_TYPE (TREE_OPERAND (op0
, 0)))
1913 == TYPE_MODE (TREE_TYPE (TREE_OPERAND (op0
, 1))))
1914 && (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (op0
, 0)))
1915 == TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (op0
, 1))))
1916 /* Same value types ignoring qualifiers. */
1917 && (TYPE_MAIN_VARIANT (TREE_TYPE (op0
))
1918 == TYPE_MAIN_VARIANT
1919 (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 1)))))
1920 && MR_DEPENDENCE_CLIQUE (op0
) == 0)))
1922 op0
= TREE_OPERAND (op0
, 0);
1925 if (op_prio (op0
) < op_prio (node
))
1927 dump_generic_node (pp
, op0
, spc
, flags
, false);
1928 if (op_prio (op0
) < op_prio (node
))
1929 pp_right_paren (pp
);
1930 pp_string (pp
, str
);
1931 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1932 op0
= component_ref_field_offset (node
);
1933 if (op0
&& TREE_CODE (op0
) != INTEGER_CST
)
1935 pp_string (pp
, "{off: ");
1936 dump_generic_node (pp
, op0
, spc
, flags
, false);
1937 pp_right_brace (pp
);
1942 pp_string (pp
, "BIT_FIELD_REF <");
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);
1951 case BIT_INSERT_EXPR
:
1952 pp_string (pp
, "BIT_INSERT_EXPR <");
1953 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1954 pp_string (pp
, ", ");
1955 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1956 pp_string (pp
, ", ");
1957 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
1958 pp_string (pp
, " (");
1959 if (INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (node
, 1))))
1961 TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (node
, 1))));
1963 dump_generic_node (pp
, TYPE_SIZE (TREE_TYPE (TREE_OPERAND (node
, 1))),
1965 pp_string (pp
, " bits)>");
1969 case ARRAY_RANGE_REF
:
1970 op0
= TREE_OPERAND (node
, 0);
1971 if (op_prio (op0
) < op_prio (node
))
1973 dump_generic_node (pp
, op0
, spc
, flags
, false);
1974 if (op_prio (op0
) < op_prio (node
))
1975 pp_right_paren (pp
);
1976 pp_left_bracket (pp
);
1977 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1978 if (TREE_CODE (node
) == ARRAY_RANGE_REF
)
1979 pp_string (pp
, " ...");
1980 pp_right_bracket (pp
);
1982 op0
= array_ref_low_bound (node
);
1983 op1
= array_ref_element_size (node
);
1985 if (!integer_zerop (op0
)
1986 || TREE_OPERAND (node
, 2)
1987 || TREE_OPERAND (node
, 3))
1989 pp_string (pp
, "{lb: ");
1990 dump_generic_node (pp
, op0
, spc
, flags
, false);
1991 pp_string (pp
, " sz: ");
1992 dump_generic_node (pp
, op1
, spc
, flags
, false);
1993 pp_right_brace (pp
);
1999 unsigned HOST_WIDE_INT ix
;
2001 bool is_struct_init
= false;
2002 bool is_array_init
= false;
2005 if (TREE_CLOBBER_P (node
))
2006 pp_string (pp
, "CLOBBER");
2007 else if (TREE_CODE (TREE_TYPE (node
)) == RECORD_TYPE
2008 || TREE_CODE (TREE_TYPE (node
)) == UNION_TYPE
)
2009 is_struct_init
= true;
2010 else if (TREE_CODE (TREE_TYPE (node
)) == ARRAY_TYPE
2011 && TYPE_DOMAIN (TREE_TYPE (node
))
2012 && TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
)))
2013 && TREE_CODE (TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
))))
2016 tree minv
= TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
)));
2017 is_array_init
= true;
2018 curidx
= wi::to_widest (minv
);
2020 FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (node
), ix
, field
, val
)
2027 dump_generic_node (pp
, field
, spc
, flags
, false);
2030 else if (is_array_init
2031 && (TREE_CODE (field
) != INTEGER_CST
2032 || curidx
!= wi::to_widest (field
)))
2034 pp_left_bracket (pp
);
2035 if (TREE_CODE (field
) == RANGE_EXPR
)
2037 dump_generic_node (pp
, TREE_OPERAND (field
, 0), spc
,
2039 pp_string (pp
, " ... ");
2040 dump_generic_node (pp
, TREE_OPERAND (field
, 1), spc
,
2042 if (TREE_CODE (TREE_OPERAND (field
, 1)) == INTEGER_CST
)
2043 curidx
= wi::to_widest (TREE_OPERAND (field
, 1));
2046 dump_generic_node (pp
, field
, spc
, flags
, false);
2047 if (TREE_CODE (field
) == INTEGER_CST
)
2048 curidx
= wi::to_widest (field
);
2049 pp_string (pp
, "]=");
2054 if (val
&& TREE_CODE (val
) == ADDR_EXPR
)
2055 if (TREE_CODE (TREE_OPERAND (val
, 0)) == FUNCTION_DECL
)
2056 val
= TREE_OPERAND (val
, 0);
2057 if (val
&& TREE_CODE (val
) == FUNCTION_DECL
)
2058 dump_decl_name (pp
, val
, flags
);
2060 dump_generic_node (pp
, val
, spc
, flags
, false);
2061 if (ix
!= CONSTRUCTOR_NELTS (node
) - 1)
2067 pp_right_brace (pp
);
2074 if (flags
& TDF_SLIM
)
2076 pp_string (pp
, "<COMPOUND_EXPR>");
2080 dump_generic_node (pp
, TREE_OPERAND (node
, 0),
2081 spc
, flags
, !(flags
& TDF_SLIM
));
2082 if (flags
& TDF_SLIM
)
2083 newline_and_indent (pp
, spc
);
2090 for (tp
= &TREE_OPERAND (node
, 1);
2091 TREE_CODE (*tp
) == COMPOUND_EXPR
;
2092 tp
= &TREE_OPERAND (*tp
, 1))
2094 dump_generic_node (pp
, TREE_OPERAND (*tp
, 0),
2095 spc
, flags
, !(flags
& TDF_SLIM
));
2096 if (flags
& TDF_SLIM
)
2097 newline_and_indent (pp
, spc
);
2105 dump_generic_node (pp
, *tp
, spc
, flags
, !(flags
& TDF_SLIM
));
2109 case STATEMENT_LIST
:
2111 tree_stmt_iterator si
;
2114 if (flags
& TDF_SLIM
)
2116 pp_string (pp
, "<STATEMENT_LIST>");
2120 for (si
= tsi_start (node
); !tsi_end_p (si
); tsi_next (&si
))
2123 newline_and_indent (pp
, spc
);
2126 dump_generic_node (pp
, tsi_stmt (si
), spc
, flags
, true);
2133 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
,
2138 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
,
2143 pp_string (pp
, "TARGET_EXPR <");
2144 dump_generic_node (pp
, TARGET_EXPR_SLOT (node
), spc
, flags
, false);
2147 dump_generic_node (pp
, TARGET_EXPR_INITIAL (node
), spc
, flags
, false);
2152 print_declaration (pp
, DECL_EXPR_DECL (node
), spc
, flags
);
2157 if (TREE_TYPE (node
) == NULL
|| TREE_TYPE (node
) == void_type_node
)
2159 pp_string (pp
, "if (");
2160 dump_generic_node (pp
, COND_EXPR_COND (node
), spc
, flags
, false);
2161 pp_right_paren (pp
);
2162 /* The lowered cond_exprs should always be printed in full. */
2163 if (COND_EXPR_THEN (node
)
2164 && (IS_EMPTY_STMT (COND_EXPR_THEN (node
))
2165 || TREE_CODE (COND_EXPR_THEN (node
)) == GOTO_EXPR
)
2166 && COND_EXPR_ELSE (node
)
2167 && (IS_EMPTY_STMT (COND_EXPR_ELSE (node
))
2168 || TREE_CODE (COND_EXPR_ELSE (node
)) == GOTO_EXPR
))
2171 dump_generic_node (pp
, COND_EXPR_THEN (node
),
2173 if (!IS_EMPTY_STMT (COND_EXPR_ELSE (node
)))
2175 pp_string (pp
, " else ");
2176 dump_generic_node (pp
, COND_EXPR_ELSE (node
),
2180 else if (!(flags
& TDF_SLIM
))
2182 /* Output COND_EXPR_THEN. */
2183 if (COND_EXPR_THEN (node
))
2185 newline_and_indent (pp
, spc
+2);
2187 newline_and_indent (pp
, spc
+4);
2188 dump_generic_node (pp
, COND_EXPR_THEN (node
), spc
+4,
2190 newline_and_indent (pp
, spc
+2);
2191 pp_right_brace (pp
);
2194 /* Output COND_EXPR_ELSE. */
2195 if (COND_EXPR_ELSE (node
)
2196 && !IS_EMPTY_STMT (COND_EXPR_ELSE (node
)))
2198 newline_and_indent (pp
, spc
);
2199 pp_string (pp
, "else");
2200 newline_and_indent (pp
, spc
+2);
2202 newline_and_indent (pp
, spc
+4);
2203 dump_generic_node (pp
, COND_EXPR_ELSE (node
), spc
+4,
2205 newline_and_indent (pp
, spc
+2);
2206 pp_right_brace (pp
);
2213 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2217 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2221 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2227 if (!(flags
& TDF_SLIM
))
2229 if (BIND_EXPR_VARS (node
))
2233 for (op0
= BIND_EXPR_VARS (node
); op0
; op0
= DECL_CHAIN (op0
))
2235 print_declaration (pp
, op0
, spc
+2, flags
);
2240 newline_and_indent (pp
, spc
+2);
2241 dump_generic_node (pp
, BIND_EXPR_BODY (node
), spc
+2, flags
, true);
2242 newline_and_indent (pp
, spc
);
2243 pp_right_brace (pp
);
2249 if (CALL_EXPR_FN (node
) != NULL_TREE
)
2250 print_call_name (pp
, CALL_EXPR_FN (node
), flags
);
2252 pp_string (pp
, internal_fn_name (CALL_EXPR_IFN (node
)));
2254 /* Print parameters. */
2259 call_expr_arg_iterator iter
;
2260 FOR_EACH_CALL_EXPR_ARG (arg
, iter
, node
)
2262 dump_generic_node (pp
, arg
, spc
, flags
, false);
2263 if (more_call_expr_args_p (&iter
))
2270 if (CALL_EXPR_VA_ARG_PACK (node
))
2272 if (call_expr_nargs (node
) > 0)
2277 pp_string (pp
, "__builtin_va_arg_pack ()");
2279 pp_right_paren (pp
);
2281 op1
= CALL_EXPR_STATIC_CHAIN (node
);
2284 pp_string (pp
, " [static-chain: ");
2285 dump_generic_node (pp
, op1
, spc
, flags
, false);
2286 pp_right_bracket (pp
);
2289 if (CALL_EXPR_RETURN_SLOT_OPT (node
))
2290 pp_string (pp
, " [return slot optimization]");
2291 if (CALL_EXPR_TAILCALL (node
))
2292 pp_string (pp
, " [tail call]");
2295 case WITH_CLEANUP_EXPR
:
2299 case CLEANUP_POINT_EXPR
:
2300 pp_string (pp
, "<<cleanup_point ");
2301 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2302 pp_string (pp
, ">>");
2305 case PLACEHOLDER_EXPR
:
2306 pp_string (pp
, "<PLACEHOLDER_EXPR ");
2307 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
2311 /* Binary arithmetic and logic expressions. */
2312 case WIDEN_SUM_EXPR
:
2313 case WIDEN_MULT_EXPR
:
2315 case MULT_HIGHPART_EXPR
:
2317 case POINTER_PLUS_EXPR
:
2318 case POINTER_DIFF_EXPR
:
2320 case TRUNC_DIV_EXPR
:
2322 case FLOOR_DIV_EXPR
:
2323 case ROUND_DIV_EXPR
:
2324 case TRUNC_MOD_EXPR
:
2326 case FLOOR_MOD_EXPR
:
2327 case ROUND_MOD_EXPR
:
2329 case EXACT_DIV_EXPR
:
2334 case WIDEN_LSHIFT_EXPR
:
2338 case TRUTH_ANDIF_EXPR
:
2339 case TRUTH_ORIF_EXPR
:
2340 case TRUTH_AND_EXPR
:
2342 case TRUTH_XOR_EXPR
:
2356 case UNORDERED_EXPR
:
2358 const char *op
= op_symbol (node
);
2359 op0
= TREE_OPERAND (node
, 0);
2360 op1
= TREE_OPERAND (node
, 1);
2362 /* When the operands are expressions with less priority,
2363 keep semantics of the tree representation. */
2364 if (op_prio (op0
) <= op_prio (node
))
2367 dump_generic_node (pp
, op0
, spc
, flags
, false);
2368 pp_right_paren (pp
);
2371 dump_generic_node (pp
, op0
, spc
, flags
, false);
2377 /* When the operands are expressions with less priority,
2378 keep semantics of the tree representation. */
2379 if (op_prio (op1
) <= op_prio (node
))
2382 dump_generic_node (pp
, op1
, spc
, flags
, false);
2383 pp_right_paren (pp
);
2386 dump_generic_node (pp
, op1
, spc
, flags
, false);
2390 /* Unary arithmetic and logic expressions. */
2393 case TRUTH_NOT_EXPR
:
2395 case PREDECREMENT_EXPR
:
2396 case PREINCREMENT_EXPR
:
2398 if (TREE_CODE (node
) == ADDR_EXPR
2399 && (TREE_CODE (TREE_OPERAND (node
, 0)) == STRING_CST
2400 || TREE_CODE (TREE_OPERAND (node
, 0)) == FUNCTION_DECL
))
2401 ; /* Do not output '&' for strings and function pointers. */
2403 pp_string (pp
, op_symbol (node
));
2405 if (op_prio (TREE_OPERAND (node
, 0)) < op_prio (node
))
2408 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2409 pp_right_paren (pp
);
2412 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2415 case POSTDECREMENT_EXPR
:
2416 case POSTINCREMENT_EXPR
:
2417 if (op_prio (TREE_OPERAND (node
, 0)) < op_prio (node
))
2420 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2421 pp_right_paren (pp
);
2424 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2425 pp_string (pp
, op_symbol (node
));
2429 pp_string (pp
, "MIN_EXPR <");
2430 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2431 pp_string (pp
, ", ");
2432 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2437 pp_string (pp
, "MAX_EXPR <");
2438 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2439 pp_string (pp
, ", ");
2440 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2445 pp_string (pp
, "ABS_EXPR <");
2446 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2454 case ADDR_SPACE_CONVERT_EXPR
:
2455 case FIXED_CONVERT_EXPR
:
2456 case FIX_TRUNC_EXPR
:
2459 type
= TREE_TYPE (node
);
2460 op0
= TREE_OPERAND (node
, 0);
2461 if (type
!= TREE_TYPE (op0
))
2464 dump_generic_node (pp
, type
, spc
, flags
, false);
2465 pp_string (pp
, ") ");
2467 if (op_prio (op0
) < op_prio (node
))
2469 dump_generic_node (pp
, op0
, spc
, flags
, false);
2470 if (op_prio (op0
) < op_prio (node
))
2471 pp_right_paren (pp
);
2474 case VIEW_CONVERT_EXPR
:
2475 pp_string (pp
, "VIEW_CONVERT_EXPR<");
2476 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
2477 pp_string (pp
, ">(");
2478 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2479 pp_right_paren (pp
);
2483 pp_string (pp
, "((");
2484 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2485 pp_string (pp
, "))");
2488 case NON_LVALUE_EXPR
:
2489 pp_string (pp
, "NON_LVALUE_EXPR <");
2490 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2495 pp_string (pp
, "SAVE_EXPR <");
2496 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2501 pp_string (pp
, "COMPLEX_EXPR <");
2502 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2503 pp_string (pp
, ", ");
2504 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2509 pp_string (pp
, "CONJ_EXPR <");
2510 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2515 if (flags
& TDF_GIMPLE
)
2517 pp_string (pp
, "__real ");
2518 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2522 pp_string (pp
, "REALPART_EXPR <");
2523 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2529 if (flags
& TDF_GIMPLE
)
2531 pp_string (pp
, "__imag ");
2532 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2536 pp_string (pp
, "IMAGPART_EXPR <");
2537 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2543 pp_string (pp
, "VA_ARG_EXPR <");
2544 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2548 case TRY_FINALLY_EXPR
:
2549 case TRY_CATCH_EXPR
:
2550 pp_string (pp
, "try");
2551 newline_and_indent (pp
, spc
+2);
2553 newline_and_indent (pp
, spc
+4);
2554 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
+4, flags
, true);
2555 newline_and_indent (pp
, spc
+2);
2556 pp_right_brace (pp
);
2557 newline_and_indent (pp
, spc
);
2559 (TREE_CODE (node
) == TRY_CATCH_EXPR
) ? "catch" : "finally");
2560 newline_and_indent (pp
, spc
+2);
2562 newline_and_indent (pp
, spc
+4);
2563 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
+4, flags
, true);
2564 newline_and_indent (pp
, spc
+2);
2565 pp_right_brace (pp
);
2570 pp_string (pp
, "catch (");
2571 dump_generic_node (pp
, CATCH_TYPES (node
), spc
+2, flags
, false);
2572 pp_right_paren (pp
);
2573 newline_and_indent (pp
, spc
+2);
2575 newline_and_indent (pp
, spc
+4);
2576 dump_generic_node (pp
, CATCH_BODY (node
), spc
+4, flags
, true);
2577 newline_and_indent (pp
, spc
+2);
2578 pp_right_brace (pp
);
2582 case EH_FILTER_EXPR
:
2583 pp_string (pp
, "<<<eh_filter (");
2584 dump_generic_node (pp
, EH_FILTER_TYPES (node
), spc
+2, flags
, false);
2585 pp_string (pp
, ")>>>");
2586 newline_and_indent (pp
, spc
+2);
2588 newline_and_indent (pp
, spc
+4);
2589 dump_generic_node (pp
, EH_FILTER_FAILURE (node
), spc
+4, flags
, true);
2590 newline_and_indent (pp
, spc
+2);
2591 pp_right_brace (pp
);
2596 op0
= TREE_OPERAND (node
, 0);
2597 /* If this is for break or continue, don't bother printing it. */
2598 if (DECL_NAME (op0
))
2600 const char *name
= IDENTIFIER_POINTER (DECL_NAME (op0
));
2601 if (strcmp (name
, "break") == 0
2602 || strcmp (name
, "continue") == 0)
2605 dump_generic_node (pp
, op0
, spc
, flags
, false);
2607 if (DECL_NONLOCAL (op0
))
2608 pp_string (pp
, " [non-local]");
2612 pp_string (pp
, "while (1)");
2613 if (!(flags
& TDF_SLIM
))
2615 newline_and_indent (pp
, spc
+2);
2617 newline_and_indent (pp
, spc
+4);
2618 dump_generic_node (pp
, LOOP_EXPR_BODY (node
), spc
+4, flags
, true);
2619 newline_and_indent (pp
, spc
+2);
2620 pp_right_brace (pp
);
2626 pp_string (pp
, "// predicted ");
2627 if (PREDICT_EXPR_OUTCOME (node
))
2628 pp_string (pp
, "likely by ");
2630 pp_string (pp
, "unlikely by ");
2631 pp_string (pp
, predictor_name (PREDICT_EXPR_PREDICTOR (node
)));
2632 pp_string (pp
, " predictor.");
2636 pp_string (pp
, "ANNOTATE_EXPR <");
2637 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2638 switch ((enum annot_expr_kind
) TREE_INT_CST_LOW (TREE_OPERAND (node
, 1)))
2640 case annot_expr_ivdep_kind
:
2641 pp_string (pp
, ", ivdep");
2643 case annot_expr_unroll_kind
:
2644 pp_printf (pp
, ", unroll %d",
2645 (int) TREE_INT_CST_LOW (TREE_OPERAND (node
, 2)));
2647 case annot_expr_no_vector_kind
:
2648 pp_string (pp
, ", no-vector");
2650 case annot_expr_vector_kind
:
2651 pp_string (pp
, ", vector");
2653 case annot_expr_parallel_kind
:
2654 pp_string (pp
, ", parallel");
2663 pp_string (pp
, "return");
2664 op0
= TREE_OPERAND (node
, 0);
2668 if (TREE_CODE (op0
) == MODIFY_EXPR
)
2669 dump_generic_node (pp
, TREE_OPERAND (op0
, 1),
2672 dump_generic_node (pp
, op0
, spc
, flags
, false);
2677 pp_string (pp
, "if (");
2678 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2679 pp_string (pp
, ") break");
2683 pp_string (pp
, "switch (");
2684 dump_generic_node (pp
, SWITCH_COND (node
), spc
, flags
, false);
2685 pp_right_paren (pp
);
2686 if (!(flags
& TDF_SLIM
))
2688 newline_and_indent (pp
, spc
+2);
2690 if (SWITCH_BODY (node
))
2692 newline_and_indent (pp
, spc
+4);
2693 dump_generic_node (pp
, SWITCH_BODY (node
), spc
+4, flags
,
2696 newline_and_indent (pp
, spc
+2);
2697 pp_right_brace (pp
);
2703 op0
= GOTO_DESTINATION (node
);
2704 if (TREE_CODE (op0
) != SSA_NAME
&& DECL_P (op0
) && DECL_NAME (op0
))
2706 const char *name
= IDENTIFIER_POINTER (DECL_NAME (op0
));
2707 if (strcmp (name
, "break") == 0
2708 || strcmp (name
, "continue") == 0)
2710 pp_string (pp
, name
);
2714 pp_string (pp
, "goto ");
2715 dump_generic_node (pp
, op0
, spc
, flags
, false);
2719 pp_string (pp
, "__asm__");
2720 if (ASM_VOLATILE_P (node
))
2721 pp_string (pp
, " __volatile__");
2723 dump_generic_node (pp
, ASM_STRING (node
), spc
, flags
, false);
2725 dump_generic_node (pp
, ASM_OUTPUTS (node
), spc
, flags
, false);
2727 dump_generic_node (pp
, ASM_INPUTS (node
), spc
, flags
, false);
2728 if (ASM_CLOBBERS (node
))
2731 dump_generic_node (pp
, ASM_CLOBBERS (node
), spc
, flags
, false);
2733 pp_right_paren (pp
);
2736 case CASE_LABEL_EXPR
:
2737 if (CASE_LOW (node
) && CASE_HIGH (node
))
2739 pp_string (pp
, "case ");
2740 dump_generic_node (pp
, CASE_LOW (node
), spc
, flags
, false);
2741 pp_string (pp
, " ... ");
2742 dump_generic_node (pp
, CASE_HIGH (node
), spc
, flags
, false);
2744 else if (CASE_LOW (node
))
2746 pp_string (pp
, "case ");
2747 dump_generic_node (pp
, CASE_LOW (node
), spc
, flags
, false);
2750 pp_string (pp
, "default");
2755 pp_string (pp
, "OBJ_TYPE_REF(");
2756 dump_generic_node (pp
, OBJ_TYPE_REF_EXPR (node
), spc
, flags
, false);
2758 /* We omit the class type for -fcompare-debug because we may
2759 drop TYPE_BINFO early depending on debug info, and then
2760 virtual_method_call_p would return false, whereas when
2761 TYPE_BINFO is preserved it may still return true and then
2762 we'd print the class type. Compare tree and rtl dumps for
2763 libstdc++-prettyprinters/shared_ptr.cc with and without -g,
2764 for example, at occurrences of OBJ_TYPE_REF. */
2765 if (!(flags
& (TDF_SLIM
| TDF_COMPARE_DEBUG
))
2766 && virtual_method_call_p (node
))
2768 pp_string (pp
, "(");
2769 dump_generic_node (pp
, obj_type_ref_class (node
), spc
, flags
, false);
2770 pp_string (pp
, ")");
2772 dump_generic_node (pp
, OBJ_TYPE_REF_OBJECT (node
), spc
, flags
, false);
2774 dump_generic_node (pp
, OBJ_TYPE_REF_TOKEN (node
), spc
, flags
, false);
2775 pp_right_paren (pp
);
2779 if (SSA_NAME_IDENTIFIER (node
))
2781 if ((flags
& TDF_NOUID
)
2782 && SSA_NAME_VAR (node
)
2783 && DECL_NAMELESS (SSA_NAME_VAR (node
)))
2784 dump_fancy_name (pp
, SSA_NAME_IDENTIFIER (node
));
2785 else if (! (flags
& TDF_GIMPLE
)
2786 || SSA_NAME_VAR (node
))
2787 dump_generic_node (pp
, SSA_NAME_IDENTIFIER (node
),
2791 pp_decimal_int (pp
, SSA_NAME_VERSION (node
));
2792 if (SSA_NAME_IS_DEFAULT_DEF (node
))
2793 pp_string (pp
, "(D)");
2794 if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (node
))
2795 pp_string (pp
, "(ab)");
2798 case WITH_SIZE_EXPR
:
2799 pp_string (pp
, "WITH_SIZE_EXPR <");
2800 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2801 pp_string (pp
, ", ");
2802 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2807 pp_string (pp
, "ASSERT_EXPR <");
2808 dump_generic_node (pp
, ASSERT_EXPR_VAR (node
), spc
, flags
, false);
2809 pp_string (pp
, ", ");
2810 dump_generic_node (pp
, ASSERT_EXPR_COND (node
), spc
, flags
, false);
2815 pp_string (pp
, "scev_known");
2818 case SCEV_NOT_KNOWN
:
2819 pp_string (pp
, "scev_not_known");
2822 case POLYNOMIAL_CHREC
:
2824 dump_generic_node (pp
, CHREC_LEFT (node
), spc
, flags
, false);
2825 pp_string (pp
, ", +, ");
2826 dump_generic_node (pp
, CHREC_RIGHT (node
), spc
, flags
, false);
2827 pp_printf (pp
, "}_%u", CHREC_VARIABLE (node
));
2831 case REALIGN_LOAD_EXPR
:
2832 pp_string (pp
, "REALIGN_LOAD <");
2833 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2834 pp_string (pp
, ", ");
2835 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2836 pp_string (pp
, ", ");
2837 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2842 pp_string (pp
, " VEC_COND_EXPR < ");
2843 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2844 pp_string (pp
, " , ");
2845 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2846 pp_string (pp
, " , ");
2847 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2848 pp_string (pp
, " > ");
2852 pp_string (pp
, " VEC_PERM_EXPR < ");
2853 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2854 pp_string (pp
, " , ");
2855 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2856 pp_string (pp
, " , ");
2857 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2858 pp_string (pp
, " > ");
2862 pp_string (pp
, " DOT_PROD_EXPR < ");
2863 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2864 pp_string (pp
, ", ");
2865 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2866 pp_string (pp
, ", ");
2867 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2868 pp_string (pp
, " > ");
2871 case WIDEN_MULT_PLUS_EXPR
:
2872 pp_string (pp
, " WIDEN_MULT_PLUS_EXPR < ");
2873 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2874 pp_string (pp
, ", ");
2875 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2876 pp_string (pp
, ", ");
2877 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2878 pp_string (pp
, " > ");
2881 case WIDEN_MULT_MINUS_EXPR
:
2882 pp_string (pp
, " WIDEN_MULT_MINUS_EXPR < ");
2883 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2884 pp_string (pp
, ", ");
2885 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2886 pp_string (pp
, ", ");
2887 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2888 pp_string (pp
, " > ");
2892 pp_string (pp
, " FMA_EXPR < ");
2893 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2894 pp_string (pp
, ", ");
2895 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2896 pp_string (pp
, ", ");
2897 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2898 pp_string (pp
, " > ");
2902 pp_string (pp
, "#pragma acc parallel");
2903 goto dump_omp_clauses_body
;
2906 pp_string (pp
, "#pragma acc kernels");
2907 goto dump_omp_clauses_body
;
2910 pp_string (pp
, "#pragma acc data");
2911 dump_omp_clauses (pp
, OACC_DATA_CLAUSES (node
), spc
, flags
);
2914 case OACC_HOST_DATA
:
2915 pp_string (pp
, "#pragma acc host_data");
2916 dump_omp_clauses (pp
, OACC_HOST_DATA_CLAUSES (node
), spc
, flags
);
2920 pp_string (pp
, "#pragma acc declare");
2921 dump_omp_clauses (pp
, OACC_DECLARE_CLAUSES (node
), spc
, flags
);
2925 pp_string (pp
, "#pragma acc update");
2926 dump_omp_clauses (pp
, OACC_UPDATE_CLAUSES (node
), spc
, flags
);
2929 case OACC_ENTER_DATA
:
2930 pp_string (pp
, "#pragma acc enter data");
2931 dump_omp_clauses (pp
, OACC_ENTER_DATA_CLAUSES (node
), spc
, flags
);
2934 case OACC_EXIT_DATA
:
2935 pp_string (pp
, "#pragma acc exit data");
2936 dump_omp_clauses (pp
, OACC_EXIT_DATA_CLAUSES (node
), spc
, flags
);
2940 pp_string (pp
, "#pragma acc cache");
2941 dump_omp_clauses (pp
, OACC_CACHE_CLAUSES (node
), spc
, flags
);
2945 pp_string (pp
, "#pragma omp parallel");
2946 dump_omp_clauses (pp
, OMP_PARALLEL_CLAUSES (node
), spc
, flags
);
2949 dump_omp_clauses_body
:
2950 dump_omp_clauses (pp
, OMP_CLAUSES (node
), spc
, flags
);
2954 if (!(flags
& TDF_SLIM
) && OMP_BODY (node
))
2956 newline_and_indent (pp
, spc
+ 2);
2958 newline_and_indent (pp
, spc
+ 4);
2959 dump_generic_node (pp
, OMP_BODY (node
), spc
+ 4, flags
, false);
2960 newline_and_indent (pp
, spc
+ 2);
2961 pp_right_brace (pp
);
2967 pp_string (pp
, "#pragma omp task");
2968 dump_omp_clauses (pp
, OMP_TASK_CLAUSES (node
), spc
, flags
);
2972 pp_string (pp
, "#pragma omp for");
2976 pp_string (pp
, "#pragma omp simd");
2979 case OMP_DISTRIBUTE
:
2980 pp_string (pp
, "#pragma omp distribute");
2984 pp_string (pp
, "#pragma omp taskloop");
2988 pp_string (pp
, "#pragma acc loop");
2992 pp_string (pp
, "#pragma omp teams");
2993 dump_omp_clauses (pp
, OMP_TEAMS_CLAUSES (node
), spc
, flags
);
2996 case OMP_TARGET_DATA
:
2997 pp_string (pp
, "#pragma omp target data");
2998 dump_omp_clauses (pp
, OMP_TARGET_DATA_CLAUSES (node
), spc
, flags
);
3001 case OMP_TARGET_ENTER_DATA
:
3002 pp_string (pp
, "#pragma omp target enter data");
3003 dump_omp_clauses (pp
, OMP_TARGET_ENTER_DATA_CLAUSES (node
), spc
, flags
);
3007 case OMP_TARGET_EXIT_DATA
:
3008 pp_string (pp
, "#pragma omp target exit data");
3009 dump_omp_clauses (pp
, OMP_TARGET_EXIT_DATA_CLAUSES (node
), spc
, flags
);
3014 pp_string (pp
, "#pragma omp target");
3015 dump_omp_clauses (pp
, OMP_TARGET_CLAUSES (node
), spc
, flags
);
3018 case OMP_TARGET_UPDATE
:
3019 pp_string (pp
, "#pragma omp target update");
3020 dump_omp_clauses (pp
, OMP_TARGET_UPDATE_CLAUSES (node
), spc
, flags
);
3025 dump_omp_clauses (pp
, OMP_FOR_CLAUSES (node
), spc
, flags
);
3026 if (!(flags
& TDF_SLIM
))
3030 if (OMP_FOR_PRE_BODY (node
))
3032 newline_and_indent (pp
, spc
+ 2);
3035 newline_and_indent (pp
, spc
);
3036 dump_generic_node (pp
, OMP_FOR_PRE_BODY (node
),
3039 if (OMP_FOR_INIT (node
))
3042 for (i
= 0; i
< TREE_VEC_LENGTH (OMP_FOR_INIT (node
)); i
++)
3045 newline_and_indent (pp
, spc
);
3046 pp_string (pp
, "for (");
3047 dump_generic_node (pp
,
3048 TREE_VEC_ELT (OMP_FOR_INIT (node
), i
),
3050 pp_string (pp
, "; ");
3051 dump_generic_node (pp
,
3052 TREE_VEC_ELT (OMP_FOR_COND (node
), i
),
3054 pp_string (pp
, "; ");
3055 dump_generic_node (pp
,
3056 TREE_VEC_ELT (OMP_FOR_INCR (node
), i
),
3058 pp_right_paren (pp
);
3061 if (OMP_FOR_BODY (node
))
3063 newline_and_indent (pp
, spc
+ 2);
3065 newline_and_indent (pp
, spc
+ 4);
3066 dump_generic_node (pp
, OMP_FOR_BODY (node
), spc
+ 4, flags
,
3068 newline_and_indent (pp
, spc
+ 2);
3069 pp_right_brace (pp
);
3071 if (OMP_FOR_INIT (node
))
3072 spc
-= 2 * TREE_VEC_LENGTH (OMP_FOR_INIT (node
)) - 2;
3073 if (OMP_FOR_PRE_BODY (node
))
3076 newline_and_indent (pp
, spc
+ 2);
3077 pp_right_brace (pp
);
3084 pp_string (pp
, "#pragma omp sections");
3085 dump_omp_clauses (pp
, OMP_SECTIONS_CLAUSES (node
), spc
, flags
);
3089 pp_string (pp
, "#pragma omp section");
3093 pp_string (pp
, "#pragma omp master");
3097 pp_string (pp
, "#pragma omp taskgroup");
3101 pp_string (pp
, "#pragma omp ordered");
3102 dump_omp_clauses (pp
, OMP_ORDERED_CLAUSES (node
), spc
, flags
);
3106 pp_string (pp
, "#pragma omp critical");
3107 if (OMP_CRITICAL_NAME (node
))
3111 dump_generic_node (pp
, OMP_CRITICAL_NAME (node
), spc
,
3113 pp_right_paren (pp
);
3115 dump_omp_clauses (pp
, OMP_CRITICAL_CLAUSES (node
), spc
, flags
);
3119 pp_string (pp
, "#pragma omp atomic");
3120 if (OMP_ATOMIC_SEQ_CST (node
))
3121 pp_string (pp
, " seq_cst");
3122 newline_and_indent (pp
, spc
+ 2);
3123 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3127 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3130 case OMP_ATOMIC_READ
:
3131 pp_string (pp
, "#pragma omp atomic read");
3132 if (OMP_ATOMIC_SEQ_CST (node
))
3133 pp_string (pp
, " seq_cst");
3134 newline_and_indent (pp
, spc
+ 2);
3135 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3139 case OMP_ATOMIC_CAPTURE_OLD
:
3140 case OMP_ATOMIC_CAPTURE_NEW
:
3141 pp_string (pp
, "#pragma omp atomic capture");
3142 if (OMP_ATOMIC_SEQ_CST (node
))
3143 pp_string (pp
, " seq_cst");
3144 newline_and_indent (pp
, spc
+ 2);
3145 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3149 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3153 pp_string (pp
, "#pragma omp single");
3154 dump_omp_clauses (pp
, OMP_SINGLE_CLAUSES (node
), spc
, flags
);
3158 dump_omp_clause (pp
, node
, spc
, flags
);
3162 case TRANSACTION_EXPR
:
3163 if (TRANSACTION_EXPR_OUTER (node
))
3164 pp_string (pp
, "__transaction_atomic [[outer]]");
3165 else if (TRANSACTION_EXPR_RELAXED (node
))
3166 pp_string (pp
, "__transaction_relaxed");
3168 pp_string (pp
, "__transaction_atomic");
3169 if (!(flags
& TDF_SLIM
) && TRANSACTION_EXPR_BODY (node
))
3171 newline_and_indent (pp
, spc
);
3173 newline_and_indent (pp
, spc
+ 2);
3174 dump_generic_node (pp
, TRANSACTION_EXPR_BODY (node
),
3175 spc
+ 2, flags
, false);
3176 newline_and_indent (pp
, spc
);
3177 pp_right_brace (pp
);
3182 case VEC_SERIES_EXPR
:
3183 case VEC_WIDEN_MULT_HI_EXPR
:
3184 case VEC_WIDEN_MULT_LO_EXPR
:
3185 case VEC_WIDEN_MULT_EVEN_EXPR
:
3186 case VEC_WIDEN_MULT_ODD_EXPR
:
3187 case VEC_WIDEN_LSHIFT_HI_EXPR
:
3188 case VEC_WIDEN_LSHIFT_LO_EXPR
:
3190 for (str
= get_tree_code_name (code
); *str
; str
++)
3191 pp_character (pp
, TOUPPER (*str
));
3192 pp_string (pp
, " < ");
3193 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3194 pp_string (pp
, ", ");
3195 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3196 pp_string (pp
, " > ");
3199 case VEC_DUPLICATE_EXPR
:
3201 for (str
= get_tree_code_name (code
); *str
; str
++)
3202 pp_character (pp
, TOUPPER (*str
));
3203 pp_string (pp
, " < ");
3204 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3205 pp_string (pp
, " > ");
3208 case VEC_UNPACK_HI_EXPR
:
3209 pp_string (pp
, " VEC_UNPACK_HI_EXPR < ");
3210 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3211 pp_string (pp
, " > ");
3214 case VEC_UNPACK_LO_EXPR
:
3215 pp_string (pp
, " VEC_UNPACK_LO_EXPR < ");
3216 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3217 pp_string (pp
, " > ");
3220 case VEC_UNPACK_FLOAT_HI_EXPR
:
3221 pp_string (pp
, " VEC_UNPACK_FLOAT_HI_EXPR < ");
3222 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3223 pp_string (pp
, " > ");
3226 case VEC_UNPACK_FLOAT_LO_EXPR
:
3227 pp_string (pp
, " VEC_UNPACK_FLOAT_LO_EXPR < ");
3228 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3229 pp_string (pp
, " > ");
3232 case VEC_PACK_TRUNC_EXPR
:
3233 pp_string (pp
, " VEC_PACK_TRUNC_EXPR < ");
3234 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3235 pp_string (pp
, ", ");
3236 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3237 pp_string (pp
, " > ");
3240 case VEC_PACK_SAT_EXPR
:
3241 pp_string (pp
, " VEC_PACK_SAT_EXPR < ");
3242 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3243 pp_string (pp
, ", ");
3244 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3245 pp_string (pp
, " > ");
3248 case VEC_PACK_FIX_TRUNC_EXPR
:
3249 pp_string (pp
, " VEC_PACK_FIX_TRUNC_EXPR < ");
3250 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3251 pp_string (pp
, ", ");
3252 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3253 pp_string (pp
, " > ");
3257 dump_block_node (pp
, node
, spc
, flags
);
3260 case DEBUG_BEGIN_STMT
:
3261 pp_string (pp
, "# DEBUG BEGIN STMT");
3268 if (is_stmt
&& is_expr
)
3274 /* Print the declaration of a variable. */
3277 print_declaration (pretty_printer
*pp
, tree t
, int spc
, dump_flags_t flags
)
3281 if (TREE_CODE(t
) == NAMELIST_DECL
)
3283 pp_string(pp
, "namelist ");
3284 dump_decl_name (pp
, t
, flags
);
3289 if (TREE_CODE (t
) == TYPE_DECL
)
3290 pp_string (pp
, "typedef ");
3292 if (CODE_CONTAINS_STRUCT (TREE_CODE (t
), TS_DECL_WRTL
) && DECL_REGISTER (t
))
3293 pp_string (pp
, "register ");
3295 if (TREE_PUBLIC (t
) && DECL_EXTERNAL (t
))
3296 pp_string (pp
, "extern ");
3297 else if (TREE_STATIC (t
))
3298 pp_string (pp
, "static ");
3300 /* Print the type and name. */
3301 if (TREE_TYPE (t
) && TREE_CODE (TREE_TYPE (t
)) == ARRAY_TYPE
)
3305 /* Print array's type. */
3306 tmp
= TREE_TYPE (t
);
3307 while (TREE_CODE (TREE_TYPE (tmp
)) == ARRAY_TYPE
)
3308 tmp
= TREE_TYPE (tmp
);
3309 dump_generic_node (pp
, TREE_TYPE (tmp
), spc
, flags
, false);
3311 /* Print variable's name. */
3313 dump_generic_node (pp
, t
, spc
, flags
, false);
3315 /* Print the dimensions. */
3316 tmp
= TREE_TYPE (t
);
3317 while (TREE_CODE (tmp
) == ARRAY_TYPE
)
3319 dump_array_domain (pp
, TYPE_DOMAIN (tmp
), spc
, flags
);
3320 tmp
= TREE_TYPE (tmp
);
3323 else if (TREE_CODE (t
) == FUNCTION_DECL
)
3325 dump_generic_node (pp
, TREE_TYPE (TREE_TYPE (t
)), spc
, flags
, false);
3327 dump_decl_name (pp
, t
, flags
);
3328 dump_function_declaration (pp
, TREE_TYPE (t
), spc
, flags
);
3332 /* Print type declaration. */
3333 dump_generic_node (pp
, TREE_TYPE (t
), spc
, flags
, false);
3335 /* Print variable's name. */
3337 dump_generic_node (pp
, t
, spc
, flags
, false);
3340 if (VAR_P (t
) && DECL_HARD_REGISTER (t
))
3342 pp_string (pp
, " __asm__ ");
3344 dump_generic_node (pp
, DECL_ASSEMBLER_NAME (t
), spc
, flags
, false);
3345 pp_right_paren (pp
);
3348 /* The initial value of a function serves to determine whether the function
3349 is declared or defined. So the following does not apply to function
3351 if (TREE_CODE (t
) != FUNCTION_DECL
)
3353 /* Print the initial value. */
3354 if (DECL_INITIAL (t
))
3359 if (!(flags
& TDF_SLIM
))
3360 dump_generic_node (pp
, DECL_INITIAL (t
), spc
, flags
, false);
3362 pp_string (pp
, "<<< omitted >>>");
3366 if (VAR_P (t
) && DECL_HAS_VALUE_EXPR_P (t
))
3368 pp_string (pp
, " [value-expr: ");
3369 dump_generic_node (pp
, DECL_VALUE_EXPR (t
), spc
, flags
, false);
3370 pp_right_bracket (pp
);
3377 /* Prints a structure: name, fields, and methods.
3378 FIXME: Still incomplete. */
3381 print_struct_decl (pretty_printer
*pp
, const_tree node
, int spc
,
3384 /* Print the name of the structure. */
3385 if (TYPE_NAME (node
))
3388 if (TREE_CODE (node
) == RECORD_TYPE
)
3389 pp_string (pp
, "struct ");
3390 else if ((TREE_CODE (node
) == UNION_TYPE
3391 || TREE_CODE (node
) == QUAL_UNION_TYPE
))
3392 pp_string (pp
, "union ");
3394 dump_generic_node (pp
, TYPE_NAME (node
), spc
, 0, false);
3397 /* Print the contents of the structure. */
3403 /* Print the fields of the structure. */
3406 tmp
= TYPE_FIELDS (node
);
3409 /* Avoid to print recursively the structure. */
3410 /* FIXME : Not implemented correctly...,
3411 what about the case when we have a cycle in the contain graph? ...
3412 Maybe this could be solved by looking at the scope in which the
3413 structure was declared. */
3414 if (TREE_TYPE (tmp
) != node
3415 && (TREE_CODE (TREE_TYPE (tmp
)) != POINTER_TYPE
3416 || TREE_TYPE (TREE_TYPE (tmp
)) != node
))
3418 print_declaration (pp
, tmp
, spc
+2, flags
);
3421 tmp
= DECL_CHAIN (tmp
);
3425 pp_right_brace (pp
);
3428 /* Return the priority of the operator CODE.
3430 From lowest to highest precedence with either left-to-right (L-R)
3431 or right-to-left (R-L) associativity]:
3434 2 [R-L] = += -= *= /= %= &= ^= |= <<= >>=
3446 14 [R-L] ! ~ ++ -- + - * & (type) sizeof
3447 15 [L-R] fn() [] -> .
3449 unary +, - and * have higher precedence than the corresponding binary
3453 op_code_prio (enum tree_code code
)
3470 case TRUTH_ORIF_EXPR
:
3473 case TRUTH_AND_EXPR
:
3474 case TRUTH_ANDIF_EXPR
:
3481 case TRUTH_XOR_EXPR
:
3498 case UNORDERED_EXPR
:
3509 case VEC_WIDEN_LSHIFT_HI_EXPR
:
3510 case VEC_WIDEN_LSHIFT_LO_EXPR
:
3511 case WIDEN_LSHIFT_EXPR
:
3514 case WIDEN_SUM_EXPR
:
3516 case POINTER_PLUS_EXPR
:
3517 case POINTER_DIFF_EXPR
:
3521 case VEC_WIDEN_MULT_HI_EXPR
:
3522 case VEC_WIDEN_MULT_LO_EXPR
:
3523 case WIDEN_MULT_EXPR
:
3525 case WIDEN_MULT_PLUS_EXPR
:
3526 case WIDEN_MULT_MINUS_EXPR
:
3528 case MULT_HIGHPART_EXPR
:
3529 case TRUNC_DIV_EXPR
:
3531 case FLOOR_DIV_EXPR
:
3532 case ROUND_DIV_EXPR
:
3534 case EXACT_DIV_EXPR
:
3535 case TRUNC_MOD_EXPR
:
3537 case FLOOR_MOD_EXPR
:
3538 case ROUND_MOD_EXPR
:
3542 case TRUTH_NOT_EXPR
:
3544 case POSTINCREMENT_EXPR
:
3545 case POSTDECREMENT_EXPR
:
3546 case PREINCREMENT_EXPR
:
3547 case PREDECREMENT_EXPR
:
3553 case FIX_TRUNC_EXPR
:
3559 case ARRAY_RANGE_REF
:
3563 /* Special expressions. */
3569 case VEC_UNPACK_HI_EXPR
:
3570 case VEC_UNPACK_LO_EXPR
:
3571 case VEC_UNPACK_FLOAT_HI_EXPR
:
3572 case VEC_UNPACK_FLOAT_LO_EXPR
:
3573 case VEC_PACK_TRUNC_EXPR
:
3574 case VEC_PACK_SAT_EXPR
:
3578 /* Return an arbitrarily high precedence to avoid surrounding single
3579 VAR_DECLs in ()s. */
3584 /* Return the priority of the operator OP. */
3587 op_prio (const_tree op
)
3589 enum tree_code code
;
3594 code
= TREE_CODE (op
);
3595 if (code
== SAVE_EXPR
|| code
== NON_LVALUE_EXPR
)
3596 return op_prio (TREE_OPERAND (op
, 0));
3598 return op_code_prio (code
);
3601 /* Return the symbol associated with operator CODE. */
3604 op_symbol_code (enum tree_code code
)
3612 case TRUTH_ORIF_EXPR
:
3615 case TRUTH_AND_EXPR
:
3616 case TRUTH_ANDIF_EXPR
:
3622 case TRUTH_XOR_EXPR
:
3632 case UNORDERED_EXPR
:
3678 case WIDEN_LSHIFT_EXPR
:
3681 case POINTER_PLUS_EXPR
:
3687 case WIDEN_SUM_EXPR
:
3690 case WIDEN_MULT_EXPR
:
3693 case MULT_HIGHPART_EXPR
:
3698 case POINTER_DIFF_EXPR
:
3704 case TRUTH_NOT_EXPR
:
3711 case TRUNC_DIV_EXPR
:
3718 case FLOOR_DIV_EXPR
:
3721 case ROUND_DIV_EXPR
:
3724 case EXACT_DIV_EXPR
:
3727 case TRUNC_MOD_EXPR
:
3733 case FLOOR_MOD_EXPR
:
3736 case ROUND_MOD_EXPR
:
3739 case PREDECREMENT_EXPR
:
3742 case PREINCREMENT_EXPR
:
3745 case POSTDECREMENT_EXPR
:
3748 case POSTINCREMENT_EXPR
:
3758 return "<<< ??? >>>";
3762 /* Return the symbol associated with operator OP. */
3765 op_symbol (const_tree op
)
3767 return op_symbol_code (TREE_CODE (op
));
3770 /* Prints the name of a call. NODE is the CALL_EXPR_FN of a CALL_EXPR or
3771 the gimple_call_fn of a GIMPLE_CALL. */
3774 print_call_name (pretty_printer
*pp
, tree node
, dump_flags_t flags
)
3778 if (TREE_CODE (op0
) == NON_LVALUE_EXPR
)
3779 op0
= TREE_OPERAND (op0
, 0);
3782 switch (TREE_CODE (op0
))
3787 dump_function_name (pp
, op0
, flags
);
3793 op0
= TREE_OPERAND (op0
, 0);
3798 dump_generic_node (pp
, TREE_OPERAND (op0
, 0), 0, flags
, false);
3799 pp_string (pp
, ") ? ");
3800 dump_generic_node (pp
, TREE_OPERAND (op0
, 1), 0, flags
, false);
3801 pp_string (pp
, " : ");
3802 dump_generic_node (pp
, TREE_OPERAND (op0
, 2), 0, flags
, false);
3806 if (TREE_CODE (TREE_OPERAND (op0
, 0)) == VAR_DECL
)
3807 dump_function_name (pp
, TREE_OPERAND (op0
, 0), flags
);
3809 dump_generic_node (pp
, op0
, 0, flags
, false);
3813 if (integer_zerop (TREE_OPERAND (op0
, 1)))
3815 op0
= TREE_OPERAND (op0
, 0);
3822 dump_generic_node (pp
, op0
, 0, flags
, false);
3830 /* Parses the string STR and replaces new-lines by '\n', tabs by '\t', ... */
3833 pretty_print_string (pretty_printer
*pp
, const char *str
)
3843 pp_string (pp
, "\\b");
3847 pp_string (pp
, "\\f");
3851 pp_string (pp
, "\\n");
3855 pp_string (pp
, "\\r");
3859 pp_string (pp
, "\\t");
3863 pp_string (pp
, "\\v");
3867 pp_string (pp
, "\\\\");
3871 pp_string (pp
, "\\\"");
3875 pp_string (pp
, "\\'");
3878 /* No need to handle \0; the loop terminates on \0. */
3881 pp_string (pp
, "\\1");
3885 pp_string (pp
, "\\2");
3889 pp_string (pp
, "\\3");
3893 pp_string (pp
, "\\4");
3897 pp_string (pp
, "\\5");
3901 pp_string (pp
, "\\6");
3905 pp_string (pp
, "\\7");
3909 if (!ISPRINT (str
[0]))
3912 sprintf (buf
, "\\x%x", (unsigned char)str
[0]);
3913 pp_string (pp
, buf
);
3916 pp_character (pp
, str
[0]);
3924 maybe_init_pretty_print (FILE *file
)
3928 tree_pp
= new pretty_printer ();
3929 pp_needs_newline (tree_pp
) = true;
3930 pp_translate_identifiers (tree_pp
) = false;
3933 tree_pp
->buffer
->stream
= file
;
3937 newline_and_indent (pretty_printer
*pp
, int spc
)
3943 /* Handle the %K format for TEXT. Separate from default_tree_printer
3944 so it can also be used in front ends.
3945 Argument is a statement from which EXPR_LOCATION and TREE_BLOCK will
3949 percent_K_format (text_info
*text
, tree t
)
3951 text
->set_location (0, EXPR_LOCATION (t
), true);
3952 gcc_assert (pp_ti_abstract_origin (text
) != NULL
);
3953 tree block
= TREE_BLOCK (t
);
3954 *pp_ti_abstract_origin (text
) = NULL
;
3958 /* ??? LTO drops all BLOCK_ABSTRACT_ORIGINs apart from those
3959 representing the outermost block of an inlined function.
3960 So walk the BLOCK tree until we hit such a scope. */
3962 && TREE_CODE (block
) == BLOCK
)
3964 if (inlined_function_outer_scope_p (block
))
3966 *pp_ti_abstract_origin (text
) = block
;
3969 block
= BLOCK_SUPERCONTEXT (block
);
3975 && TREE_CODE (block
) == BLOCK
3976 && BLOCK_ABSTRACT_ORIGIN (block
))
3978 tree ao
= BLOCK_ABSTRACT_ORIGIN (block
);
3980 while (TREE_CODE (ao
) == BLOCK
3981 && BLOCK_ABSTRACT_ORIGIN (ao
)
3982 && BLOCK_ABSTRACT_ORIGIN (ao
) != ao
)
3983 ao
= BLOCK_ABSTRACT_ORIGIN (ao
);
3985 if (TREE_CODE (ao
) == FUNCTION_DECL
)
3987 *pp_ti_abstract_origin (text
) = block
;
3990 block
= BLOCK_SUPERCONTEXT (block
);
3994 /* Print the identifier ID to PRETTY-PRINTER. */
3997 pp_tree_identifier (pretty_printer
*pp
, tree id
)
3999 if (pp_translate_identifiers (pp
))
4001 const char *text
= identifier_to_locale (IDENTIFIER_POINTER (id
));
4002 pp_append_text (pp
, text
, text
+ strlen (text
));
4005 pp_append_text (pp
, IDENTIFIER_POINTER (id
),
4006 IDENTIFIER_POINTER (id
) + IDENTIFIER_LENGTH (id
));
4009 /* A helper function that is used to dump function information before the
4013 dump_function_header (FILE *dump_file
, tree fdecl
, dump_flags_t flags
)
4015 const char *dname
, *aname
;
4016 struct cgraph_node
*node
= cgraph_node::get (fdecl
);
4017 struct function
*fun
= DECL_STRUCT_FUNCTION (fdecl
);
4019 dname
= lang_hooks
.decl_printable_name (fdecl
, 1);
4021 if (DECL_ASSEMBLER_NAME_SET_P (fdecl
))
4022 aname
= (IDENTIFIER_POINTER
4023 (DECL_ASSEMBLER_NAME (fdecl
)));
4025 aname
= "<unset-asm-name>";
4027 fprintf (dump_file
, "\n;; Function %s (%s, funcdef_no=%d",
4028 dname
, aname
, fun
->funcdef_no
);
4029 if (!(flags
& TDF_NOUID
))
4030 fprintf (dump_file
, ", decl_uid=%d", DECL_UID (fdecl
));
4033 fprintf (dump_file
, ", cgraph_uid=%d", node
->uid
);
4034 fprintf (dump_file
, ", symbol_order=%d)%s\n\n", node
->order
,
4035 node
->frequency
== NODE_FREQUENCY_HOT
4037 : node
->frequency
== NODE_FREQUENCY_UNLIKELY_EXECUTED
4038 ? " (unlikely executed)"
4039 : node
->frequency
== NODE_FREQUENCY_EXECUTED_ONCE
4040 ? " (executed once)"
4044 fprintf (dump_file
, ")\n\n");
4047 /* Dump double_int D to pretty_printer PP. UNS is true
4048 if D is unsigned and false otherwise. */
4050 pp_double_int (pretty_printer
*pp
, double_int d
, bool uns
)
4053 pp_wide_integer (pp
, d
.low
);
4054 else if (d
.fits_uhwi ())
4055 pp_unsigned_wide_integer (pp
, d
.low
);
4058 unsigned HOST_WIDE_INT low
= d
.low
;
4059 HOST_WIDE_INT high
= d
.high
;
4060 if (!uns
&& d
.is_negative ())
4063 high
= ~high
+ !low
;
4066 /* Would "%x%0*x" or "%x%*0x" get zero-padding on all
4068 sprintf (pp_buffer (pp
)->digit_buffer
,
4069 HOST_WIDE_INT_PRINT_DOUBLE_HEX
,
4070 (unsigned HOST_WIDE_INT
) high
, low
);
4071 pp_string (pp
, pp_buffer (pp
)->digit_buffer
);