1 /* Pretty formatting of GENERIC trees in C syntax.
2 Copyright (C) 2001-2022 Free Software Foundation, Inc.
3 Adapted from c-pretty-print.cc 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 #include "fold-const.h"
39 /* Routines in this file get invoked via the default tree printer
40 used by diagnostics and thus they are called from pp_printf which
41 isn't reentrant. Avoid using pp_printf in this file. */
42 #pragma GCC poison pp_printf
44 /* Disable warnings about quoting issues in the pp_xxx calls below
45 that (intentionally) don't follow GCC diagnostic conventions. */
47 # pragma GCC diagnostic push
48 # pragma GCC diagnostic ignored "-Wformat-diag"
51 /* Local functions, macros and variables. */
52 static const char *op_symbol (const_tree
);
53 static void newline_and_indent (pretty_printer
*, int);
54 static void maybe_init_pretty_print (FILE *);
55 static void print_struct_decl (pretty_printer
*, const_tree
, int, dump_flags_t
);
56 static void do_niy (pretty_printer
*, const_tree
, int, dump_flags_t
);
58 #define INDENT(SPACE) do { \
59 int i; for (i = 0; i<SPACE; i++) pp_space (pp); } while (0)
61 #define NIY do_niy (pp, node, spc, flags)
63 static pretty_printer
*tree_pp
;
65 /* Try to print something for an unknown tree code. */
68 do_niy (pretty_printer
*pp
, const_tree node
, int spc
, dump_flags_t flags
)
72 pp_string (pp
, "<<< Unknown tree: ");
73 pp_string (pp
, get_tree_code_name (TREE_CODE (node
)));
77 len
= TREE_OPERAND_LENGTH (node
);
78 for (i
= 0; i
< len
; ++i
)
80 newline_and_indent (pp
, spc
+2);
81 dump_generic_node (pp
, TREE_OPERAND (node
, i
), spc
+2, flags
, false);
85 pp_string (pp
, " >>>");
88 /* Debugging function to print out a generic expression. */
91 debug_generic_expr (tree t
)
93 print_generic_expr (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
);
94 fprintf (stderr
, "\n");
97 /* Debugging function to print out a generic statement. */
100 debug_generic_stmt (tree t
)
102 print_generic_stmt (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
);
103 fprintf (stderr
, "\n");
106 /* Debugging function to print out a chain of trees . */
109 debug_tree_chain (tree t
)
115 print_generic_expr (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
|TDF_UID
);
116 fprintf (stderr
, " ");
120 fprintf (stderr
, "... [cycled back to ");
121 print_generic_expr (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
|TDF_UID
);
122 fprintf (stderr
, "]");
126 fprintf (stderr
, "\n");
129 /* Prints declaration DECL to the FILE with details specified by FLAGS. */
131 print_generic_decl (FILE *file
, tree decl
, dump_flags_t flags
)
133 maybe_init_pretty_print (file
);
134 print_declaration (tree_pp
, decl
, 2, flags
);
135 pp_write_text_to_stream (tree_pp
);
138 /* Print tree T, and its successors, on file FILE. FLAGS specifies details
139 to show in the dump. See TDF_* in dumpfile.h. */
142 print_generic_stmt (FILE *file
, tree t
, dump_flags_t flags
)
144 maybe_init_pretty_print (file
);
145 dump_generic_node (tree_pp
, t
, 0, flags
, true);
146 pp_newline_and_flush (tree_pp
);
149 /* Print tree T, and its successors, on file FILE. FLAGS specifies details
150 to show in the dump. See TDF_* in dumpfile.h. The output is indented by
154 print_generic_stmt_indented (FILE *file
, tree t
, dump_flags_t flags
, int indent
)
158 maybe_init_pretty_print (file
);
160 for (i
= 0; i
< indent
; i
++)
162 dump_generic_node (tree_pp
, t
, indent
, flags
, true);
163 pp_newline_and_flush (tree_pp
);
166 /* Print a single expression T on file FILE. FLAGS specifies details to show
167 in the dump. See TDF_* in dumpfile.h. */
170 print_generic_expr (FILE *file
, tree t
, dump_flags_t flags
)
172 maybe_init_pretty_print (file
);
173 dump_generic_node (tree_pp
, t
, 0, flags
, false);
177 /* Print a single expression T to string, and return it. The caller
178 must free the returned memory. */
181 print_generic_expr_to_str (tree t
)
184 dump_generic_node (&pp
, t
, 0, TDF_VOPS
|TDF_MEMSYMS
, false);
185 return xstrdup (pp_formatted_text (&pp
));
188 /* Dump NAME, an IDENTIFIER_POINTER, sanitized so that D<num> sequences
189 in it are replaced with Dxxxx, as long as they are at the start or
190 preceded by $ and at the end or followed by $. See make_fancy_name
194 dump_fancy_name (pretty_printer
*pp
, tree name
)
197 int length
= IDENTIFIER_LENGTH (name
);
198 const char *n
= IDENTIFIER_POINTER (name
);
205 && (n
== IDENTIFIER_POINTER (name
) || n
[-1] == '$'))
208 while (ISDIGIT (n
[l
]))
210 if (n
[l
] == '\0' || n
[l
] == '$')
223 pp_tree_identifier (pp
, name
);
227 char *str
= XNEWVEC (char, length
+ 1);
230 q
= n
= IDENTIFIER_POINTER (name
);
237 && (q
== IDENTIFIER_POINTER (name
) || q
[-1] == '$'))
240 while (ISDIGIT (q
[l
]))
242 if (q
[l
] == '\0' || q
[l
] == '$')
244 memcpy (p
, n
, q
- n
);
245 memcpy (p
+ (q
- n
), "Dxxxx", 5);
255 memcpy (p
, n
, IDENTIFIER_LENGTH (name
) - (n
- IDENTIFIER_POINTER (name
)));
257 if (pp_translate_identifiers (pp
))
259 const char *text
= identifier_to_locale (str
);
260 pp_append_text (pp
, text
, text
+ strlen (text
));
263 pp_append_text (pp
, str
, str
+ length
);
267 /* Dump the name of a _DECL node and its DECL_UID if TDF_UID is set
271 dump_decl_name (pretty_printer
*pp
, tree node
, dump_flags_t flags
)
273 tree name
= DECL_NAME (node
);
276 if ((flags
& TDF_ASMNAME
)
277 && HAS_DECL_ASSEMBLER_NAME_P (node
)
278 && DECL_ASSEMBLER_NAME_SET_P (node
))
279 pp_tree_identifier (pp
, DECL_ASSEMBLER_NAME_RAW (node
));
280 /* For -fcompare-debug don't dump DECL_NAMELESS names at all,
281 -g might have created more fancy names and their indexes
282 could get out of sync. Usually those should be DECL_IGNORED_P
283 too, SRA can create even non-DECL_IGNORED_P DECL_NAMELESS fancy
284 names, let's hope those never get out of sync after doing the
285 dump_fancy_name sanitization. */
286 else if ((flags
& TDF_COMPARE_DEBUG
)
287 && DECL_NAMELESS (node
)
288 && DECL_IGNORED_P (node
))
290 /* For DECL_NAMELESS names look for embedded uids in the
291 names and sanitize them for TDF_NOUID. */
292 else if ((flags
& TDF_NOUID
) && DECL_NAMELESS (node
))
293 dump_fancy_name (pp
, name
);
295 pp_tree_identifier (pp
, name
);
297 char uid_sep
= (flags
& TDF_GIMPLE
) ? '_' : '.';
298 if ((flags
& TDF_UID
) || name
== NULL_TREE
)
300 if (TREE_CODE (node
) == LABEL_DECL
&& LABEL_DECL_UID (node
) != -1)
302 pp_character (pp
, 'L');
303 pp_character (pp
, uid_sep
);
304 pp_decimal_int (pp
, (int) LABEL_DECL_UID (node
));
306 else if (TREE_CODE (node
) == DEBUG_EXPR_DECL
)
308 if (flags
& TDF_NOUID
)
309 pp_string (pp
, "D#xxxx");
312 pp_string (pp
, "D#");
313 pp_decimal_int (pp
, (int) DEBUG_TEMP_UID (node
));
318 char c
= TREE_CODE (node
) == CONST_DECL
? 'C' : 'D';
319 pp_character (pp
, c
);
320 pp_character (pp
, uid_sep
);
321 if (flags
& TDF_NOUID
)
322 pp_string (pp
, "xxxx");
324 pp_scalar (pp
, "%u", DECL_UID (node
));
327 if ((flags
& TDF_ALIAS
) && DECL_PT_UID (node
) != DECL_UID (node
))
329 if (flags
& TDF_NOUID
)
330 pp_string (pp
, "ptD.xxxx");
333 pp_string (pp
, "ptD.");
334 pp_scalar (pp
, "%u", DECL_PT_UID (node
));
339 /* Like the above, but used for pretty printing function calls. */
342 dump_function_name (pretty_printer
*pp
, tree node
, dump_flags_t flags
)
344 if (CONVERT_EXPR_P (node
))
345 node
= TREE_OPERAND (node
, 0);
346 if (DECL_NAME (node
) && (flags
& TDF_ASMNAME
) == 0)
348 pp_string (pp
, lang_hooks
.decl_printable_name (node
, 1));
351 char uid_sep
= (flags
& TDF_GIMPLE
) ? '_' : '.';
352 pp_character (pp
, 'D');
353 pp_character (pp
, uid_sep
);
354 pp_scalar (pp
, "%u", DECL_UID (node
));
358 dump_decl_name (pp
, node
, flags
);
361 /* Dump a function declaration. NODE is the FUNCTION_TYPE. PP, SPC and
362 FLAGS are as in dump_generic_node. */
365 dump_function_declaration (pretty_printer
*pp
, tree node
,
366 int spc
, dump_flags_t flags
)
368 bool wrote_arg
= false;
374 /* Print the argument types. */
375 arg
= TYPE_ARG_TYPES (node
);
376 while (arg
&& arg
!= void_list_node
&& arg
!= error_mark_node
)
384 dump_generic_node (pp
, TREE_VALUE (arg
), spc
, flags
, false);
385 arg
= TREE_CHAIN (arg
);
388 /* Drop the trailing void_type_node if we had any previous argument. */
389 if (arg
== void_list_node
&& !wrote_arg
)
390 pp_string (pp
, "void");
391 /* Properly dump vararg function types. */
392 else if (!arg
&& wrote_arg
)
393 pp_string (pp
, ", ...");
394 /* Avoid printing any arg for unprototyped functions. */
399 /* Dump the domain associated with an array. */
402 dump_array_domain (pretty_printer
*pp
, tree domain
, int spc
, dump_flags_t flags
)
404 pp_left_bracket (pp
);
407 tree min
= TYPE_MIN_VALUE (domain
);
408 tree max
= TYPE_MAX_VALUE (domain
);
411 && integer_zerop (min
)
412 && tree_fits_shwi_p (max
))
413 pp_wide_integer (pp
, tree_to_shwi (max
) + 1);
417 dump_generic_node (pp
, min
, spc
, flags
, false);
420 dump_generic_node (pp
, max
, spc
, flags
, false);
424 pp_string (pp
, "<unknown>");
425 pp_right_bracket (pp
);
429 /* Dump OpenMP iterators ITER. */
432 dump_omp_iterators (pretty_printer
*pp
, tree iter
, int spc
, dump_flags_t flags
)
434 pp_string (pp
, "iterator(");
435 for (tree it
= iter
; it
; it
= TREE_CHAIN (it
))
438 pp_string (pp
, ", ");
439 dump_generic_node (pp
, TREE_TYPE (TREE_VEC_ELT (it
, 0)), spc
, flags
,
442 dump_generic_node (pp
, TREE_VEC_ELT (it
, 0), spc
, flags
, false);
444 dump_generic_node (pp
, TREE_VEC_ELT (it
, 1), spc
, flags
, false);
446 dump_generic_node (pp
, TREE_VEC_ELT (it
, 2), spc
, flags
, false);
448 dump_generic_node (pp
, TREE_VEC_ELT (it
, 3), spc
, flags
, false);
454 /* Dump OMP clause CLAUSE, without following OMP_CLAUSE_CHAIN.
456 PP, CLAUSE, SPC and FLAGS are as in dump_generic_node. */
459 dump_omp_clause (pretty_printer
*pp
, tree clause
, int spc
, dump_flags_t flags
)
462 const char *modifier
= NULL
;
463 switch (OMP_CLAUSE_CODE (clause
))
465 case OMP_CLAUSE_PRIVATE
:
468 case OMP_CLAUSE_SHARED
:
471 case OMP_CLAUSE_FIRSTPRIVATE
:
472 name
= "firstprivate";
474 case OMP_CLAUSE_LASTPRIVATE
:
475 name
= "lastprivate";
476 if (OMP_CLAUSE_LASTPRIVATE_CONDITIONAL (clause
))
477 modifier
= "conditional:";
479 case OMP_CLAUSE_COPYIN
:
482 case OMP_CLAUSE_COPYPRIVATE
:
483 name
= "copyprivate";
485 case OMP_CLAUSE_UNIFORM
:
488 case OMP_CLAUSE_USE_DEVICE_PTR
:
489 name
= "use_device_ptr";
490 if (OMP_CLAUSE_USE_DEVICE_PTR_IF_PRESENT (clause
))
491 modifier
= "if_present:";
493 case OMP_CLAUSE_USE_DEVICE_ADDR
:
494 name
= "use_device_addr";
496 case OMP_CLAUSE_HAS_DEVICE_ADDR
:
497 name
= "has_device_addr";
499 case OMP_CLAUSE_IS_DEVICE_PTR
:
500 name
= "is_device_ptr";
502 case OMP_CLAUSE_INCLUSIVE
:
505 case OMP_CLAUSE_EXCLUSIVE
:
508 case OMP_CLAUSE__LOOPTEMP_
:
511 case OMP_CLAUSE__REDUCTEMP_
:
512 name
= "_reductemp_";
514 case OMP_CLAUSE__CONDTEMP_
:
517 case OMP_CLAUSE__SCANTEMP_
:
520 case OMP_CLAUSE_ENTER
:
521 if (OMP_CLAUSE_ENTER_TO (clause
))
526 case OMP_CLAUSE_LINK
:
529 case OMP_CLAUSE_NONTEMPORAL
:
530 name
= "nontemporal";
533 pp_string (pp
, name
);
536 pp_string (pp
, modifier
);
537 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
542 case OMP_CLAUSE_TASK_REDUCTION
:
543 case OMP_CLAUSE_IN_REDUCTION
:
544 pp_string (pp
, OMP_CLAUSE_CODE (clause
) == OMP_CLAUSE_IN_REDUCTION
547 case OMP_CLAUSE_REDUCTION
:
548 pp_string (pp
, "reduction(");
549 if (OMP_CLAUSE_CODE (clause
) == OMP_CLAUSE_REDUCTION
)
551 if (OMP_CLAUSE_REDUCTION_TASK (clause
))
552 pp_string (pp
, "task,");
553 else if (OMP_CLAUSE_REDUCTION_INSCAN (clause
))
554 pp_string (pp
, "inscan,");
556 if (OMP_CLAUSE_REDUCTION_CODE (clause
) != ERROR_MARK
)
559 op_symbol_code (OMP_CLAUSE_REDUCTION_CODE (clause
)));
562 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
568 pp_string (pp
, "if(");
569 switch (OMP_CLAUSE_IF_MODIFIER (clause
))
571 case ERROR_MARK
: break;
572 case VOID_CST
: pp_string (pp
, "cancel:"); break;
573 case OMP_PARALLEL
: pp_string (pp
, "parallel:"); break;
574 case OMP_SIMD
: pp_string (pp
, "simd:"); break;
575 case OMP_TASK
: pp_string (pp
, "task:"); break;
576 case OMP_TASKLOOP
: pp_string (pp
, "taskloop:"); break;
577 case OMP_TARGET_DATA
: pp_string (pp
, "target data:"); break;
578 case OMP_TARGET
: pp_string (pp
, "target:"); break;
579 case OMP_TARGET_UPDATE
: pp_string (pp
, "target update:"); break;
580 case OMP_TARGET_ENTER_DATA
:
581 pp_string (pp
, "target enter data:"); break;
582 case OMP_TARGET_EXIT_DATA
: pp_string (pp
, "target exit data:"); break;
583 default: gcc_unreachable ();
585 dump_generic_node (pp
, OMP_CLAUSE_IF_EXPR (clause
),
590 case OMP_CLAUSE_NUM_THREADS
:
591 pp_string (pp
, "num_threads(");
592 dump_generic_node (pp
, OMP_CLAUSE_NUM_THREADS_EXPR (clause
),
597 case OMP_CLAUSE_NOWAIT
:
598 pp_string (pp
, "nowait");
600 case OMP_CLAUSE_ORDERED
:
601 pp_string (pp
, "ordered");
602 if (OMP_CLAUSE_ORDERED_EXPR (clause
))
605 dump_generic_node (pp
, OMP_CLAUSE_ORDERED_EXPR (clause
),
611 case OMP_CLAUSE_DEFAULT
:
612 pp_string (pp
, "default(");
613 switch (OMP_CLAUSE_DEFAULT_KIND (clause
))
615 case OMP_CLAUSE_DEFAULT_UNSPECIFIED
:
617 case OMP_CLAUSE_DEFAULT_SHARED
:
618 pp_string (pp
, "shared");
620 case OMP_CLAUSE_DEFAULT_NONE
:
621 pp_string (pp
, "none");
623 case OMP_CLAUSE_DEFAULT_PRIVATE
:
624 pp_string (pp
, "private");
626 case OMP_CLAUSE_DEFAULT_FIRSTPRIVATE
:
627 pp_string (pp
, "firstprivate");
629 case OMP_CLAUSE_DEFAULT_PRESENT
:
630 pp_string (pp
, "present");
638 case OMP_CLAUSE_SCHEDULE
:
639 pp_string (pp
, "schedule(");
640 if (OMP_CLAUSE_SCHEDULE_KIND (clause
)
641 & (OMP_CLAUSE_SCHEDULE_MONOTONIC
642 | OMP_CLAUSE_SCHEDULE_NONMONOTONIC
))
644 if (OMP_CLAUSE_SCHEDULE_KIND (clause
)
645 & OMP_CLAUSE_SCHEDULE_MONOTONIC
)
646 pp_string (pp
, "monotonic");
648 pp_string (pp
, "nonmonotonic");
649 if (OMP_CLAUSE_SCHEDULE_SIMD (clause
))
654 if (OMP_CLAUSE_SCHEDULE_SIMD (clause
))
655 pp_string (pp
, "simd:");
657 switch (OMP_CLAUSE_SCHEDULE_KIND (clause
) & OMP_CLAUSE_SCHEDULE_MASK
)
659 case OMP_CLAUSE_SCHEDULE_STATIC
:
660 pp_string (pp
, "static");
662 case OMP_CLAUSE_SCHEDULE_DYNAMIC
:
663 pp_string (pp
, "dynamic");
665 case OMP_CLAUSE_SCHEDULE_GUIDED
:
666 pp_string (pp
, "guided");
668 case OMP_CLAUSE_SCHEDULE_RUNTIME
:
669 pp_string (pp
, "runtime");
671 case OMP_CLAUSE_SCHEDULE_AUTO
:
672 pp_string (pp
, "auto");
677 if (OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (clause
))
680 dump_generic_node (pp
, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (clause
),
686 case OMP_CLAUSE_UNTIED
:
687 pp_string (pp
, "untied");
690 case OMP_CLAUSE_COLLAPSE
:
691 pp_string (pp
, "collapse(");
692 dump_generic_node (pp
, OMP_CLAUSE_COLLAPSE_EXPR (clause
),
697 case OMP_CLAUSE_FINAL
:
698 pp_string (pp
, "final(");
699 dump_generic_node (pp
, OMP_CLAUSE_FINAL_EXPR (clause
),
704 case OMP_CLAUSE_MERGEABLE
:
705 pp_string (pp
, "mergeable");
708 case OMP_CLAUSE_LINEAR
:
709 pp_string (pp
, "linear(");
710 if (OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER (clause
))
711 switch (OMP_CLAUSE_LINEAR_KIND (clause
))
713 case OMP_CLAUSE_LINEAR_DEFAULT
:
715 case OMP_CLAUSE_LINEAR_REF
:
716 pp_string (pp
, "ref(");
718 case OMP_CLAUSE_LINEAR_VAL
:
719 pp_string (pp
, "val(");
721 case OMP_CLAUSE_LINEAR_UVAL
:
722 pp_string (pp
, "uval(");
727 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
729 if (OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER (clause
)
730 && OMP_CLAUSE_LINEAR_KIND (clause
) != OMP_CLAUSE_LINEAR_DEFAULT
)
733 if (!OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER (clause
)
734 && OMP_CLAUSE_LINEAR_KIND (clause
) != OMP_CLAUSE_LINEAR_DEFAULT
)
735 switch (OMP_CLAUSE_LINEAR_KIND (clause
))
737 case OMP_CLAUSE_LINEAR_REF
:
738 pp_string (pp
, "ref,step(");
740 case OMP_CLAUSE_LINEAR_VAL
:
741 pp_string (pp
, "val,step(");
743 case OMP_CLAUSE_LINEAR_UVAL
:
744 pp_string (pp
, "uval,step(");
749 dump_generic_node (pp
, OMP_CLAUSE_LINEAR_STEP (clause
),
751 if (!OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER (clause
)
752 && OMP_CLAUSE_LINEAR_KIND (clause
) != OMP_CLAUSE_LINEAR_DEFAULT
)
757 case OMP_CLAUSE_ALIGNED
:
758 pp_string (pp
, "aligned(");
759 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
761 if (OMP_CLAUSE_ALIGNED_ALIGNMENT (clause
))
764 dump_generic_node (pp
, OMP_CLAUSE_ALIGNED_ALIGNMENT (clause
),
770 case OMP_CLAUSE_ALLOCATE
:
771 pp_string (pp
, "allocate(");
772 if (OMP_CLAUSE_ALLOCATE_ALLOCATOR (clause
))
774 pp_string (pp
, "allocator(");
775 dump_generic_node (pp
, OMP_CLAUSE_ALLOCATE_ALLOCATOR (clause
),
779 if (OMP_CLAUSE_ALLOCATE_ALIGN (clause
))
781 if (OMP_CLAUSE_ALLOCATE_ALLOCATOR (clause
))
783 pp_string (pp
, "align(");
784 dump_generic_node (pp
, OMP_CLAUSE_ALLOCATE_ALIGN (clause
),
788 if (OMP_CLAUSE_ALLOCATE_ALLOCATOR (clause
)
789 || OMP_CLAUSE_ALLOCATE_ALIGN (clause
))
791 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
796 case OMP_CLAUSE_AFFINITY
:
797 pp_string (pp
, "affinity(");
799 tree t
= OMP_CLAUSE_DECL (clause
);
800 if (TREE_CODE (t
) == TREE_LIST
802 && TREE_CODE (TREE_PURPOSE (t
)) == TREE_VEC
)
804 dump_omp_iterators (pp
, TREE_PURPOSE (t
), spc
, flags
);
808 dump_generic_node (pp
, t
, spc
, flags
, false);
812 case OMP_CLAUSE_DEPEND
:
813 pp_string (pp
, "depend(");
814 switch (OMP_CLAUSE_DEPEND_KIND (clause
))
816 case OMP_CLAUSE_DEPEND_DEPOBJ
:
819 case OMP_CLAUSE_DEPEND_IN
:
822 case OMP_CLAUSE_DEPEND_OUT
:
825 case OMP_CLAUSE_DEPEND_INOUT
:
828 case OMP_CLAUSE_DEPEND_MUTEXINOUTSET
:
829 name
= "mutexinoutset";
831 case OMP_CLAUSE_DEPEND_INOUTSET
:
834 case OMP_CLAUSE_DEPEND_LAST
:
835 name
= "__internal__";
841 tree t
= OMP_CLAUSE_DECL (clause
);
842 if (TREE_CODE (t
) == TREE_LIST
844 && TREE_CODE (TREE_PURPOSE (t
)) == TREE_VEC
)
846 dump_omp_iterators (pp
, TREE_PURPOSE (t
), spc
, flags
);
852 pp_string (pp
, name
);
855 if (t
== null_pointer_node
)
856 pp_string (pp
, "omp_all_memory");
858 dump_generic_node (pp
, t
, spc
, flags
, false);
863 case OMP_CLAUSE_DOACROSS
:
864 pp_string (pp
, OMP_CLAUSE_DOACROSS_DEPEND (clause
)
865 ? "depend(" : "doacross(");
866 switch (OMP_CLAUSE_DOACROSS_KIND (clause
))
868 case OMP_CLAUSE_DOACROSS_SOURCE
:
869 if (OMP_CLAUSE_DOACROSS_DEPEND (clause
))
870 pp_string (pp
, "source)");
872 pp_string (pp
, "source:)");
874 case OMP_CLAUSE_DOACROSS_SINK
:
875 pp_string (pp
, "sink:");
876 if (OMP_CLAUSE_DECL (clause
) == NULL_TREE
)
878 pp_string (pp
, "omp_cur_iteration-1)");
881 for (tree t
= OMP_CLAUSE_DECL (clause
); t
; t
= TREE_CHAIN (t
))
882 if (TREE_CODE (t
) == TREE_LIST
)
884 dump_generic_node (pp
, TREE_VALUE (t
), spc
, flags
, false);
885 if (TREE_PURPOSE (t
) != integer_zero_node
)
887 if (OMP_CLAUSE_DOACROSS_SINK_NEGATIVE (t
))
891 dump_generic_node (pp
, TREE_PURPOSE (t
), spc
, flags
,
907 pp_string (pp
, "map(");
908 switch (OMP_CLAUSE_MAP_KIND (clause
))
911 case GOMP_MAP_POINTER
:
912 case GOMP_MAP_POINTER_TO_ZERO_LENGTH_ARRAY_SECTION
:
913 pp_string (pp
, "alloc");
915 case GOMP_MAP_IF_PRESENT
:
916 pp_string (pp
, "no_alloc");
919 case GOMP_MAP_TO_PSET
:
920 pp_string (pp
, "to");
923 pp_string (pp
, "from");
925 case GOMP_MAP_TOFROM
:
926 pp_string (pp
, "tofrom");
928 case GOMP_MAP_FORCE_ALLOC
:
929 pp_string (pp
, "force_alloc");
931 case GOMP_MAP_FORCE_TO
:
932 pp_string (pp
, "force_to");
934 case GOMP_MAP_FORCE_FROM
:
935 pp_string (pp
, "force_from");
937 case GOMP_MAP_FORCE_TOFROM
:
938 pp_string (pp
, "force_tofrom");
940 case GOMP_MAP_FORCE_PRESENT
:
941 pp_string (pp
, "force_present");
943 case GOMP_MAP_DELETE
:
944 pp_string (pp
, "delete");
946 case GOMP_MAP_FORCE_DEVICEPTR
:
947 pp_string (pp
, "force_deviceptr");
949 case GOMP_MAP_ALWAYS_TO
:
950 pp_string (pp
, "always,to");
952 case GOMP_MAP_ALWAYS_FROM
:
953 pp_string (pp
, "always,from");
955 case GOMP_MAP_ALWAYS_TOFROM
:
956 pp_string (pp
, "always,tofrom");
958 case GOMP_MAP_RELEASE
:
959 pp_string (pp
, "release");
961 case GOMP_MAP_FIRSTPRIVATE_POINTER
:
962 pp_string (pp
, "firstprivate");
964 case GOMP_MAP_FIRSTPRIVATE_REFERENCE
:
965 pp_string (pp
, "firstprivate ref");
967 case GOMP_MAP_STRUCT
:
968 pp_string (pp
, "struct");
970 case GOMP_MAP_ALWAYS_POINTER
:
971 pp_string (pp
, "always_pointer");
973 case GOMP_MAP_DEVICE_RESIDENT
:
974 pp_string (pp
, "device_resident");
977 pp_string (pp
, "link");
979 case GOMP_MAP_ATTACH
:
980 pp_string (pp
, "attach");
982 case GOMP_MAP_DETACH
:
983 pp_string (pp
, "detach");
985 case GOMP_MAP_FORCE_DETACH
:
986 pp_string (pp
, "force_detach");
988 case GOMP_MAP_ATTACH_DETACH
:
989 pp_string (pp
, "attach_detach");
991 case GOMP_MAP_ATTACH_ZERO_LENGTH_ARRAY_SECTION
:
992 pp_string (pp
, "attach_zero_length_array_section");
998 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
1001 if (OMP_CLAUSE_SIZE (clause
))
1003 switch (OMP_CLAUSE_CODE (clause
) == OMP_CLAUSE_MAP
1004 ? OMP_CLAUSE_MAP_KIND (clause
) : GOMP_MAP_TO
)
1006 case GOMP_MAP_POINTER
:
1007 case GOMP_MAP_FIRSTPRIVATE_POINTER
:
1008 case GOMP_MAP_FIRSTPRIVATE_REFERENCE
:
1009 case GOMP_MAP_ALWAYS_POINTER
:
1010 pp_string (pp
, " [pointer assign, bias: ");
1012 case GOMP_MAP_POINTER_TO_ZERO_LENGTH_ARRAY_SECTION
:
1013 pp_string (pp
, " [pointer assign, zero-length array section, bias: ");
1015 case GOMP_MAP_TO_PSET
:
1016 pp_string (pp
, " [pointer set, len: ");
1018 case GOMP_MAP_ATTACH
:
1019 case GOMP_MAP_DETACH
:
1020 case GOMP_MAP_FORCE_DETACH
:
1021 case GOMP_MAP_ATTACH_DETACH
:
1022 case GOMP_MAP_ATTACH_ZERO_LENGTH_ARRAY_SECTION
:
1023 pp_string (pp
, " [bias: ");
1026 pp_string (pp
, " [len: ");
1029 dump_generic_node (pp
, OMP_CLAUSE_SIZE (clause
),
1031 pp_right_bracket (pp
);
1033 if (OMP_CLAUSE_CODE (clause
) == OMP_CLAUSE_MAP
1034 && OMP_CLAUSE_MAP_RUNTIME_IMPLICIT_P (clause
))
1035 pp_string (pp
, "[implicit]");
1036 pp_right_paren (pp
);
1039 case OMP_CLAUSE_FROM
:
1040 pp_string (pp
, "from(");
1041 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
1043 goto print_clause_size
;
1046 pp_string (pp
, "to(");
1047 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
1049 goto print_clause_size
;
1051 case OMP_CLAUSE__CACHE_
:
1052 pp_string (pp
, "(");
1053 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
1055 goto print_clause_size
;
1057 case OMP_CLAUSE_NUM_TEAMS
:
1058 pp_string (pp
, "num_teams(");
1059 if (OMP_CLAUSE_NUM_TEAMS_LOWER_EXPR (clause
))
1061 dump_generic_node (pp
, OMP_CLAUSE_NUM_TEAMS_LOWER_EXPR (clause
),
1065 dump_generic_node (pp
, OMP_CLAUSE_NUM_TEAMS_UPPER_EXPR (clause
),
1067 pp_right_paren (pp
);
1070 case OMP_CLAUSE_THREAD_LIMIT
:
1071 pp_string (pp
, "thread_limit(");
1072 dump_generic_node (pp
, OMP_CLAUSE_THREAD_LIMIT_EXPR (clause
),
1074 pp_right_paren (pp
);
1077 case OMP_CLAUSE_DEVICE
:
1078 pp_string (pp
, "device(");
1079 if (OMP_CLAUSE_DEVICE_ANCESTOR (clause
))
1080 pp_string (pp
, "ancestor:");
1081 dump_generic_node (pp
, OMP_CLAUSE_DEVICE_ID (clause
),
1083 pp_right_paren (pp
);
1086 case OMP_CLAUSE_DIST_SCHEDULE
:
1087 pp_string (pp
, "dist_schedule(static");
1088 if (OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR (clause
))
1091 dump_generic_node (pp
,
1092 OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR (clause
),
1095 pp_right_paren (pp
);
1098 case OMP_CLAUSE_PROC_BIND
:
1099 pp_string (pp
, "proc_bind(");
1100 switch (OMP_CLAUSE_PROC_BIND_KIND (clause
))
1102 case OMP_CLAUSE_PROC_BIND_MASTER
:
1103 /* Same enum value: case OMP_CLAUSE_PROC_BIND_PRIMARY: */
1104 /* TODO: Change to 'primary' for OpenMP 5.1. */
1105 pp_string (pp
, "master");
1107 case OMP_CLAUSE_PROC_BIND_CLOSE
:
1108 pp_string (pp
, "close");
1110 case OMP_CLAUSE_PROC_BIND_SPREAD
:
1111 pp_string (pp
, "spread");
1116 pp_right_paren (pp
);
1119 case OMP_CLAUSE_DEVICE_TYPE
:
1120 pp_string (pp
, "device_type(");
1121 switch (OMP_CLAUSE_DEVICE_TYPE_KIND (clause
))
1123 case OMP_CLAUSE_DEVICE_TYPE_HOST
:
1124 pp_string (pp
, "host");
1126 case OMP_CLAUSE_DEVICE_TYPE_NOHOST
:
1127 pp_string (pp
, "nohost");
1129 case OMP_CLAUSE_DEVICE_TYPE_ANY
:
1130 pp_string (pp
, "any");
1135 pp_right_paren (pp
);
1138 case OMP_CLAUSE_SAFELEN
:
1139 pp_string (pp
, "safelen(");
1140 dump_generic_node (pp
, OMP_CLAUSE_SAFELEN_EXPR (clause
),
1142 pp_right_paren (pp
);
1145 case OMP_CLAUSE_SIMDLEN
:
1146 pp_string (pp
, "simdlen(");
1147 dump_generic_node (pp
, OMP_CLAUSE_SIMDLEN_EXPR (clause
),
1149 pp_right_paren (pp
);
1152 case OMP_CLAUSE_PRIORITY
:
1153 pp_string (pp
, "priority(");
1154 dump_generic_node (pp
, OMP_CLAUSE_PRIORITY_EXPR (clause
),
1156 pp_right_paren (pp
);
1159 case OMP_CLAUSE_GRAINSIZE
:
1160 pp_string (pp
, "grainsize(");
1161 if (OMP_CLAUSE_GRAINSIZE_STRICT (clause
))
1162 pp_string (pp
, "strict:");
1163 dump_generic_node (pp
, OMP_CLAUSE_GRAINSIZE_EXPR (clause
),
1165 pp_right_paren (pp
);
1168 case OMP_CLAUSE_NUM_TASKS
:
1169 pp_string (pp
, "num_tasks(");
1170 if (OMP_CLAUSE_NUM_TASKS_STRICT (clause
))
1171 pp_string (pp
, "strict:");
1172 dump_generic_node (pp
, OMP_CLAUSE_NUM_TASKS_EXPR (clause
),
1174 pp_right_paren (pp
);
1177 case OMP_CLAUSE_HINT
:
1178 pp_string (pp
, "hint(");
1179 dump_generic_node (pp
, OMP_CLAUSE_HINT_EXPR (clause
),
1181 pp_right_paren (pp
);
1184 case OMP_CLAUSE_FILTER
:
1185 pp_string (pp
, "filter(");
1186 dump_generic_node (pp
, OMP_CLAUSE_FILTER_EXPR (clause
),
1188 pp_right_paren (pp
);
1191 case OMP_CLAUSE_DEFAULTMAP
:
1192 pp_string (pp
, "defaultmap(");
1193 switch (OMP_CLAUSE_DEFAULTMAP_BEHAVIOR (clause
))
1195 case OMP_CLAUSE_DEFAULTMAP_ALLOC
:
1196 pp_string (pp
, "alloc");
1198 case OMP_CLAUSE_DEFAULTMAP_TO
:
1199 pp_string (pp
, "to");
1201 case OMP_CLAUSE_DEFAULTMAP_FROM
:
1202 pp_string (pp
, "from");
1204 case OMP_CLAUSE_DEFAULTMAP_TOFROM
:
1205 pp_string (pp
, "tofrom");
1207 case OMP_CLAUSE_DEFAULTMAP_FIRSTPRIVATE
:
1208 pp_string (pp
, "firstprivate");
1210 case OMP_CLAUSE_DEFAULTMAP_NONE
:
1211 pp_string (pp
, "none");
1213 case OMP_CLAUSE_DEFAULTMAP_DEFAULT
:
1214 pp_string (pp
, "default");
1219 switch (OMP_CLAUSE_DEFAULTMAP_CATEGORY (clause
))
1221 case OMP_CLAUSE_DEFAULTMAP_CATEGORY_UNSPECIFIED
:
1223 case OMP_CLAUSE_DEFAULTMAP_CATEGORY_SCALAR
:
1224 pp_string (pp
, ":scalar");
1226 case OMP_CLAUSE_DEFAULTMAP_CATEGORY_AGGREGATE
:
1227 pp_string (pp
, ":aggregate");
1229 case OMP_CLAUSE_DEFAULTMAP_CATEGORY_ALLOCATABLE
:
1230 pp_string (pp
, ":allocatable");
1232 case OMP_CLAUSE_DEFAULTMAP_CATEGORY_POINTER
:
1233 pp_string (pp
, ":pointer");
1238 pp_right_paren (pp
);
1241 case OMP_CLAUSE_ORDER
:
1242 pp_string (pp
, "order(");
1243 if (OMP_CLAUSE_ORDER_UNCONSTRAINED (clause
))
1244 pp_string (pp
, "unconstrained:");
1245 else if (OMP_CLAUSE_ORDER_REPRODUCIBLE (clause
))
1246 pp_string (pp
, "reproducible:");
1247 pp_string (pp
, "concurrent)");
1250 case OMP_CLAUSE_BIND
:
1251 pp_string (pp
, "bind(");
1252 switch (OMP_CLAUSE_BIND_KIND (clause
))
1254 case OMP_CLAUSE_BIND_TEAMS
:
1255 pp_string (pp
, "teams");
1257 case OMP_CLAUSE_BIND_PARALLEL
:
1258 pp_string (pp
, "parallel");
1260 case OMP_CLAUSE_BIND_THREAD
:
1261 pp_string (pp
, "thread");
1266 pp_right_paren (pp
);
1269 case OMP_CLAUSE__SIMDUID_
:
1270 pp_string (pp
, "_simduid_(");
1271 dump_generic_node (pp
, OMP_CLAUSE__SIMDUID__DECL (clause
),
1273 pp_right_paren (pp
);
1276 case OMP_CLAUSE__SIMT_
:
1277 pp_string (pp
, "_simt_");
1280 case OMP_CLAUSE_GANG
:
1281 pp_string (pp
, "gang");
1282 if (OMP_CLAUSE_GANG_EXPR (clause
) != NULL_TREE
)
1284 pp_string (pp
, "(num: ");
1285 dump_generic_node (pp
, OMP_CLAUSE_GANG_EXPR (clause
),
1288 if (OMP_CLAUSE_GANG_STATIC_EXPR (clause
) != NULL_TREE
)
1290 if (OMP_CLAUSE_GANG_EXPR (clause
) == NULL_TREE
)
1294 pp_string (pp
, "static:");
1295 if (OMP_CLAUSE_GANG_STATIC_EXPR (clause
)
1296 == integer_minus_one_node
)
1297 pp_character (pp
, '*');
1299 dump_generic_node (pp
, OMP_CLAUSE_GANG_STATIC_EXPR (clause
),
1302 if (OMP_CLAUSE_GANG_EXPR (clause
) != NULL_TREE
1303 || OMP_CLAUSE_GANG_STATIC_EXPR (clause
) != NULL_TREE
)
1304 pp_right_paren (pp
);
1307 case OMP_CLAUSE_ASYNC
:
1308 pp_string (pp
, "async");
1309 if (OMP_CLAUSE_ASYNC_EXPR (clause
))
1311 pp_character(pp
, '(');
1312 dump_generic_node (pp
, OMP_CLAUSE_ASYNC_EXPR (clause
),
1314 pp_character(pp
, ')');
1318 case OMP_CLAUSE_AUTO
:
1319 case OMP_CLAUSE_SEQ
:
1320 pp_string (pp
, omp_clause_code_name
[OMP_CLAUSE_CODE (clause
)]);
1323 case OMP_CLAUSE_WAIT
:
1324 pp_string (pp
, "wait(");
1325 dump_generic_node (pp
, OMP_CLAUSE_WAIT_EXPR (clause
),
1327 pp_character(pp
, ')');
1330 case OMP_CLAUSE_WORKER
:
1331 pp_string (pp
, "worker");
1332 if (OMP_CLAUSE_WORKER_EXPR (clause
) != NULL_TREE
)
1335 dump_generic_node (pp
, OMP_CLAUSE_WORKER_EXPR (clause
),
1337 pp_right_paren (pp
);
1341 case OMP_CLAUSE_VECTOR
:
1342 pp_string (pp
, "vector");
1343 if (OMP_CLAUSE_VECTOR_EXPR (clause
) != NULL_TREE
)
1346 dump_generic_node (pp
, OMP_CLAUSE_VECTOR_EXPR (clause
),
1348 pp_right_paren (pp
);
1352 case OMP_CLAUSE_NUM_GANGS
:
1353 pp_string (pp
, "num_gangs(");
1354 dump_generic_node (pp
, OMP_CLAUSE_NUM_GANGS_EXPR (clause
),
1356 pp_character (pp
, ')');
1359 case OMP_CLAUSE_NUM_WORKERS
:
1360 pp_string (pp
, "num_workers(");
1361 dump_generic_node (pp
, OMP_CLAUSE_NUM_WORKERS_EXPR (clause
),
1363 pp_character (pp
, ')');
1366 case OMP_CLAUSE_VECTOR_LENGTH
:
1367 pp_string (pp
, "vector_length(");
1368 dump_generic_node (pp
, OMP_CLAUSE_VECTOR_LENGTH_EXPR (clause
),
1370 pp_character (pp
, ')');
1373 case OMP_CLAUSE_INBRANCH
:
1374 pp_string (pp
, "inbranch");
1376 case OMP_CLAUSE_NOTINBRANCH
:
1377 pp_string (pp
, "notinbranch");
1379 case OMP_CLAUSE_FOR
:
1380 pp_string (pp
, "for");
1382 case OMP_CLAUSE_PARALLEL
:
1383 pp_string (pp
, "parallel");
1385 case OMP_CLAUSE_SECTIONS
:
1386 pp_string (pp
, "sections");
1388 case OMP_CLAUSE_TASKGROUP
:
1389 pp_string (pp
, "taskgroup");
1391 case OMP_CLAUSE_NOGROUP
:
1392 pp_string (pp
, "nogroup");
1394 case OMP_CLAUSE_THREADS
:
1395 pp_string (pp
, "threads");
1397 case OMP_CLAUSE_SIMD
:
1398 pp_string (pp
, "simd");
1400 case OMP_CLAUSE_INDEPENDENT
:
1401 pp_string (pp
, "independent");
1403 case OMP_CLAUSE_TILE
:
1404 pp_string (pp
, "tile(");
1405 dump_generic_node (pp
, OMP_CLAUSE_TILE_LIST (clause
),
1407 pp_right_paren (pp
);
1410 case OMP_CLAUSE_IF_PRESENT
:
1411 pp_string (pp
, "if_present");
1413 case OMP_CLAUSE_FINALIZE
:
1414 pp_string (pp
, "finalize");
1416 case OMP_CLAUSE_NOHOST
:
1417 pp_string (pp
, "nohost");
1419 case OMP_CLAUSE_DETACH
:
1420 pp_string (pp
, "detach(");
1421 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
), spc
, flags
,
1423 pp_right_paren (pp
);
1432 /* Dump chain of OMP clauses.
1434 PP, SPC and FLAGS are as in dump_generic_node. */
1437 dump_omp_clauses (pretty_printer
*pp
, tree clause
, int spc
, dump_flags_t flags
,
1444 dump_omp_clause (pp
, clause
, spc
, flags
);
1445 leading_space
= true;
1447 clause
= OMP_CLAUSE_CHAIN (clause
);
1452 /* Dump location LOC to PP. */
1455 dump_location (pretty_printer
*pp
, location_t loc
)
1457 expanded_location xloc
= expand_location (loc
);
1459 pp_left_bracket (pp
);
1462 pp_string (pp
, xloc
.file
);
1463 pp_string (pp
, ":");
1465 pp_decimal_int (pp
, xloc
.line
);
1467 pp_decimal_int (pp
, xloc
.column
);
1468 pp_string (pp
, "] ");
1472 /* Dump lexical block BLOCK. PP, SPC and FLAGS are as in
1473 dump_generic_node. */
1476 dump_block_node (pretty_printer
*pp
, tree block
, int spc
, dump_flags_t flags
)
1480 pp_string (pp
, "BLOCK #");
1481 pp_decimal_int (pp
, BLOCK_NUMBER (block
));
1482 pp_character (pp
, ' ');
1484 if (flags
& TDF_ADDRESS
)
1486 pp_character (pp
, '[');
1487 pp_scalar (pp
, "%p", (void *) block
);
1488 pp_string (pp
, "] ");
1491 if (TREE_ASM_WRITTEN (block
))
1492 pp_string (pp
, "[written] ");
1494 if (flags
& TDF_SLIM
)
1497 if (BLOCK_SOURCE_LOCATION (block
))
1498 dump_location (pp
, BLOCK_SOURCE_LOCATION (block
));
1500 newline_and_indent (pp
, spc
+ 2);
1502 if (BLOCK_SUPERCONTEXT (block
))
1504 pp_string (pp
, "SUPERCONTEXT: ");
1505 dump_generic_node (pp
, BLOCK_SUPERCONTEXT (block
), 0,
1506 flags
| TDF_SLIM
, false);
1507 newline_and_indent (pp
, spc
+ 2);
1510 if (BLOCK_SUBBLOCKS (block
))
1512 pp_string (pp
, "SUBBLOCKS: ");
1513 for (t
= BLOCK_SUBBLOCKS (block
); t
; t
= BLOCK_CHAIN (t
))
1515 dump_generic_node (pp
, t
, 0, flags
| TDF_SLIM
, false);
1518 newline_and_indent (pp
, spc
+ 2);
1521 if (BLOCK_CHAIN (block
))
1523 pp_string (pp
, "SIBLINGS: ");
1524 for (t
= BLOCK_CHAIN (block
); t
; t
= BLOCK_CHAIN (t
))
1526 dump_generic_node (pp
, t
, 0, flags
| TDF_SLIM
, false);
1529 newline_and_indent (pp
, spc
+ 2);
1532 if (BLOCK_VARS (block
))
1534 pp_string (pp
, "VARS: ");
1535 for (t
= BLOCK_VARS (block
); t
; t
= TREE_CHAIN (t
))
1537 dump_generic_node (pp
, t
, 0, flags
, false);
1540 newline_and_indent (pp
, spc
+ 2);
1543 if (vec_safe_length (BLOCK_NONLOCALIZED_VARS (block
)) > 0)
1546 vec
<tree
, va_gc
> *nlv
= BLOCK_NONLOCALIZED_VARS (block
);
1548 pp_string (pp
, "NONLOCALIZED_VARS: ");
1549 FOR_EACH_VEC_ELT (*nlv
, i
, t
)
1551 dump_generic_node (pp
, t
, 0, flags
, false);
1554 newline_and_indent (pp
, spc
+ 2);
1557 if (BLOCK_ABSTRACT_ORIGIN (block
))
1559 pp_string (pp
, "ABSTRACT_ORIGIN: ");
1560 dump_generic_node (pp
, BLOCK_ABSTRACT_ORIGIN (block
), 0,
1561 flags
| TDF_SLIM
, false);
1562 newline_and_indent (pp
, spc
+ 2);
1565 if (BLOCK_FRAGMENT_ORIGIN (block
))
1567 pp_string (pp
, "FRAGMENT_ORIGIN: ");
1568 dump_generic_node (pp
, BLOCK_FRAGMENT_ORIGIN (block
), 0,
1569 flags
| TDF_SLIM
, false);
1570 newline_and_indent (pp
, spc
+ 2);
1573 if (BLOCK_FRAGMENT_CHAIN (block
))
1575 pp_string (pp
, "FRAGMENT_CHAIN: ");
1576 for (t
= BLOCK_FRAGMENT_CHAIN (block
); t
; t
= BLOCK_FRAGMENT_CHAIN (t
))
1578 dump_generic_node (pp
, t
, 0, flags
| TDF_SLIM
, false);
1581 newline_and_indent (pp
, spc
+ 2);
1585 /* Dump #pragma omp atomic memory order clause. */
1588 dump_omp_atomic_memory_order (pretty_printer
*pp
, enum omp_memory_order mo
)
1590 switch (mo
& OMP_MEMORY_ORDER_MASK
)
1592 case OMP_MEMORY_ORDER_RELAXED
:
1593 pp_string (pp
, " relaxed");
1595 case OMP_MEMORY_ORDER_SEQ_CST
:
1596 pp_string (pp
, " seq_cst");
1598 case OMP_MEMORY_ORDER_ACQ_REL
:
1599 pp_string (pp
, " acq_rel");
1601 case OMP_MEMORY_ORDER_ACQUIRE
:
1602 pp_string (pp
, " acquire");
1604 case OMP_MEMORY_ORDER_RELEASE
:
1605 pp_string (pp
, " release");
1607 case OMP_MEMORY_ORDER_UNSPECIFIED
:
1612 switch (mo
& OMP_FAIL_MEMORY_ORDER_MASK
)
1614 case OMP_FAIL_MEMORY_ORDER_RELAXED
:
1615 pp_string (pp
, " fail(relaxed)");
1617 case OMP_FAIL_MEMORY_ORDER_SEQ_CST
:
1618 pp_string (pp
, " fail(seq_cst)");
1620 case OMP_FAIL_MEMORY_ORDER_ACQUIRE
:
1621 pp_string (pp
, " fail(acquire)");
1623 case OMP_FAIL_MEMORY_ORDER_UNSPECIFIED
:
1630 /* Helper to dump a MEM_REF node. */
1633 dump_mem_ref (pretty_printer
*pp
, tree node
, int spc
, dump_flags_t flags
)
1635 if (TREE_CODE (node
) == MEM_REF
&& (flags
& TDF_GIMPLE
))
1637 pp_string (pp
, "__MEM <");
1638 dump_generic_node (pp
, TREE_TYPE (node
),
1639 spc
, flags
| TDF_SLIM
, false);
1640 if (TYPE_ALIGN (TREE_TYPE (node
))
1641 != TYPE_ALIGN (TYPE_MAIN_VARIANT (TREE_TYPE (node
))))
1643 pp_string (pp
, ", ");
1644 pp_decimal_int (pp
, TYPE_ALIGN (TREE_TYPE (node
)));
1647 pp_string (pp
, " (");
1648 if (TREE_TYPE (TREE_OPERAND (node
, 0))
1649 != TREE_TYPE (TREE_OPERAND (node
, 1)))
1652 dump_generic_node (pp
, TREE_TYPE (TREE_OPERAND (node
, 1)),
1653 spc
, flags
| TDF_SLIM
, false);
1654 pp_right_paren (pp
);
1656 dump_generic_node (pp
, TREE_OPERAND (node
, 0),
1657 spc
, flags
| TDF_SLIM
, false);
1658 if (! integer_zerop (TREE_OPERAND (node
, 1)))
1660 pp_string (pp
, " + ");
1661 dump_generic_node (pp
, TREE_OPERAND (node
, 1),
1662 spc
, flags
| TDF_SLIM
, false);
1664 pp_right_paren (pp
);
1666 else if (TREE_CODE (node
) == MEM_REF
1667 && integer_zerop (TREE_OPERAND (node
, 1))
1668 /* Dump the types of INTEGER_CSTs explicitly, for we can't
1669 infer them and MEM_ATTR caching will share MEM_REFs
1670 with differently-typed op0s. */
1671 && TREE_CODE (TREE_OPERAND (node
, 0)) != INTEGER_CST
1672 /* Released SSA_NAMES have no TREE_TYPE. */
1673 && TREE_TYPE (TREE_OPERAND (node
, 0)) != NULL_TREE
1674 /* Same pointer types, but ignoring POINTER_TYPE vs.
1676 && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node
, 0)))
1677 == TREE_TYPE (TREE_TYPE (TREE_OPERAND (node
, 1))))
1678 && (TYPE_MODE (TREE_TYPE (TREE_OPERAND (node
, 0)))
1679 == TYPE_MODE (TREE_TYPE (TREE_OPERAND (node
, 1))))
1680 && (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node
, 0)))
1681 == TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node
, 1))))
1682 /* Same value types ignoring qualifiers. */
1683 && (TYPE_MAIN_VARIANT (TREE_TYPE (node
))
1684 == TYPE_MAIN_VARIANT
1685 (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node
, 1)))))
1686 && (!(flags
& TDF_ALIAS
)
1687 || MR_DEPENDENCE_CLIQUE (node
) == 0))
1689 if (TREE_CODE (TREE_OPERAND (node
, 0)) != ADDR_EXPR
)
1691 /* Enclose pointers to arrays in parentheses. */
1692 tree op0
= TREE_OPERAND (node
, 0);
1693 tree op0type
= TREE_TYPE (op0
);
1694 if (POINTER_TYPE_P (op0type
)
1695 && TREE_CODE (TREE_TYPE (op0type
)) == ARRAY_TYPE
)
1698 dump_generic_node (pp
, op0
, spc
, flags
, false);
1699 if (POINTER_TYPE_P (op0type
)
1700 && TREE_CODE (TREE_TYPE (op0type
)) == ARRAY_TYPE
)
1701 pp_right_paren (pp
);
1704 dump_generic_node (pp
,
1705 TREE_OPERAND (TREE_OPERAND (node
, 0), 0),
1710 pp_string (pp
, "MEM");
1712 tree nodetype
= TREE_TYPE (node
);
1713 tree op0
= TREE_OPERAND (node
, 0);
1714 tree op1
= TREE_OPERAND (node
, 1);
1715 tree op1type
= TYPE_MAIN_VARIANT (TREE_TYPE (op1
));
1717 tree op0size
= TYPE_SIZE (nodetype
);
1718 tree op1size
= TYPE_SIZE (TREE_TYPE (op1type
));
1720 if (!op0size
|| !op1size
1721 || !operand_equal_p (op0size
, op1size
, 0))
1723 pp_string (pp
, " <");
1724 /* If the size of the type of the operand is not the same
1725 as the size of the MEM_REF expression include the type
1726 of the latter similar to the TDF_GIMPLE output to make
1727 it clear how many bytes of memory are being accessed. */
1728 dump_generic_node (pp
, nodetype
, spc
, flags
| TDF_SLIM
, false);
1729 pp_string (pp
, "> ");
1732 pp_string (pp
, "[(");
1733 dump_generic_node (pp
, op1type
, spc
, flags
| TDF_SLIM
, false);
1734 pp_right_paren (pp
);
1735 dump_generic_node (pp
, op0
, spc
, flags
, false);
1736 if (!integer_zerop (op1
))
1738 pp_string (pp
, " + ");
1739 dump_generic_node (pp
, op1
, spc
, flags
, false);
1741 if (TREE_CODE (node
) == TARGET_MEM_REF
)
1743 tree tmp
= TMR_INDEX2 (node
);
1746 pp_string (pp
, " + ");
1747 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1749 tmp
= TMR_INDEX (node
);
1752 pp_string (pp
, " + ");
1753 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1754 tmp
= TMR_STEP (node
);
1755 pp_string (pp
, " * ");
1757 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1759 pp_string (pp
, "1");
1762 if ((flags
& TDF_ALIAS
)
1763 && MR_DEPENDENCE_CLIQUE (node
) != 0)
1765 pp_string (pp
, " clique ");
1766 pp_unsigned_wide_integer (pp
, MR_DEPENDENCE_CLIQUE (node
));
1767 pp_string (pp
, " base ");
1768 pp_unsigned_wide_integer (pp
, MR_DEPENDENCE_BASE (node
));
1770 pp_right_bracket (pp
);
1774 /* Helper function for dump_generic_node. Dump INIT or COND expression for
1775 OpenMP loop non-rectangular iterators. */
1778 dump_omp_loop_non_rect_expr (pretty_printer
*pp
, tree node
, int spc
,
1781 gcc_assert (TREE_CODE (node
) == TREE_VEC
);
1782 dump_generic_node (pp
, TREE_VEC_ELT (node
, 0), spc
, flags
, false);
1783 pp_string (pp
, " * ");
1784 if (op_prio (TREE_VEC_ELT (node
, 1)) <= op_code_prio (MULT_EXPR
))
1787 dump_generic_node (pp
, TREE_VEC_ELT (node
, 1), spc
, flags
, false);
1788 pp_right_paren (pp
);
1791 dump_generic_node (pp
, TREE_VEC_ELT (node
, 1), spc
, flags
, false);
1792 pp_string (pp
, " + ");
1793 if (op_prio (TREE_VEC_ELT (node
, 1)) <= op_code_prio (PLUS_EXPR
))
1796 dump_generic_node (pp
, TREE_VEC_ELT (node
, 2), spc
, flags
, false);
1797 pp_right_paren (pp
);
1800 dump_generic_node (pp
, TREE_VEC_ELT (node
, 2), spc
, flags
, false);
1803 /* Dump the node NODE on the pretty_printer PP, SPC spaces of
1804 indent. FLAGS specifies details to show in the dump (see TDF_* in
1805 dumpfile.h). If IS_STMT is true, the object printed is considered
1806 to be a statement and it is terminated by ';' if appropriate. */
1809 dump_generic_node (pretty_printer
*pp
, tree node
, int spc
, dump_flags_t flags
,
1816 enum tree_code code
;
1818 if (node
== NULL_TREE
)
1821 is_expr
= EXPR_P (node
);
1823 if (is_stmt
&& (flags
& TDF_STMTADDR
))
1825 pp_string (pp
, "<&");
1826 pp_scalar (pp
, "%p", (void *)node
);
1827 pp_string (pp
, "> ");
1830 if ((flags
& TDF_LINENO
) && EXPR_HAS_LOCATION (node
))
1831 dump_location (pp
, EXPR_LOCATION (node
));
1833 code
= TREE_CODE (node
);
1837 pp_string (pp
, "<<< error >>>");
1840 case IDENTIFIER_NODE
:
1841 pp_tree_identifier (pp
, node
);
1845 while (node
&& node
!= error_mark_node
)
1847 if (TREE_PURPOSE (node
))
1849 dump_generic_node (pp
, TREE_PURPOSE (node
), spc
, flags
, false);
1852 dump_generic_node (pp
, TREE_VALUE (node
), spc
, flags
, false);
1853 node
= TREE_CHAIN (node
);
1854 if (node
&& TREE_CODE (node
) == TREE_LIST
)
1863 dump_generic_node (pp
, BINFO_TYPE (node
), spc
, flags
, false);
1869 if (TREE_VEC_LENGTH (node
) > 0)
1871 size_t len
= TREE_VEC_LENGTH (node
);
1872 for (i
= 0; i
< len
- 1; i
++)
1874 dump_generic_node (pp
, TREE_VEC_ELT (node
, i
), spc
, flags
,
1879 dump_generic_node (pp
, TREE_VEC_ELT (node
, len
- 1), spc
,
1888 case FIXED_POINT_TYPE
:
1895 unsigned int quals
= TYPE_QUALS (node
);
1896 enum tree_code_class tclass
;
1898 if (quals
& TYPE_QUAL_ATOMIC
)
1899 pp_string (pp
, "atomic ");
1900 if (quals
& TYPE_QUAL_CONST
)
1901 pp_string (pp
, "const ");
1902 if (quals
& TYPE_QUAL_VOLATILE
)
1903 pp_string (pp
, "volatile ");
1904 if (quals
& TYPE_QUAL_RESTRICT
)
1905 pp_string (pp
, "restrict ");
1907 if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node
)))
1909 pp_string (pp
, "<address-space-");
1910 pp_decimal_int (pp
, TYPE_ADDR_SPACE (node
));
1911 pp_string (pp
, "> ");
1914 tclass
= TREE_CODE_CLASS (TREE_CODE (node
));
1916 if (tclass
== tcc_declaration
)
1918 if (DECL_NAME (node
))
1919 dump_decl_name (pp
, node
, flags
);
1921 pp_string (pp
, "<unnamed type decl>");
1923 else if (tclass
== tcc_type
)
1925 if (TYPE_NAME (node
))
1927 if (TREE_CODE (TYPE_NAME (node
)) == IDENTIFIER_NODE
)
1928 pp_tree_identifier (pp
, TYPE_NAME (node
));
1929 else if (TREE_CODE (TYPE_NAME (node
)) == TYPE_DECL
1930 && DECL_NAME (TYPE_NAME (node
)))
1931 dump_decl_name (pp
, TYPE_NAME (node
), flags
);
1933 pp_string (pp
, "<unnamed type>");
1935 else if (TREE_CODE (node
) == VECTOR_TYPE
)
1937 pp_string (pp
, "vector");
1939 pp_wide_integer (pp
, TYPE_VECTOR_SUBPARTS (node
));
1940 pp_string (pp
, ") ");
1941 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1943 else if (TREE_CODE (node
) == INTEGER_TYPE
)
1945 if (TYPE_PRECISION (node
) == CHAR_TYPE_SIZE
)
1946 pp_string (pp
, (TYPE_UNSIGNED (node
)
1949 else if (TYPE_PRECISION (node
) == SHORT_TYPE_SIZE
)
1950 pp_string (pp
, (TYPE_UNSIGNED (node
)
1953 else if (TYPE_PRECISION (node
) == INT_TYPE_SIZE
)
1954 pp_string (pp
, (TYPE_UNSIGNED (node
)
1957 else if (TYPE_PRECISION (node
) == LONG_TYPE_SIZE
)
1958 pp_string (pp
, (TYPE_UNSIGNED (node
)
1961 else if (TYPE_PRECISION (node
) == LONG_LONG_TYPE_SIZE
)
1962 pp_string (pp
, (TYPE_UNSIGNED (node
)
1963 ? "unsigned long long"
1964 : "signed long long"));
1965 else if (TYPE_PRECISION (node
) >= CHAR_TYPE_SIZE
1966 && pow2p_hwi (TYPE_PRECISION (node
)))
1968 pp_string (pp
, (TYPE_UNSIGNED (node
) ? "uint" : "int"));
1969 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1970 pp_string (pp
, "_t");
1974 pp_string (pp
, (TYPE_UNSIGNED (node
)
1975 ? "<unnamed-unsigned:"
1976 : "<unnamed-signed:"));
1977 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1981 else if (TREE_CODE (node
) == COMPLEX_TYPE
)
1983 pp_string (pp
, "__complex__ ");
1984 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1986 else if (TREE_CODE (node
) == REAL_TYPE
)
1988 pp_string (pp
, "<float:");
1989 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1992 else if (TREE_CODE (node
) == FIXED_POINT_TYPE
)
1994 pp_string (pp
, "<fixed-point-");
1995 pp_string (pp
, TYPE_SATURATING (node
) ? "sat:" : "nonsat:");
1996 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1999 else if (TREE_CODE (node
) == BOOLEAN_TYPE
)
2001 pp_string (pp
, (TYPE_UNSIGNED (node
)
2002 ? "<unsigned-boolean:"
2003 : "<signed-boolean:"));
2004 pp_decimal_int (pp
, TYPE_PRECISION (node
));
2007 else if (TREE_CODE (node
) == VOID_TYPE
)
2008 pp_string (pp
, "void");
2010 pp_string (pp
, "<unnamed type>");
2016 case REFERENCE_TYPE
:
2017 str
= (TREE_CODE (node
) == POINTER_TYPE
? "*" : "&");
2019 if (TREE_TYPE (node
) == NULL
)
2021 pp_string (pp
, str
);
2022 pp_string (pp
, "<null type>");
2024 else if (TREE_CODE (TREE_TYPE (node
)) == FUNCTION_TYPE
)
2026 tree fnode
= TREE_TYPE (node
);
2028 dump_generic_node (pp
, TREE_TYPE (fnode
), spc
, flags
, false);
2031 pp_string (pp
, str
);
2032 if (TYPE_IDENTIFIER (node
))
2033 dump_generic_node (pp
, TYPE_NAME (node
), spc
, flags
, false);
2034 else if (flags
& TDF_NOUID
)
2035 pp_string (pp
, "<Txxxx>");
2038 pp_string (pp
, "<T");
2039 pp_scalar (pp
, "%x", TYPE_UID (node
));
2040 pp_character (pp
, '>');
2043 pp_right_paren (pp
);
2044 dump_function_declaration (pp
, fnode
, spc
, flags
);
2048 unsigned int quals
= TYPE_QUALS (node
);
2050 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
2052 pp_string (pp
, str
);
2054 if (quals
& TYPE_QUAL_CONST
)
2055 pp_string (pp
, " const");
2056 if (quals
& TYPE_QUAL_VOLATILE
)
2057 pp_string (pp
, " volatile");
2058 if (quals
& TYPE_QUAL_RESTRICT
)
2059 pp_string (pp
, " restrict");
2061 if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node
)))
2063 pp_string (pp
, " <address-space-");
2064 pp_decimal_int (pp
, TYPE_ADDR_SPACE (node
));
2068 if (TYPE_REF_CAN_ALIAS_ALL (node
))
2069 pp_string (pp
, " {ref-all}");
2078 case TARGET_MEM_REF
:
2079 dump_mem_ref (pp
, node
, spc
, flags
);
2084 unsigned int quals
= TYPE_QUALS (node
);
2087 if (quals
& TYPE_QUAL_ATOMIC
)
2088 pp_string (pp
, "atomic ");
2089 if (quals
& TYPE_QUAL_CONST
)
2090 pp_string (pp
, "const ");
2091 if (quals
& TYPE_QUAL_VOLATILE
)
2092 pp_string (pp
, "volatile ");
2094 /* Print the innermost component type. */
2095 for (tmp
= TREE_TYPE (node
); TREE_CODE (tmp
) == ARRAY_TYPE
;
2096 tmp
= TREE_TYPE (tmp
))
2099 /* Avoid to print recursively the array. */
2100 /* FIXME : Not implemented correctly, see print_struct_decl. */
2101 if (TREE_CODE (tmp
) != POINTER_TYPE
|| TREE_TYPE (tmp
) != node
)
2102 dump_generic_node (pp
, tmp
, spc
, flags
, false);
2104 /* Print the dimensions. */
2105 for (tmp
= node
; TREE_CODE (tmp
) == ARRAY_TYPE
; tmp
= TREE_TYPE (tmp
))
2106 dump_array_domain (pp
, TYPE_DOMAIN (tmp
), spc
, flags
);
2112 case QUAL_UNION_TYPE
:
2114 unsigned int quals
= TYPE_QUALS (node
);
2116 if (quals
& TYPE_QUAL_ATOMIC
)
2117 pp_string (pp
, "atomic ");
2118 if (quals
& TYPE_QUAL_CONST
)
2119 pp_string (pp
, "const ");
2120 if (quals
& TYPE_QUAL_VOLATILE
)
2121 pp_string (pp
, "volatile ");
2123 if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node
)))
2125 pp_string (pp
, "<address-space-");
2126 pp_decimal_int (pp
, TYPE_ADDR_SPACE (node
));
2127 pp_string (pp
, "> ");
2130 /* Print the name of the structure. */
2131 if (TREE_CODE (node
) == RECORD_TYPE
)
2132 pp_string (pp
, "struct ");
2133 else if (TREE_CODE (node
) == UNION_TYPE
)
2134 pp_string (pp
, "union ");
2136 if (TYPE_NAME (node
))
2137 dump_generic_node (pp
, TYPE_NAME (node
), spc
, flags
, false);
2138 else if (!(flags
& TDF_SLIM
))
2139 /* FIXME: If we eliminate the 'else' above and attempt
2140 to show the fields for named types, we may get stuck
2141 following a cycle of pointers to structs. The alleged
2142 self-reference check in print_struct_decl will not detect
2143 cycles involving more than one pointer or struct type. */
2144 print_struct_decl (pp
, node
, spc
, flags
);
2153 if (flags
& TDF_GIMPLE
2154 && (POINTER_TYPE_P (TREE_TYPE (node
))
2155 || (TYPE_PRECISION (TREE_TYPE (node
))
2156 < TYPE_PRECISION (integer_type_node
))
2157 || exact_log2 (TYPE_PRECISION (TREE_TYPE (node
))) == -1
2158 || tree_int_cst_sgn (node
) < 0))
2160 pp_string (pp
, "_Literal (");
2161 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
2162 pp_string (pp
, ") ");
2164 if (TREE_CODE (TREE_TYPE (node
)) == POINTER_TYPE
2165 && ! (flags
& TDF_GIMPLE
))
2167 /* In the case of a pointer, one may want to divide by the
2168 size of the pointed-to type. Unfortunately, this not
2169 straightforward. The C front-end maps expressions
2174 in such a way that the two INTEGER_CST nodes for "5" have
2175 different values but identical types. In the latter
2176 case, the 5 is multiplied by sizeof (int) in c-common.cc
2177 (pointer_int_sum) to convert it to a byte address, and
2178 yet the type of the node is left unchanged. Argh. What
2179 is consistent though is that the number value corresponds
2180 to bytes (UNITS) offset.
2182 NB: Neither of the following divisors can be trivially
2183 used to recover the original literal:
2185 TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (node)))
2186 TYPE_PRECISION (TREE_TYPE (TREE_TYPE (node))) */
2187 pp_wide_integer (pp
, TREE_INT_CST_LOW (node
));
2188 pp_string (pp
, "B"); /* pseudo-unit */
2190 else if (tree_fits_shwi_p (node
))
2191 pp_wide_integer (pp
, tree_to_shwi (node
));
2192 else if (tree_fits_uhwi_p (node
))
2193 pp_unsigned_wide_integer (pp
, tree_to_uhwi (node
));
2196 wide_int val
= wi::to_wide (node
);
2198 if (wi::neg_p (val
, TYPE_SIGN (TREE_TYPE (node
))))
2203 print_hex (val
, pp_buffer (pp
)->digit_buffer
);
2204 pp_string (pp
, pp_buffer (pp
)->digit_buffer
);
2206 if ((flags
& TDF_GIMPLE
)
2207 && ! (POINTER_TYPE_P (TREE_TYPE (node
))
2208 || (TYPE_PRECISION (TREE_TYPE (node
))
2209 < TYPE_PRECISION (integer_type_node
))
2210 || exact_log2 (TYPE_PRECISION (TREE_TYPE (node
))) == -1))
2212 if (TYPE_UNSIGNED (TREE_TYPE (node
)))
2213 pp_character (pp
, 'u');
2214 if (TYPE_PRECISION (TREE_TYPE (node
))
2215 == TYPE_PRECISION (unsigned_type_node
))
2217 else if (TYPE_PRECISION (TREE_TYPE (node
))
2218 == TYPE_PRECISION (long_unsigned_type_node
))
2219 pp_character (pp
, 'l');
2220 else if (TYPE_PRECISION (TREE_TYPE (node
))
2221 == TYPE_PRECISION (long_long_unsigned_type_node
))
2222 pp_string (pp
, "ll");
2224 if (TREE_OVERFLOW (node
))
2225 pp_string (pp
, "(OVF)");
2229 pp_string (pp
, "POLY_INT_CST [");
2230 dump_generic_node (pp
, POLY_INT_CST_COEFF (node
, 0), spc
, flags
, false);
2231 for (unsigned int i
= 1; i
< NUM_POLY_INT_COEFFS
; ++i
)
2233 pp_string (pp
, ", ");
2234 dump_generic_node (pp
, POLY_INT_CST_COEFF (node
, i
),
2237 pp_string (pp
, "]");
2241 /* Code copied from print_node. */
2244 if (TREE_OVERFLOW (node
))
2245 pp_string (pp
, " overflow");
2247 d
= TREE_REAL_CST (node
);
2248 if (REAL_VALUE_ISINF (d
))
2249 pp_string (pp
, REAL_VALUE_NEGATIVE (d
) ? " -Inf" : " Inf");
2250 else if (REAL_VALUE_ISNAN (d
))
2251 pp_string (pp
, " Nan");
2255 real_to_decimal (string
, &d
, sizeof (string
), 0, 1);
2256 pp_string (pp
, string
);
2264 fixed_to_decimal (string
, TREE_FIXED_CST_PTR (node
), sizeof (string
));
2265 pp_string (pp
, string
);
2270 pp_string (pp
, "__complex__ (");
2271 dump_generic_node (pp
, TREE_REALPART (node
), spc
, flags
, false);
2272 pp_string (pp
, ", ");
2273 dump_generic_node (pp
, TREE_IMAGPART (node
), spc
, flags
, false);
2274 pp_right_paren (pp
);
2279 pp_string (pp
, "\"");
2280 if (unsigned nbytes
= TREE_STRING_LENGTH (node
))
2281 pretty_print_string (pp
, TREE_STRING_POINTER (node
), nbytes
);
2282 pp_string (pp
, "\"");
2289 if (flags
& TDF_GIMPLE
)
2291 pp_string (pp
, "_Literal (");
2292 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
2293 pp_string (pp
, ") ");
2295 pp_string (pp
, "{ ");
2296 unsigned HOST_WIDE_INT nunits
;
2297 if (!VECTOR_CST_NELTS (node
).is_constant (&nunits
))
2298 nunits
= vector_cst_encoded_nelts (node
);
2299 for (i
= 0; i
< nunits
; ++i
)
2302 pp_string (pp
, ", ");
2303 dump_generic_node (pp
, VECTOR_CST_ELT (node
, i
),
2306 if (!VECTOR_CST_NELTS (node
).is_constant ())
2307 pp_string (pp
, ", ...");
2308 pp_string (pp
, " }");
2314 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
2316 if (TREE_CODE (node
) == METHOD_TYPE
)
2318 if (TYPE_METHOD_BASETYPE (node
))
2319 dump_generic_node (pp
, TYPE_NAME (TYPE_METHOD_BASETYPE (node
)),
2322 pp_string (pp
, "<null method basetype>");
2323 pp_colon_colon (pp
);
2325 if (TYPE_IDENTIFIER (node
))
2326 dump_generic_node (pp
, TYPE_NAME (node
), spc
, flags
, false);
2327 else if (TYPE_NAME (node
) && DECL_NAME (TYPE_NAME (node
)))
2328 dump_decl_name (pp
, TYPE_NAME (node
), flags
);
2329 else if (flags
& TDF_NOUID
)
2330 pp_string (pp
, "<Txxxx>");
2333 pp_string (pp
, "<T");
2334 pp_scalar (pp
, "%x", TYPE_UID (node
));
2335 pp_character (pp
, '>');
2337 dump_function_declaration (pp
, node
, spc
, flags
);
2342 dump_decl_name (pp
, node
, flags
);
2346 if (DECL_NAME (node
))
2347 dump_decl_name (pp
, node
, flags
);
2348 else if (LABEL_DECL_UID (node
) != -1)
2350 if (flags
& TDF_GIMPLE
)
2352 pp_character (pp
, 'L');
2353 pp_decimal_int (pp
, (int) LABEL_DECL_UID (node
));
2357 pp_string (pp
, "<L");
2358 pp_decimal_int (pp
, (int) LABEL_DECL_UID (node
));
2359 pp_character (pp
, '>');
2364 if (flags
& TDF_NOUID
)
2365 pp_string (pp
, "<D.xxxx>");
2368 if (flags
& TDF_GIMPLE
)
2370 pp_character (pp
, 'D');
2371 pp_scalar (pp
, "%u", DECL_UID (node
));
2375 pp_string (pp
, "<D.");
2376 pp_scalar (pp
, "%u", DECL_UID (node
));
2377 pp_character (pp
, '>');
2384 if (DECL_IS_UNDECLARED_BUILTIN (node
))
2386 /* Don't print the declaration of built-in types. */
2389 if (DECL_NAME (node
))
2390 dump_decl_name (pp
, node
, flags
);
2391 else if (TYPE_NAME (TREE_TYPE (node
)) != node
)
2393 pp_string (pp
, (TREE_CODE (TREE_TYPE (node
)) == UNION_TYPE
2394 ? "union" : "struct "));
2395 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
2398 pp_string (pp
, "<anon>");
2404 case DEBUG_EXPR_DECL
:
2405 case NAMESPACE_DECL
:
2407 dump_decl_name (pp
, node
, flags
);
2411 pp_string (pp
, "<retval>");
2415 op0
= TREE_OPERAND (node
, 0);
2418 && (TREE_CODE (op0
) == INDIRECT_REF
2419 || (TREE_CODE (op0
) == MEM_REF
2420 && TREE_CODE (TREE_OPERAND (op0
, 0)) != ADDR_EXPR
2421 && integer_zerop (TREE_OPERAND (op0
, 1))
2422 /* Dump the types of INTEGER_CSTs explicitly, for we
2423 can't infer them and MEM_ATTR caching will share
2424 MEM_REFs with differently-typed op0s. */
2425 && TREE_CODE (TREE_OPERAND (op0
, 0)) != INTEGER_CST
2426 /* Released SSA_NAMES have no TREE_TYPE. */
2427 && TREE_TYPE (TREE_OPERAND (op0
, 0)) != NULL_TREE
2428 /* Same pointer types, but ignoring POINTER_TYPE vs.
2430 && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 0)))
2431 == TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 1))))
2432 && (TYPE_MODE (TREE_TYPE (TREE_OPERAND (op0
, 0)))
2433 == TYPE_MODE (TREE_TYPE (TREE_OPERAND (op0
, 1))))
2434 && (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (op0
, 0)))
2435 == TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (op0
, 1))))
2436 /* Same value types ignoring qualifiers. */
2437 && (TYPE_MAIN_VARIANT (TREE_TYPE (op0
))
2438 == TYPE_MAIN_VARIANT
2439 (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 1)))))
2440 && MR_DEPENDENCE_CLIQUE (op0
) == 0)))
2442 op0
= TREE_OPERAND (op0
, 0);
2445 if (op_prio (op0
) < op_prio (node
))
2447 dump_generic_node (pp
, op0
, spc
, flags
, false);
2448 if (op_prio (op0
) < op_prio (node
))
2449 pp_right_paren (pp
);
2450 pp_string (pp
, str
);
2451 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2452 op0
= component_ref_field_offset (node
);
2453 if (op0
&& TREE_CODE (op0
) != INTEGER_CST
)
2455 pp_string (pp
, "{off: ");
2456 dump_generic_node (pp
, op0
, spc
, flags
, false);
2457 pp_right_brace (pp
);
2462 if (flags
& TDF_GIMPLE
)
2464 pp_string (pp
, "__BIT_FIELD_REF <");
2465 dump_generic_node (pp
, TREE_TYPE (node
),
2466 spc
, flags
| TDF_SLIM
, false);
2467 if (TYPE_ALIGN (TREE_TYPE (node
))
2468 != TYPE_ALIGN (TYPE_MAIN_VARIANT (TREE_TYPE (node
))))
2470 pp_string (pp
, ", ");
2471 pp_decimal_int (pp
, TYPE_ALIGN (TREE_TYPE (node
)));
2474 pp_string (pp
, " (");
2475 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
,
2476 flags
| TDF_SLIM
, false);
2477 pp_string (pp
, ", ");
2478 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
,
2479 flags
| TDF_SLIM
, false);
2480 pp_string (pp
, ", ");
2481 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
,
2482 flags
| TDF_SLIM
, false);
2483 pp_right_paren (pp
);
2487 pp_string (pp
, "BIT_FIELD_REF <");
2488 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2489 pp_string (pp
, ", ");
2490 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2491 pp_string (pp
, ", ");
2492 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2497 case BIT_INSERT_EXPR
:
2498 pp_string (pp
, "BIT_INSERT_EXPR <");
2499 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2500 pp_string (pp
, ", ");
2501 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2502 pp_string (pp
, ", ");
2503 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2504 pp_string (pp
, " (");
2505 if (INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (node
, 1))))
2507 TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (node
, 1))));
2509 dump_generic_node (pp
, TYPE_SIZE (TREE_TYPE (TREE_OPERAND (node
, 1))),
2511 pp_string (pp
, " bits)>");
2515 case ARRAY_RANGE_REF
:
2516 op0
= TREE_OPERAND (node
, 0);
2517 if (op_prio (op0
) < op_prio (node
))
2519 dump_generic_node (pp
, op0
, spc
, flags
, false);
2520 if (op_prio (op0
) < op_prio (node
))
2521 pp_right_paren (pp
);
2522 pp_left_bracket (pp
);
2523 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2524 if (TREE_CODE (node
) == ARRAY_RANGE_REF
)
2525 pp_string (pp
, " ...");
2526 pp_right_bracket (pp
);
2528 op0
= array_ref_low_bound (node
);
2529 op1
= array_ref_element_size (node
);
2531 if (!integer_zerop (op0
)
2532 || TREE_OPERAND (node
, 2)
2533 || TREE_OPERAND (node
, 3))
2535 pp_string (pp
, "{lb: ");
2536 dump_generic_node (pp
, op0
, spc
, flags
, false);
2537 pp_string (pp
, " sz: ");
2538 dump_generic_node (pp
, op1
, spc
, flags
, false);
2539 pp_right_brace (pp
);
2545 unsigned HOST_WIDE_INT ix
;
2547 bool is_struct_init
= false;
2548 bool is_array_init
= false;
2550 if (flags
& TDF_GIMPLE
)
2552 pp_string (pp
, "_Literal (");
2553 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
2554 pp_string (pp
, ") ");
2557 if (TREE_CLOBBER_P (node
))
2559 pp_string (pp
, "CLOBBER");
2560 if (CLOBBER_KIND (node
) == CLOBBER_EOL
)
2561 pp_string (pp
, "(eol)");
2563 else if (TREE_CODE (TREE_TYPE (node
)) == RECORD_TYPE
2564 || TREE_CODE (TREE_TYPE (node
)) == UNION_TYPE
)
2565 is_struct_init
= true;
2566 else if (TREE_CODE (TREE_TYPE (node
)) == ARRAY_TYPE
2567 && TYPE_DOMAIN (TREE_TYPE (node
))
2568 && TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
)))
2569 && TREE_CODE (TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
))))
2572 tree minv
= TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
)));
2573 is_array_init
= true;
2574 curidx
= wi::to_widest (minv
);
2576 FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (node
), ix
, field
, val
)
2583 dump_generic_node (pp
, field
, spc
, flags
, false);
2586 else if (is_array_init
2587 && (TREE_CODE (field
) != INTEGER_CST
2588 || curidx
!= wi::to_widest (field
)))
2590 pp_left_bracket (pp
);
2591 if (TREE_CODE (field
) == RANGE_EXPR
)
2593 dump_generic_node (pp
, TREE_OPERAND (field
, 0), spc
,
2595 pp_string (pp
, " ... ");
2596 dump_generic_node (pp
, TREE_OPERAND (field
, 1), spc
,
2598 if (TREE_CODE (TREE_OPERAND (field
, 1)) == INTEGER_CST
)
2599 curidx
= wi::to_widest (TREE_OPERAND (field
, 1));
2602 dump_generic_node (pp
, field
, spc
, flags
, false);
2603 if (TREE_CODE (field
) == INTEGER_CST
)
2604 curidx
= wi::to_widest (field
);
2605 pp_string (pp
, "]=");
2610 if (val
&& TREE_CODE (val
) == ADDR_EXPR
)
2611 if (TREE_CODE (TREE_OPERAND (val
, 0)) == FUNCTION_DECL
)
2612 val
= TREE_OPERAND (val
, 0);
2613 if (val
&& TREE_CODE (val
) == FUNCTION_DECL
)
2614 dump_decl_name (pp
, val
, flags
);
2616 dump_generic_node (pp
, val
, spc
, flags
, false);
2617 if (ix
!= CONSTRUCTOR_NELTS (node
) - 1)
2623 pp_right_brace (pp
);
2630 if (flags
& TDF_SLIM
)
2632 pp_string (pp
, "<COMPOUND_EXPR>");
2636 dump_generic_node (pp
, TREE_OPERAND (node
, 0),
2637 spc
, flags
, !(flags
& TDF_SLIM
));
2638 if (flags
& TDF_SLIM
)
2639 newline_and_indent (pp
, spc
);
2646 for (tp
= &TREE_OPERAND (node
, 1);
2647 TREE_CODE (*tp
) == COMPOUND_EXPR
;
2648 tp
= &TREE_OPERAND (*tp
, 1))
2650 dump_generic_node (pp
, TREE_OPERAND (*tp
, 0),
2651 spc
, flags
, !(flags
& TDF_SLIM
));
2652 if (flags
& TDF_SLIM
)
2653 newline_and_indent (pp
, spc
);
2661 dump_generic_node (pp
, *tp
, spc
, flags
, !(flags
& TDF_SLIM
));
2665 case STATEMENT_LIST
:
2667 tree_stmt_iterator si
;
2670 if (flags
& TDF_SLIM
)
2672 pp_string (pp
, "<STATEMENT_LIST>");
2676 for (si
= tsi_start (node
); !tsi_end_p (si
); tsi_next (&si
))
2679 newline_and_indent (pp
, spc
);
2682 dump_generic_node (pp
, tsi_stmt (si
), spc
, flags
, true);
2689 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
,
2694 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
,
2699 pp_string (pp
, "TARGET_EXPR <");
2700 dump_generic_node (pp
, TARGET_EXPR_SLOT (node
), spc
, flags
, false);
2703 dump_generic_node (pp
, TARGET_EXPR_INITIAL (node
), spc
, flags
, false);
2708 print_declaration (pp
, DECL_EXPR_DECL (node
), spc
, flags
);
2713 if (TREE_TYPE (node
) == NULL
|| TREE_TYPE (node
) == void_type_node
)
2715 pp_string (pp
, "if (");
2716 dump_generic_node (pp
, COND_EXPR_COND (node
), spc
, flags
, false);
2717 pp_right_paren (pp
);
2718 /* The lowered cond_exprs should always be printed in full. */
2719 if (COND_EXPR_THEN (node
)
2720 && (IS_EMPTY_STMT (COND_EXPR_THEN (node
))
2721 || TREE_CODE (COND_EXPR_THEN (node
)) == GOTO_EXPR
)
2722 && COND_EXPR_ELSE (node
)
2723 && (IS_EMPTY_STMT (COND_EXPR_ELSE (node
))
2724 || TREE_CODE (COND_EXPR_ELSE (node
)) == GOTO_EXPR
))
2727 dump_generic_node (pp
, COND_EXPR_THEN (node
),
2729 if (!IS_EMPTY_STMT (COND_EXPR_ELSE (node
)))
2731 pp_string (pp
, " else ");
2732 dump_generic_node (pp
, COND_EXPR_ELSE (node
),
2736 else if (!(flags
& TDF_SLIM
))
2738 /* Output COND_EXPR_THEN. */
2739 if (COND_EXPR_THEN (node
))
2741 newline_and_indent (pp
, spc
+2);
2743 newline_and_indent (pp
, spc
+4);
2744 dump_generic_node (pp
, COND_EXPR_THEN (node
), spc
+4,
2746 newline_and_indent (pp
, spc
+2);
2747 pp_right_brace (pp
);
2750 /* Output COND_EXPR_ELSE. */
2751 if (COND_EXPR_ELSE (node
)
2752 && !IS_EMPTY_STMT (COND_EXPR_ELSE (node
)))
2754 newline_and_indent (pp
, spc
);
2755 pp_string (pp
, "else");
2756 newline_and_indent (pp
, spc
+2);
2758 newline_and_indent (pp
, spc
+4);
2759 dump_generic_node (pp
, COND_EXPR_ELSE (node
), spc
+4,
2761 newline_and_indent (pp
, spc
+2);
2762 pp_right_brace (pp
);
2769 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2773 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2777 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2783 if (!(flags
& TDF_SLIM
))
2785 if (BIND_EXPR_VARS (node
))
2789 for (op0
= BIND_EXPR_VARS (node
); op0
; op0
= DECL_CHAIN (op0
))
2791 print_declaration (pp
, op0
, spc
+2, flags
);
2796 newline_and_indent (pp
, spc
+2);
2797 dump_generic_node (pp
, BIND_EXPR_BODY (node
), spc
+2, flags
, true);
2798 newline_and_indent (pp
, spc
);
2799 pp_right_brace (pp
);
2805 if (CALL_EXPR_FN (node
) != NULL_TREE
)
2806 print_call_name (pp
, CALL_EXPR_FN (node
), flags
);
2810 pp_string (pp
, internal_fn_name (CALL_EXPR_IFN (node
)));
2813 /* Print parameters. */
2818 call_expr_arg_iterator iter
;
2819 FOR_EACH_CALL_EXPR_ARG (arg
, iter
, node
)
2821 dump_generic_node (pp
, arg
, spc
, flags
, false);
2822 if (more_call_expr_args_p (&iter
))
2829 if (CALL_EXPR_VA_ARG_PACK (node
))
2831 if (call_expr_nargs (node
) > 0)
2836 pp_string (pp
, "__builtin_va_arg_pack ()");
2838 pp_right_paren (pp
);
2840 op1
= CALL_EXPR_STATIC_CHAIN (node
);
2843 pp_string (pp
, " [static-chain: ");
2844 dump_generic_node (pp
, op1
, spc
, flags
, false);
2845 pp_right_bracket (pp
);
2848 if (CALL_EXPR_RETURN_SLOT_OPT (node
))
2849 pp_string (pp
, " [return slot optimization]");
2850 if (CALL_EXPR_TAILCALL (node
))
2851 pp_string (pp
, " [tail call]");
2854 case WITH_CLEANUP_EXPR
:
2858 case CLEANUP_POINT_EXPR
:
2859 pp_string (pp
, "<<cleanup_point ");
2860 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2861 pp_string (pp
, ">>");
2864 case PLACEHOLDER_EXPR
:
2865 pp_string (pp
, "<PLACEHOLDER_EXPR ");
2866 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
2870 /* Binary arithmetic and logic expressions. */
2871 case WIDEN_PLUS_EXPR
:
2872 case WIDEN_MINUS_EXPR
:
2873 case WIDEN_SUM_EXPR
:
2874 case WIDEN_MULT_EXPR
:
2876 case MULT_HIGHPART_EXPR
:
2878 case POINTER_PLUS_EXPR
:
2879 case POINTER_DIFF_EXPR
:
2881 case TRUNC_DIV_EXPR
:
2883 case FLOOR_DIV_EXPR
:
2884 case ROUND_DIV_EXPR
:
2885 case TRUNC_MOD_EXPR
:
2887 case FLOOR_MOD_EXPR
:
2888 case ROUND_MOD_EXPR
:
2890 case EXACT_DIV_EXPR
:
2895 case WIDEN_LSHIFT_EXPR
:
2899 case TRUTH_ANDIF_EXPR
:
2900 case TRUTH_ORIF_EXPR
:
2901 case TRUTH_AND_EXPR
:
2903 case TRUTH_XOR_EXPR
:
2917 case UNORDERED_EXPR
:
2919 const char *op
= op_symbol (node
);
2920 op0
= TREE_OPERAND (node
, 0);
2921 op1
= TREE_OPERAND (node
, 1);
2923 /* When the operands are expressions with less priority,
2924 keep semantics of the tree representation. */
2925 if (op_prio (op0
) <= op_prio (node
))
2928 dump_generic_node (pp
, op0
, spc
, flags
, false);
2929 pp_right_paren (pp
);
2932 dump_generic_node (pp
, op0
, spc
, flags
, false);
2938 /* When the operands are expressions with less priority,
2939 keep semantics of the tree representation. */
2940 if (op_prio (op1
) <= op_prio (node
))
2943 dump_generic_node (pp
, op1
, spc
, flags
, false);
2944 pp_right_paren (pp
);
2947 dump_generic_node (pp
, op1
, spc
, flags
, false);
2951 /* Unary arithmetic and logic expressions. */
2953 if (flags
& TDF_GIMPLE_VAL
)
2955 pp_string (pp
, "_Literal (");
2956 dump_generic_node (pp
, TREE_TYPE (node
), spc
,
2957 flags
& ~TDF_GIMPLE_VAL
, false);
2958 pp_character (pp
, ')');
2963 case TRUTH_NOT_EXPR
:
2964 case PREDECREMENT_EXPR
:
2965 case PREINCREMENT_EXPR
:
2967 if (!(flags
& TDF_GIMPLE
)
2968 && TREE_CODE (node
) == ADDR_EXPR
2969 && (TREE_CODE (TREE_OPERAND (node
, 0)) == STRING_CST
2970 || TREE_CODE (TREE_OPERAND (node
, 0)) == FUNCTION_DECL
))
2971 /* Do not output '&' for strings and function pointers when not
2972 dumping GIMPLE FE syntax. */
2975 pp_string (pp
, op_symbol (node
));
2977 if (op_prio (TREE_OPERAND (node
, 0)) < op_prio (node
))
2980 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2981 pp_right_paren (pp
);
2984 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2987 case POSTDECREMENT_EXPR
:
2988 case POSTINCREMENT_EXPR
:
2989 if (op_prio (TREE_OPERAND (node
, 0)) < op_prio (node
))
2992 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2993 pp_right_paren (pp
);
2996 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2997 pp_string (pp
, op_symbol (node
));
3001 pp_string (pp
, "MIN_EXPR <");
3002 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3003 pp_string (pp
, ", ");
3004 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3009 pp_string (pp
, "MAX_EXPR <");
3010 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3011 pp_string (pp
, ", ");
3012 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3017 pp_string (pp
, "ABS_EXPR <");
3018 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3023 pp_string (pp
, "ABSU_EXPR <");
3024 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3032 case ADDR_SPACE_CONVERT_EXPR
:
3033 case FIXED_CONVERT_EXPR
:
3034 case FIX_TRUNC_EXPR
:
3037 type
= TREE_TYPE (node
);
3038 op0
= TREE_OPERAND (node
, 0);
3039 if (type
!= TREE_TYPE (op0
))
3042 dump_generic_node (pp
, type
, spc
, flags
, false);
3043 pp_string (pp
, ") ");
3045 if (op_prio (op0
) < op_prio (node
))
3047 dump_generic_node (pp
, op0
, spc
, flags
, false);
3048 if (op_prio (op0
) < op_prio (node
))
3049 pp_right_paren (pp
);
3052 case VIEW_CONVERT_EXPR
:
3053 if (flags
& TDF_GIMPLE
)
3054 pp_string (pp
, "__VIEW_CONVERT <");
3056 pp_string (pp
, "VIEW_CONVERT_EXPR<");
3057 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
3058 pp_string (pp
, ">(");
3059 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3060 pp_right_paren (pp
);
3064 pp_string (pp
, "((");
3065 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3066 pp_string (pp
, "))");
3069 case NON_LVALUE_EXPR
:
3070 pp_string (pp
, "NON_LVALUE_EXPR <");
3071 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3076 pp_string (pp
, "SAVE_EXPR <");
3077 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3082 pp_string (pp
, "COMPLEX_EXPR <");
3083 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3084 pp_string (pp
, ", ");
3085 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3090 pp_string (pp
, "CONJ_EXPR <");
3091 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3096 if (flags
& TDF_GIMPLE
)
3098 pp_string (pp
, "__real ");
3099 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3103 pp_string (pp
, "REALPART_EXPR <");
3104 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3110 if (flags
& TDF_GIMPLE
)
3112 pp_string (pp
, "__imag ");
3113 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3117 pp_string (pp
, "IMAGPART_EXPR <");
3118 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3124 pp_string (pp
, "VA_ARG_EXPR <");
3125 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3129 case TRY_FINALLY_EXPR
:
3130 case TRY_CATCH_EXPR
:
3131 pp_string (pp
, "try");
3132 newline_and_indent (pp
, spc
+2);
3134 newline_and_indent (pp
, spc
+4);
3135 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
+4, flags
, true);
3136 newline_and_indent (pp
, spc
+2);
3137 pp_right_brace (pp
);
3138 newline_and_indent (pp
, spc
);
3139 if (TREE_CODE (node
) == TRY_CATCH_EXPR
)
3141 node
= TREE_OPERAND (node
, 1);
3142 pp_string (pp
, "catch");
3146 gcc_assert (TREE_CODE (node
) == TRY_FINALLY_EXPR
);
3147 node
= TREE_OPERAND (node
, 1);
3148 pp_string (pp
, "finally");
3149 if (TREE_CODE (node
) == EH_ELSE_EXPR
)
3151 newline_and_indent (pp
, spc
+2);
3153 newline_and_indent (pp
, spc
+4);
3154 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
+4,
3156 newline_and_indent (pp
, spc
+2);
3157 pp_right_brace (pp
);
3158 newline_and_indent (pp
, spc
);
3159 node
= TREE_OPERAND (node
, 1);
3160 pp_string (pp
, "else");
3163 newline_and_indent (pp
, spc
+2);
3165 newline_and_indent (pp
, spc
+4);
3166 dump_generic_node (pp
, node
, spc
+4, flags
, true);
3167 newline_and_indent (pp
, spc
+2);
3168 pp_right_brace (pp
);
3173 pp_string (pp
, "catch (");
3174 dump_generic_node (pp
, CATCH_TYPES (node
), spc
+2, flags
, false);
3175 pp_right_paren (pp
);
3176 newline_and_indent (pp
, spc
+2);
3178 newline_and_indent (pp
, spc
+4);
3179 dump_generic_node (pp
, CATCH_BODY (node
), spc
+4, flags
, true);
3180 newline_and_indent (pp
, spc
+2);
3181 pp_right_brace (pp
);
3185 case EH_FILTER_EXPR
:
3186 pp_string (pp
, "<<<eh_filter (");
3187 dump_generic_node (pp
, EH_FILTER_TYPES (node
), spc
+2, flags
, false);
3188 pp_string (pp
, ")>>>");
3189 newline_and_indent (pp
, spc
+2);
3191 newline_and_indent (pp
, spc
+4);
3192 dump_generic_node (pp
, EH_FILTER_FAILURE (node
), spc
+4, flags
, true);
3193 newline_and_indent (pp
, spc
+2);
3194 pp_right_brace (pp
);
3199 op0
= TREE_OPERAND (node
, 0);
3200 /* If this is for break or continue, don't bother printing it. */
3201 if (DECL_NAME (op0
))
3203 const char *name
= IDENTIFIER_POINTER (DECL_NAME (op0
));
3204 if (strcmp (name
, "break") == 0
3205 || strcmp (name
, "continue") == 0)
3208 dump_generic_node (pp
, op0
, spc
, flags
, false);
3210 if (DECL_NONLOCAL (op0
))
3211 pp_string (pp
, " [non-local]");
3215 pp_string (pp
, "while (1)");
3216 if (!(flags
& TDF_SLIM
))
3218 newline_and_indent (pp
, spc
+2);
3220 newline_and_indent (pp
, spc
+4);
3221 dump_generic_node (pp
, LOOP_EXPR_BODY (node
), spc
+4, flags
, true);
3222 newline_and_indent (pp
, spc
+2);
3223 pp_right_brace (pp
);
3229 pp_string (pp
, "// predicted ");
3230 if (PREDICT_EXPR_OUTCOME (node
))
3231 pp_string (pp
, "likely by ");
3233 pp_string (pp
, "unlikely by ");
3234 pp_string (pp
, predictor_name (PREDICT_EXPR_PREDICTOR (node
)));
3235 pp_string (pp
, " predictor.");
3239 pp_string (pp
, "ANNOTATE_EXPR <");
3240 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3241 switch ((enum annot_expr_kind
) TREE_INT_CST_LOW (TREE_OPERAND (node
, 1)))
3243 case annot_expr_ivdep_kind
:
3244 pp_string (pp
, ", ivdep");
3246 case annot_expr_unroll_kind
:
3248 pp_string (pp
, ", unroll ");
3250 (int) TREE_INT_CST_LOW (TREE_OPERAND (node
, 2)));
3253 case annot_expr_no_vector_kind
:
3254 pp_string (pp
, ", no-vector");
3256 case annot_expr_vector_kind
:
3257 pp_string (pp
, ", vector");
3259 case annot_expr_parallel_kind
:
3260 pp_string (pp
, ", parallel");
3269 pp_string (pp
, "return");
3270 op0
= TREE_OPERAND (node
, 0);
3274 if (TREE_CODE (op0
) == MODIFY_EXPR
)
3275 dump_generic_node (pp
, TREE_OPERAND (op0
, 1),
3278 dump_generic_node (pp
, op0
, spc
, flags
, false);
3283 pp_string (pp
, "if (");
3284 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3285 pp_string (pp
, ") break");
3289 pp_string (pp
, "switch (");
3290 dump_generic_node (pp
, SWITCH_COND (node
), spc
, flags
, false);
3291 pp_right_paren (pp
);
3292 if (!(flags
& TDF_SLIM
))
3294 newline_and_indent (pp
, spc
+2);
3296 if (SWITCH_BODY (node
))
3298 newline_and_indent (pp
, spc
+4);
3299 dump_generic_node (pp
, SWITCH_BODY (node
), spc
+4, flags
,
3302 newline_and_indent (pp
, spc
+2);
3303 pp_right_brace (pp
);
3309 op0
= GOTO_DESTINATION (node
);
3310 if (TREE_CODE (op0
) != SSA_NAME
&& DECL_P (op0
) && DECL_NAME (op0
))
3312 const char *name
= IDENTIFIER_POINTER (DECL_NAME (op0
));
3313 if (strcmp (name
, "break") == 0
3314 || strcmp (name
, "continue") == 0)
3316 pp_string (pp
, name
);
3320 pp_string (pp
, "goto ");
3321 dump_generic_node (pp
, op0
, spc
, flags
, false);
3325 pp_string (pp
, "__asm__");
3326 if (ASM_VOLATILE_P (node
))
3327 pp_string (pp
, " __volatile__");
3329 dump_generic_node (pp
, ASM_STRING (node
), spc
, flags
, false);
3331 dump_generic_node (pp
, ASM_OUTPUTS (node
), spc
, flags
, false);
3333 dump_generic_node (pp
, ASM_INPUTS (node
), spc
, flags
, false);
3334 if (ASM_CLOBBERS (node
))
3337 dump_generic_node (pp
, ASM_CLOBBERS (node
), spc
, flags
, false);
3339 pp_right_paren (pp
);
3342 case CASE_LABEL_EXPR
:
3343 if (CASE_LOW (node
) && CASE_HIGH (node
))
3345 pp_string (pp
, "case ");
3346 dump_generic_node (pp
, CASE_LOW (node
), spc
, flags
, false);
3347 pp_string (pp
, " ... ");
3348 dump_generic_node (pp
, CASE_HIGH (node
), spc
, flags
, false);
3350 else if (CASE_LOW (node
))
3352 pp_string (pp
, "case ");
3353 dump_generic_node (pp
, CASE_LOW (node
), spc
, flags
, false);
3356 pp_string (pp
, "default");
3361 pp_string (pp
, "OBJ_TYPE_REF(");
3362 dump_generic_node (pp
, OBJ_TYPE_REF_EXPR (node
), spc
, flags
, false);
3364 /* We omit the class type for -fcompare-debug because we may
3365 drop TYPE_BINFO early depending on debug info, and then
3366 virtual_method_call_p would return false, whereas when
3367 TYPE_BINFO is preserved it may still return true and then
3368 we'd print the class type. Compare tree and rtl dumps for
3369 libstdc++-prettyprinters/shared_ptr.cc with and without -g,
3370 for example, at occurrences of OBJ_TYPE_REF. */
3371 if (!(flags
& (TDF_SLIM
| TDF_COMPARE_DEBUG
))
3372 && virtual_method_call_p (node
, true))
3374 pp_string (pp
, "(");
3375 dump_generic_node (pp
, obj_type_ref_class (node
, true),
3377 pp_string (pp
, ")");
3379 dump_generic_node (pp
, OBJ_TYPE_REF_OBJECT (node
), spc
, flags
, false);
3381 dump_generic_node (pp
, OBJ_TYPE_REF_TOKEN (node
), spc
, flags
, false);
3382 pp_right_paren (pp
);
3386 if (SSA_NAME_IDENTIFIER (node
))
3388 if ((flags
& TDF_NOUID
)
3389 && SSA_NAME_VAR (node
)
3390 && DECL_NAMELESS (SSA_NAME_VAR (node
)))
3391 dump_fancy_name (pp
, SSA_NAME_IDENTIFIER (node
));
3392 else if (! (flags
& TDF_GIMPLE
)
3393 || SSA_NAME_VAR (node
))
3394 dump_generic_node (pp
, SSA_NAME_IDENTIFIER (node
),
3398 pp_decimal_int (pp
, SSA_NAME_VERSION (node
));
3399 if (SSA_NAME_IS_DEFAULT_DEF (node
))
3400 pp_string (pp
, "(D)");
3401 if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (node
))
3402 pp_string (pp
, "(ab)");
3405 case WITH_SIZE_EXPR
:
3406 pp_string (pp
, "WITH_SIZE_EXPR <");
3407 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3408 pp_string (pp
, ", ");
3409 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3414 pp_string (pp
, "ASSERT_EXPR <");
3415 dump_generic_node (pp
, ASSERT_EXPR_VAR (node
), spc
, flags
, false);
3416 pp_string (pp
, ", ");
3417 dump_generic_node (pp
, ASSERT_EXPR_COND (node
), spc
, flags
, false);
3422 pp_string (pp
, "scev_known");
3425 case SCEV_NOT_KNOWN
:
3426 pp_string (pp
, "scev_not_known");
3429 case POLYNOMIAL_CHREC
:
3431 dump_generic_node (pp
, CHREC_LEFT (node
), spc
, flags
, false);
3432 pp_string (pp
, ", +, ");
3433 dump_generic_node (pp
, CHREC_RIGHT (node
), spc
, flags
, false);
3434 pp_string (pp
, "}_");
3435 pp_scalar (pp
, "%u", CHREC_VARIABLE (node
));
3439 case REALIGN_LOAD_EXPR
:
3440 pp_string (pp
, "REALIGN_LOAD <");
3441 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3442 pp_string (pp
, ", ");
3443 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3444 pp_string (pp
, ", ");
3445 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
3450 pp_string (pp
, " VEC_COND_EXPR < ");
3451 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3452 pp_string (pp
, " , ");
3453 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3454 pp_string (pp
, " , ");
3455 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
3456 pp_string (pp
, " > ");
3460 pp_string (pp
, " VEC_PERM_EXPR < ");
3461 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3462 pp_string (pp
, " , ");
3463 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3464 pp_string (pp
, " , ");
3465 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
3466 pp_string (pp
, " > ");
3470 pp_string (pp
, " DOT_PROD_EXPR < ");
3471 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3472 pp_string (pp
, ", ");
3473 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3474 pp_string (pp
, ", ");
3475 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
3476 pp_string (pp
, " > ");
3479 case WIDEN_MULT_PLUS_EXPR
:
3480 pp_string (pp
, " WIDEN_MULT_PLUS_EXPR < ");
3481 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3482 pp_string (pp
, ", ");
3483 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3484 pp_string (pp
, ", ");
3485 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
3486 pp_string (pp
, " > ");
3489 case WIDEN_MULT_MINUS_EXPR
:
3490 pp_string (pp
, " WIDEN_MULT_MINUS_EXPR < ");
3491 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3492 pp_string (pp
, ", ");
3493 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3494 pp_string (pp
, ", ");
3495 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
3496 pp_string (pp
, " > ");
3500 pp_string (pp
, "#pragma acc parallel");
3501 goto dump_omp_clauses_body
;
3504 pp_string (pp
, "#pragma acc kernels");
3505 goto dump_omp_clauses_body
;
3508 pp_string (pp
, "#pragma acc serial");
3509 goto dump_omp_clauses_body
;
3512 pp_string (pp
, "#pragma acc data");
3513 dump_omp_clauses (pp
, OACC_DATA_CLAUSES (node
), spc
, flags
);
3516 case OACC_HOST_DATA
:
3517 pp_string (pp
, "#pragma acc host_data");
3518 dump_omp_clauses (pp
, OACC_HOST_DATA_CLAUSES (node
), spc
, flags
);
3522 pp_string (pp
, "#pragma acc declare");
3523 dump_omp_clauses (pp
, OACC_DECLARE_CLAUSES (node
), spc
, flags
);
3527 pp_string (pp
, "#pragma acc update");
3528 dump_omp_clauses (pp
, OACC_UPDATE_CLAUSES (node
), spc
, flags
);
3531 case OACC_ENTER_DATA
:
3532 pp_string (pp
, "#pragma acc enter data");
3533 dump_omp_clauses (pp
, OACC_ENTER_DATA_CLAUSES (node
), spc
, flags
);
3536 case OACC_EXIT_DATA
:
3537 pp_string (pp
, "#pragma acc exit data");
3538 dump_omp_clauses (pp
, OACC_EXIT_DATA_CLAUSES (node
), spc
, flags
);
3542 pp_string (pp
, "#pragma acc cache");
3543 dump_omp_clauses (pp
, OACC_CACHE_CLAUSES (node
), spc
, flags
);
3547 pp_string (pp
, "#pragma omp parallel");
3548 dump_omp_clauses (pp
, OMP_PARALLEL_CLAUSES (node
), spc
, flags
);
3551 dump_omp_clauses_body
:
3552 dump_omp_clauses (pp
, OMP_CLAUSES (node
), spc
, flags
);
3556 if (!(flags
& TDF_SLIM
) && OMP_BODY (node
))
3558 newline_and_indent (pp
, spc
+ 2);
3560 newline_and_indent (pp
, spc
+ 4);
3561 dump_generic_node (pp
, OMP_BODY (node
), spc
+ 4, flags
, false);
3562 newline_and_indent (pp
, spc
+ 2);
3563 pp_right_brace (pp
);
3569 pp_string (pp
, OMP_TASK_BODY (node
) ? "#pragma omp task"
3570 : "#pragma omp taskwait");
3571 dump_omp_clauses (pp
, OMP_TASK_CLAUSES (node
), spc
, flags
);
3575 pp_string (pp
, "#pragma omp for");
3579 pp_string (pp
, "#pragma omp simd");
3582 case OMP_DISTRIBUTE
:
3583 pp_string (pp
, "#pragma omp distribute");
3587 pp_string (pp
, "#pragma omp taskloop");
3591 pp_string (pp
, "#pragma omp loop");
3595 pp_string (pp
, "#pragma acc loop");
3599 pp_string (pp
, "#pragma omp teams");
3600 dump_omp_clauses (pp
, OMP_TEAMS_CLAUSES (node
), spc
, flags
);
3603 case OMP_TARGET_DATA
:
3604 pp_string (pp
, "#pragma omp target data");
3605 dump_omp_clauses (pp
, OMP_TARGET_DATA_CLAUSES (node
), spc
, flags
);
3608 case OMP_TARGET_ENTER_DATA
:
3609 pp_string (pp
, "#pragma omp target enter data");
3610 dump_omp_clauses (pp
, OMP_TARGET_ENTER_DATA_CLAUSES (node
), spc
, flags
);
3614 case OMP_TARGET_EXIT_DATA
:
3615 pp_string (pp
, "#pragma omp target exit data");
3616 dump_omp_clauses (pp
, OMP_TARGET_EXIT_DATA_CLAUSES (node
), spc
, flags
);
3621 pp_string (pp
, "#pragma omp target");
3622 dump_omp_clauses (pp
, OMP_TARGET_CLAUSES (node
), spc
, flags
);
3625 case OMP_TARGET_UPDATE
:
3626 pp_string (pp
, "#pragma omp target update");
3627 dump_omp_clauses (pp
, OMP_TARGET_UPDATE_CLAUSES (node
), spc
, flags
);
3632 dump_omp_clauses (pp
, OMP_FOR_CLAUSES (node
), spc
, flags
);
3633 if (!(flags
& TDF_SLIM
))
3637 if (OMP_FOR_PRE_BODY (node
))
3639 newline_and_indent (pp
, spc
+ 2);
3642 newline_and_indent (pp
, spc
);
3643 dump_generic_node (pp
, OMP_FOR_PRE_BODY (node
),
3646 if (OMP_FOR_INIT (node
))
3649 for (i
= 0; i
< TREE_VEC_LENGTH (OMP_FOR_INIT (node
)); i
++)
3652 newline_and_indent (pp
, spc
);
3653 pp_string (pp
, "for (");
3654 tree init
= TREE_VEC_ELT (OMP_FOR_INIT (node
), i
);
3655 if (TREE_CODE (init
) != MODIFY_EXPR
3656 || TREE_CODE (TREE_OPERAND (init
, 1)) != TREE_VEC
)
3657 dump_generic_node (pp
, init
, spc
, flags
, false);
3660 dump_generic_node (pp
, TREE_OPERAND (init
, 0),
3662 pp_string (pp
, " = ");
3663 dump_omp_loop_non_rect_expr (pp
, TREE_OPERAND (init
, 1),
3666 pp_string (pp
, "; ");
3667 tree cond
= TREE_VEC_ELT (OMP_FOR_COND (node
), i
);
3668 if (!COMPARISON_CLASS_P (cond
)
3669 || TREE_CODE (TREE_OPERAND (cond
, 1)) != TREE_VEC
)
3670 dump_generic_node (pp
, cond
, spc
, flags
, false);
3673 dump_generic_node (pp
, TREE_OPERAND (cond
, 0),
3675 const char *op
= op_symbol (cond
);
3679 dump_omp_loop_non_rect_expr (pp
, TREE_OPERAND (cond
, 1),
3682 pp_string (pp
, "; ");
3683 dump_generic_node (pp
,
3684 TREE_VEC_ELT (OMP_FOR_INCR (node
), i
),
3686 pp_right_paren (pp
);
3689 if (OMP_FOR_BODY (node
))
3691 newline_and_indent (pp
, spc
+ 2);
3693 newline_and_indent (pp
, spc
+ 4);
3694 dump_generic_node (pp
, OMP_FOR_BODY (node
), spc
+ 4, flags
,
3696 newline_and_indent (pp
, spc
+ 2);
3697 pp_right_brace (pp
);
3699 if (OMP_FOR_INIT (node
))
3700 spc
-= 2 * TREE_VEC_LENGTH (OMP_FOR_INIT (node
)) - 2;
3701 if (OMP_FOR_PRE_BODY (node
))
3704 newline_and_indent (pp
, spc
+ 2);
3705 pp_right_brace (pp
);
3712 pp_string (pp
, "#pragma omp sections");
3713 dump_omp_clauses (pp
, OMP_SECTIONS_CLAUSES (node
), spc
, flags
);
3717 pp_string (pp
, "#pragma omp section");
3721 if (OMP_SCAN_CLAUSES (node
))
3723 pp_string (pp
, "#pragma omp scan");
3724 dump_omp_clauses (pp
, OMP_SCAN_CLAUSES (node
), spc
, flags
);
3729 pp_string (pp
, "#pragma omp master");
3733 pp_string (pp
, "#pragma omp masked");
3734 dump_omp_clauses (pp
, OMP_MASKED_CLAUSES (node
), spc
, flags
);
3738 pp_string (pp
, "#pragma omp taskgroup");
3739 dump_omp_clauses (pp
, OMP_TASKGROUP_CLAUSES (node
), spc
, flags
);
3743 pp_string (pp
, "#pragma omp ordered");
3744 dump_omp_clauses (pp
, OMP_ORDERED_CLAUSES (node
), spc
, flags
);
3748 pp_string (pp
, "#pragma omp critical");
3749 if (OMP_CRITICAL_NAME (node
))
3753 dump_generic_node (pp
, OMP_CRITICAL_NAME (node
), spc
,
3755 pp_right_paren (pp
);
3757 dump_omp_clauses (pp
, OMP_CRITICAL_CLAUSES (node
), spc
, flags
);
3761 pp_string (pp
, "#pragma omp atomic");
3762 if (OMP_ATOMIC_WEAK (node
))
3763 pp_string (pp
, " weak");
3764 dump_omp_atomic_memory_order (pp
, OMP_ATOMIC_MEMORY_ORDER (node
));
3765 newline_and_indent (pp
, spc
+ 2);
3766 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3770 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3773 case OMP_ATOMIC_READ
:
3774 pp_string (pp
, "#pragma omp atomic read");
3775 dump_omp_atomic_memory_order (pp
, OMP_ATOMIC_MEMORY_ORDER (node
));
3776 newline_and_indent (pp
, spc
+ 2);
3777 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3781 case OMP_ATOMIC_CAPTURE_OLD
:
3782 case OMP_ATOMIC_CAPTURE_NEW
:
3783 pp_string (pp
, "#pragma omp atomic capture");
3784 if (OMP_ATOMIC_WEAK (node
))
3785 pp_string (pp
, " weak");
3786 dump_omp_atomic_memory_order (pp
, OMP_ATOMIC_MEMORY_ORDER (node
));
3787 newline_and_indent (pp
, spc
+ 2);
3788 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3792 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3796 pp_string (pp
, "#pragma omp single");
3797 dump_omp_clauses (pp
, OMP_SINGLE_CLAUSES (node
), spc
, flags
);
3801 pp_string (pp
, "#pragma omp scope");
3802 dump_omp_clauses (pp
, OMP_SCOPE_CLAUSES (node
), spc
, flags
);
3806 /* If we come here, we're dumping something that's not an OMP construct,
3807 for example, OMP clauses attached to a function's '__attribute__'.
3808 Dump the whole OMP clause chain. */
3809 dump_omp_clauses (pp
, node
, spc
, flags
, false);
3813 case TRANSACTION_EXPR
:
3814 if (TRANSACTION_EXPR_OUTER (node
))
3815 pp_string (pp
, "__transaction_atomic [[outer]]");
3816 else if (TRANSACTION_EXPR_RELAXED (node
))
3817 pp_string (pp
, "__transaction_relaxed");
3819 pp_string (pp
, "__transaction_atomic");
3820 if (!(flags
& TDF_SLIM
) && TRANSACTION_EXPR_BODY (node
))
3822 newline_and_indent (pp
, spc
);
3824 newline_and_indent (pp
, spc
+ 2);
3825 dump_generic_node (pp
, TRANSACTION_EXPR_BODY (node
),
3826 spc
+ 2, flags
, false);
3827 newline_and_indent (pp
, spc
);
3828 pp_right_brace (pp
);
3833 case VEC_SERIES_EXPR
:
3834 case VEC_WIDEN_MULT_HI_EXPR
:
3835 case VEC_WIDEN_MULT_LO_EXPR
:
3836 case VEC_WIDEN_PLUS_HI_EXPR
:
3837 case VEC_WIDEN_PLUS_LO_EXPR
:
3838 case VEC_WIDEN_MINUS_HI_EXPR
:
3839 case VEC_WIDEN_MINUS_LO_EXPR
:
3840 case VEC_WIDEN_MULT_EVEN_EXPR
:
3841 case VEC_WIDEN_MULT_ODD_EXPR
:
3842 case VEC_WIDEN_LSHIFT_HI_EXPR
:
3843 case VEC_WIDEN_LSHIFT_LO_EXPR
:
3845 for (str
= get_tree_code_name (code
); *str
; str
++)
3846 pp_character (pp
, TOUPPER (*str
));
3847 pp_string (pp
, " < ");
3848 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3849 pp_string (pp
, ", ");
3850 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3851 pp_string (pp
, " > ");
3854 case VEC_DUPLICATE_EXPR
:
3856 for (str
= get_tree_code_name (code
); *str
; str
++)
3857 pp_character (pp
, TOUPPER (*str
));
3858 pp_string (pp
, " < ");
3859 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3860 pp_string (pp
, " > ");
3863 case VEC_UNPACK_HI_EXPR
:
3864 pp_string (pp
, " VEC_UNPACK_HI_EXPR < ");
3865 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3866 pp_string (pp
, " > ");
3869 case VEC_UNPACK_LO_EXPR
:
3870 pp_string (pp
, " VEC_UNPACK_LO_EXPR < ");
3871 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3872 pp_string (pp
, " > ");
3875 case VEC_UNPACK_FLOAT_HI_EXPR
:
3876 pp_string (pp
, " VEC_UNPACK_FLOAT_HI_EXPR < ");
3877 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3878 pp_string (pp
, " > ");
3881 case VEC_UNPACK_FLOAT_LO_EXPR
:
3882 pp_string (pp
, " VEC_UNPACK_FLOAT_LO_EXPR < ");
3883 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3884 pp_string (pp
, " > ");
3887 case VEC_UNPACK_FIX_TRUNC_HI_EXPR
:
3888 pp_string (pp
, " VEC_UNPACK_FIX_TRUNC_HI_EXPR < ");
3889 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3890 pp_string (pp
, " > ");
3893 case VEC_UNPACK_FIX_TRUNC_LO_EXPR
:
3894 pp_string (pp
, " VEC_UNPACK_FIX_TRUNC_LO_EXPR < ");
3895 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3896 pp_string (pp
, " > ");
3899 case VEC_PACK_TRUNC_EXPR
:
3900 pp_string (pp
, " VEC_PACK_TRUNC_EXPR < ");
3901 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3902 pp_string (pp
, ", ");
3903 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3904 pp_string (pp
, " > ");
3907 case VEC_PACK_SAT_EXPR
:
3908 pp_string (pp
, " VEC_PACK_SAT_EXPR < ");
3909 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3910 pp_string (pp
, ", ");
3911 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3912 pp_string (pp
, " > ");
3915 case VEC_PACK_FIX_TRUNC_EXPR
:
3916 pp_string (pp
, " VEC_PACK_FIX_TRUNC_EXPR < ");
3917 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3918 pp_string (pp
, ", ");
3919 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3920 pp_string (pp
, " > ");
3923 case VEC_PACK_FLOAT_EXPR
:
3924 pp_string (pp
, " VEC_PACK_FLOAT_EXPR < ");
3925 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3926 pp_string (pp
, ", ");
3927 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3928 pp_string (pp
, " > ");
3932 dump_block_node (pp
, node
, spc
, flags
);
3935 case DEBUG_BEGIN_STMT
:
3936 pp_string (pp
, "# DEBUG BEGIN STMT");
3943 if (is_stmt
&& is_expr
)
3949 /* Print the declaration of a variable. */
3952 print_declaration (pretty_printer
*pp
, tree t
, int spc
, dump_flags_t flags
)
3956 if (TREE_CODE(t
) == NAMELIST_DECL
)
3958 pp_string(pp
, "namelist ");
3959 dump_decl_name (pp
, t
, flags
);
3964 if (TREE_CODE (t
) == TYPE_DECL
)
3965 pp_string (pp
, "typedef ");
3967 if (CODE_CONTAINS_STRUCT (TREE_CODE (t
), TS_DECL_WRTL
) && DECL_REGISTER (t
))
3968 pp_string (pp
, "register ");
3970 if (TREE_PUBLIC (t
) && DECL_EXTERNAL (t
))
3971 pp_string (pp
, "extern ");
3972 else if (TREE_STATIC (t
))
3973 pp_string (pp
, "static ");
3975 /* Print the type and name. */
3976 if (TREE_TYPE (t
) && TREE_CODE (TREE_TYPE (t
)) == ARRAY_TYPE
)
3980 /* Print array's type. */
3981 tmp
= TREE_TYPE (t
);
3982 while (TREE_CODE (TREE_TYPE (tmp
)) == ARRAY_TYPE
)
3983 tmp
= TREE_TYPE (tmp
);
3984 dump_generic_node (pp
, TREE_TYPE (tmp
), spc
, flags
, false);
3986 /* Print variable's name. */
3988 dump_generic_node (pp
, t
, spc
, flags
, false);
3990 /* Print the dimensions. */
3991 tmp
= TREE_TYPE (t
);
3992 while (TREE_CODE (tmp
) == ARRAY_TYPE
)
3994 dump_array_domain (pp
, TYPE_DOMAIN (tmp
), spc
, flags
);
3995 tmp
= TREE_TYPE (tmp
);
3998 else if (TREE_CODE (t
) == FUNCTION_DECL
)
4000 dump_generic_node (pp
, TREE_TYPE (TREE_TYPE (t
)), spc
, flags
, false);
4002 dump_decl_name (pp
, t
, flags
);
4003 dump_function_declaration (pp
, TREE_TYPE (t
), spc
, flags
);
4007 /* Print type declaration. */
4008 dump_generic_node (pp
, TREE_TYPE (t
), spc
, flags
, false);
4010 /* Print variable's name. */
4012 dump_generic_node (pp
, t
, spc
, flags
, false);
4015 if (VAR_P (t
) && DECL_HARD_REGISTER (t
))
4017 pp_string (pp
, " __asm__ ");
4019 dump_generic_node (pp
, DECL_ASSEMBLER_NAME (t
), spc
, flags
, false);
4020 pp_right_paren (pp
);
4023 /* The initial value of a function serves to determine whether the function
4024 is declared or defined. So the following does not apply to function
4026 if (TREE_CODE (t
) != FUNCTION_DECL
)
4028 /* Print the initial value. */
4029 if (DECL_INITIAL (t
))
4034 if (!(flags
& TDF_SLIM
))
4035 dump_generic_node (pp
, DECL_INITIAL (t
), spc
, flags
, false);
4037 pp_string (pp
, "<<< omitted >>>");
4041 if (VAR_P (t
) && DECL_HAS_VALUE_EXPR_P (t
))
4043 pp_string (pp
, " [value-expr: ");
4044 dump_generic_node (pp
, DECL_VALUE_EXPR (t
), spc
, flags
, false);
4045 pp_right_bracket (pp
);
4052 /* Prints a structure: name, fields, and methods.
4053 FIXME: Still incomplete. */
4056 print_struct_decl (pretty_printer
*pp
, const_tree node
, int spc
,
4059 /* Print the name of the structure. */
4060 if (TYPE_NAME (node
))
4063 if (TREE_CODE (node
) == RECORD_TYPE
)
4064 pp_string (pp
, "struct ");
4065 else if ((TREE_CODE (node
) == UNION_TYPE
4066 || TREE_CODE (node
) == QUAL_UNION_TYPE
))
4067 pp_string (pp
, "union ");
4069 dump_generic_node (pp
, TYPE_NAME (node
), spc
, TDF_NONE
, false);
4072 /* Print the contents of the structure. */
4078 /* Print the fields of the structure. */
4081 tmp
= TYPE_FIELDS (node
);
4084 /* Avoid to print recursively the structure. */
4085 /* FIXME : Not implemented correctly...,
4086 what about the case when we have a cycle in the contain graph? ...
4087 Maybe this could be solved by looking at the scope in which the
4088 structure was declared. */
4089 if (TREE_TYPE (tmp
) != node
4090 && (TREE_CODE (TREE_TYPE (tmp
)) != POINTER_TYPE
4091 || TREE_TYPE (TREE_TYPE (tmp
)) != node
))
4093 print_declaration (pp
, tmp
, spc
+2, flags
);
4096 tmp
= DECL_CHAIN (tmp
);
4100 pp_right_brace (pp
);
4103 /* Return the priority of the operator CODE.
4105 From lowest to highest precedence with either left-to-right (L-R)
4106 or right-to-left (R-L) associativity]:
4109 2 [R-L] = += -= *= /= %= &= ^= |= <<= >>=
4121 14 [R-L] ! ~ ++ -- + - * & (type) sizeof
4122 15 [L-R] fn() [] -> .
4124 unary +, - and * have higher precedence than the corresponding binary
4128 op_code_prio (enum tree_code code
)
4145 case TRUTH_ORIF_EXPR
:
4148 case TRUTH_AND_EXPR
:
4149 case TRUTH_ANDIF_EXPR
:
4156 case TRUTH_XOR_EXPR
:
4173 case UNORDERED_EXPR
:
4184 case VEC_WIDEN_LSHIFT_HI_EXPR
:
4185 case VEC_WIDEN_LSHIFT_LO_EXPR
:
4186 case WIDEN_LSHIFT_EXPR
:
4189 case WIDEN_SUM_EXPR
:
4191 case POINTER_PLUS_EXPR
:
4192 case POINTER_DIFF_EXPR
:
4196 case VEC_WIDEN_MULT_HI_EXPR
:
4197 case VEC_WIDEN_MULT_LO_EXPR
:
4198 case WIDEN_MULT_EXPR
:
4200 case WIDEN_MULT_PLUS_EXPR
:
4201 case WIDEN_MULT_MINUS_EXPR
:
4203 case MULT_HIGHPART_EXPR
:
4204 case TRUNC_DIV_EXPR
:
4206 case FLOOR_DIV_EXPR
:
4207 case ROUND_DIV_EXPR
:
4209 case EXACT_DIV_EXPR
:
4210 case TRUNC_MOD_EXPR
:
4212 case FLOOR_MOD_EXPR
:
4213 case ROUND_MOD_EXPR
:
4216 case TRUTH_NOT_EXPR
:
4218 case POSTINCREMENT_EXPR
:
4219 case POSTDECREMENT_EXPR
:
4220 case PREINCREMENT_EXPR
:
4221 case PREDECREMENT_EXPR
:
4227 case FIX_TRUNC_EXPR
:
4233 case ARRAY_RANGE_REF
:
4237 /* Special expressions. */
4243 case VEC_UNPACK_HI_EXPR
:
4244 case VEC_UNPACK_LO_EXPR
:
4245 case VEC_UNPACK_FLOAT_HI_EXPR
:
4246 case VEC_UNPACK_FLOAT_LO_EXPR
:
4247 case VEC_UNPACK_FIX_TRUNC_HI_EXPR
:
4248 case VEC_UNPACK_FIX_TRUNC_LO_EXPR
:
4249 case VEC_PACK_TRUNC_EXPR
:
4250 case VEC_PACK_SAT_EXPR
:
4254 /* Return an arbitrarily high precedence to avoid surrounding single
4255 VAR_DECLs in ()s. */
4260 /* Return the priority of the operator OP. */
4263 op_prio (const_tree op
)
4265 enum tree_code code
;
4270 code
= TREE_CODE (op
);
4271 if (code
== SAVE_EXPR
|| code
== NON_LVALUE_EXPR
)
4272 return op_prio (TREE_OPERAND (op
, 0));
4274 return op_code_prio (code
);
4277 /* Return the symbol associated with operator CODE. */
4280 op_symbol_code (enum tree_code code
)
4288 case TRUTH_ORIF_EXPR
:
4291 case TRUTH_AND_EXPR
:
4292 case TRUTH_ANDIF_EXPR
:
4298 case TRUTH_XOR_EXPR
:
4308 case UNORDERED_EXPR
:
4354 case WIDEN_LSHIFT_EXPR
:
4357 case WIDEN_PLUS_EXPR
:
4360 case WIDEN_MINUS_EXPR
:
4363 case POINTER_PLUS_EXPR
:
4369 case WIDEN_SUM_EXPR
:
4372 case WIDEN_MULT_EXPR
:
4375 case MULT_HIGHPART_EXPR
:
4380 case POINTER_DIFF_EXPR
:
4386 case TRUTH_NOT_EXPR
:
4393 case TRUNC_DIV_EXPR
:
4400 case FLOOR_DIV_EXPR
:
4403 case ROUND_DIV_EXPR
:
4406 case EXACT_DIV_EXPR
:
4409 case TRUNC_MOD_EXPR
:
4415 case FLOOR_MOD_EXPR
:
4418 case ROUND_MOD_EXPR
:
4421 case PREDECREMENT_EXPR
:
4424 case PREINCREMENT_EXPR
:
4427 case POSTDECREMENT_EXPR
:
4430 case POSTINCREMENT_EXPR
:
4440 return "<<< ??? >>>";
4444 /* Return the symbol associated with operator OP. */
4447 op_symbol (const_tree op
)
4449 return op_symbol_code (TREE_CODE (op
));
4452 /* Prints the name of a call. NODE is the CALL_EXPR_FN of a CALL_EXPR or
4453 the gimple_call_fn of a GIMPLE_CALL. */
4456 print_call_name (pretty_printer
*pp
, tree node
, dump_flags_t flags
)
4461 if (TREE_CODE (op0
) == NON_LVALUE_EXPR
)
4462 op0
= TREE_OPERAND (op0
, 0);
4465 switch (TREE_CODE (op0
))
4470 dump_function_name (pp
, op0
, flags
);
4476 op0
= TREE_OPERAND (op0
, 0);
4481 dump_generic_node (pp
, TREE_OPERAND (op0
, 0), 0, flags
, false);
4482 pp_string (pp
, ") ? ");
4483 dump_generic_node (pp
, TREE_OPERAND (op0
, 1), 0, flags
, false);
4484 pp_string (pp
, " : ");
4485 dump_generic_node (pp
, TREE_OPERAND (op0
, 2), 0, flags
, false);
4489 if (TREE_CODE (TREE_OPERAND (op0
, 0)) == VAR_DECL
)
4490 dump_function_name (pp
, TREE_OPERAND (op0
, 0), flags
);
4492 dump_generic_node (pp
, op0
, 0, flags
, false);
4496 if (integer_zerop (TREE_OPERAND (op0
, 1)))
4498 op0
= TREE_OPERAND (op0
, 0);
4505 dump_generic_node (pp
, op0
, 0, flags
, false);
4513 /* Print the first N characters in the array STR, replacing non-printable
4514 characters (including embedded nuls) with unambiguous escape sequences. */
4517 pretty_print_string (pretty_printer
*pp
, const char *str
, size_t n
)
4522 for ( ; n
; --n
, ++str
)
4527 pp_string (pp
, "\\b");
4531 pp_string (pp
, "\\f");
4535 pp_string (pp
, "\\n");
4539 pp_string (pp
, "\\r");
4543 pp_string (pp
, "\\t");
4547 pp_string (pp
, "\\v");
4551 pp_string (pp
, "\\\\");
4555 pp_string (pp
, "\\\"");
4559 pp_string (pp
, "\\'");
4563 if (str
[0] || n
> 1)
4565 if (!ISPRINT (str
[0]))
4568 sprintf (buf
, "\\x%02x", (unsigned char)str
[0]);
4569 pp_string (pp
, buf
);
4572 pp_character (pp
, str
[0]);
4580 maybe_init_pretty_print (FILE *file
)
4584 tree_pp
= new pretty_printer ();
4585 pp_needs_newline (tree_pp
) = true;
4586 pp_translate_identifiers (tree_pp
) = false;
4589 tree_pp
->buffer
->stream
= file
;
4593 newline_and_indent (pretty_printer
*pp
, int spc
)
4599 /* Print the identifier ID to PRETTY-PRINTER. */
4602 pp_tree_identifier (pretty_printer
*pp
, tree id
)
4604 if (pp_translate_identifiers (pp
))
4606 const char *text
= identifier_to_locale (IDENTIFIER_POINTER (id
));
4607 pp_append_text (pp
, text
, text
+ strlen (text
));
4610 pp_append_text (pp
, IDENTIFIER_POINTER (id
),
4611 IDENTIFIER_POINTER (id
) + IDENTIFIER_LENGTH (id
));
4614 /* A helper function that is used to dump function information before the
4618 dump_function_header (FILE *dump_file
, tree fdecl
, dump_flags_t flags
)
4620 const char *dname
, *aname
;
4621 struct cgraph_node
*node
= cgraph_node::get (fdecl
);
4622 struct function
*fun
= DECL_STRUCT_FUNCTION (fdecl
);
4624 dname
= lang_hooks
.decl_printable_name (fdecl
, 1);
4626 if (DECL_ASSEMBLER_NAME_SET_P (fdecl
))
4627 aname
= (IDENTIFIER_POINTER
4628 (DECL_ASSEMBLER_NAME (fdecl
)));
4630 aname
= "<unset-asm-name>";
4632 fprintf (dump_file
, "\n;; Function %s (%s, funcdef_no=%d",
4633 dname
, aname
, fun
->funcdef_no
);
4634 if (!(flags
& TDF_NOUID
))
4635 fprintf (dump_file
, ", decl_uid=%d", DECL_UID (fdecl
));
4638 fprintf (dump_file
, ", cgraph_uid=%d", node
->get_uid ());
4639 fprintf (dump_file
, ", symbol_order=%d)%s\n\n", node
->order
,
4640 node
->frequency
== NODE_FREQUENCY_HOT
4642 : node
->frequency
== NODE_FREQUENCY_UNLIKELY_EXECUTED
4643 ? " (unlikely executed)"
4644 : node
->frequency
== NODE_FREQUENCY_EXECUTED_ONCE
4645 ? " (executed once)"
4649 fprintf (dump_file
, ")\n\n");
4652 /* Dump double_int D to pretty_printer PP. UNS is true
4653 if D is unsigned and false otherwise. */
4655 pp_double_int (pretty_printer
*pp
, double_int d
, bool uns
)
4658 pp_wide_integer (pp
, d
.low
);
4659 else if (d
.fits_uhwi ())
4660 pp_unsigned_wide_integer (pp
, d
.low
);
4663 unsigned HOST_WIDE_INT low
= d
.low
;
4664 HOST_WIDE_INT high
= d
.high
;
4665 if (!uns
&& d
.is_negative ())
4668 high
= ~high
+ !low
;
4671 /* Would "%x%0*x" or "%x%*0x" get zero-padding on all
4673 sprintf (pp_buffer (pp
)->digit_buffer
,
4674 HOST_WIDE_INT_PRINT_DOUBLE_HEX
,
4675 (unsigned HOST_WIDE_INT
) high
, low
);
4676 pp_string (pp
, pp_buffer (pp
)->digit_buffer
);
4681 # pragma GCC diagnostic pop