1 /* Pretty formatting of GENERIC trees in C syntax.
2 Copyright (C) 2001-2017 Free Software Foundation, Inc.
3 Adapted from c-pretty-print.c by Diego Novillo <dnovillo@redhat.com>
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 3, or (at your option) any later
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
23 #include "coretypes.h"
29 #include "tree-pretty-print.h"
30 #include "stor-layout.h"
31 #include "langhooks.h"
32 #include "tree-iterator.h"
34 #include "internal-fn.h"
35 #include "gomp-constants.h"
37 /* Local functions, macros and variables. */
38 static const char *op_symbol (const_tree
);
39 static void pretty_print_string (pretty_printer
*, const char*);
40 static void newline_and_indent (pretty_printer
*, int);
41 static void maybe_init_pretty_print (FILE *);
42 static void print_struct_decl (pretty_printer
*, const_tree
, int, int);
43 static void do_niy (pretty_printer
*, const_tree
, int);
45 #define INDENT(SPACE) do { \
46 int i; for (i = 0; i<SPACE; i++) pp_space (pp); } while (0)
48 #define NIY do_niy (pp, node, flags)
50 static pretty_printer
*tree_pp
;
52 /* Try to print something for an unknown tree code. */
55 do_niy (pretty_printer
*pp
, const_tree node
, int flags
)
59 pp_string (pp
, "<<< Unknown tree: ");
60 pp_string (pp
, get_tree_code_name (TREE_CODE (node
)));
64 len
= TREE_OPERAND_LENGTH (node
);
65 for (i
= 0; i
< len
; ++i
)
67 newline_and_indent (pp
, 2);
68 dump_generic_node (pp
, TREE_OPERAND (node
, i
), 2, flags
, false);
72 pp_string (pp
, " >>>");
75 /* Debugging function to print out a generic expression. */
78 debug_generic_expr (tree t
)
80 print_generic_expr (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
);
81 fprintf (stderr
, "\n");
84 /* Debugging function to print out a generic statement. */
87 debug_generic_stmt (tree t
)
89 print_generic_stmt (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
);
90 fprintf (stderr
, "\n");
93 /* Debugging function to print out a chain of trees . */
96 debug_tree_chain (tree t
)
102 print_generic_expr (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
|TDF_UID
);
103 fprintf (stderr
, " ");
107 fprintf (stderr
, "... [cycled back to ");
108 print_generic_expr (stderr
, t
, TDF_VOPS
|TDF_MEMSYMS
|TDF_UID
);
109 fprintf (stderr
, "]");
113 fprintf (stderr
, "\n");
116 /* Prints declaration DECL to the FILE with details specified by FLAGS. */
118 print_generic_decl (FILE *file
, tree decl
, int flags
)
120 maybe_init_pretty_print (file
);
121 print_declaration (tree_pp
, decl
, 2, flags
);
122 pp_write_text_to_stream (tree_pp
);
125 /* Print tree T, and its successors, on file FILE. FLAGS specifies details
126 to show in the dump. See TDF_* in dumpfile.h. */
129 print_generic_stmt (FILE *file
, tree t
, int flags
)
131 maybe_init_pretty_print (file
);
132 dump_generic_node (tree_pp
, t
, 0, flags
, true);
133 pp_newline_and_flush (tree_pp
);
136 /* Print tree T, and its successors, on file FILE. FLAGS specifies details
137 to show in the dump. See TDF_* in dumpfile.h. The output is indented by
141 print_generic_stmt_indented (FILE *file
, tree t
, int flags
, int indent
)
145 maybe_init_pretty_print (file
);
147 for (i
= 0; i
< indent
; i
++)
149 dump_generic_node (tree_pp
, t
, indent
, flags
, true);
150 pp_newline_and_flush (tree_pp
);
153 /* Print a single expression T on file FILE. FLAGS specifies details to show
154 in the dump. See TDF_* in dumpfile.h. */
157 print_generic_expr (FILE *file
, tree t
, int flags
)
159 maybe_init_pretty_print (file
);
160 dump_generic_node (tree_pp
, t
, 0, flags
, false);
164 /* Dump NAME, an IDENTIFIER_POINTER, sanitized so that D<num> sequences
165 in it are replaced with Dxxxx, as long as they are at the start or
166 preceded by $ and at the end or followed by $. See make_fancy_name
170 dump_fancy_name (pretty_printer
*pp
, tree name
)
173 int length
= IDENTIFIER_LENGTH (name
);
174 const char *n
= IDENTIFIER_POINTER (name
);
181 && (n
== IDENTIFIER_POINTER (name
) || n
[-1] == '$'))
184 while (ISDIGIT (n
[l
]))
186 if (n
[l
] == '\0' || n
[l
] == '$')
199 pp_tree_identifier (pp
, name
);
203 char *str
= XNEWVEC (char, length
+ 1);
206 q
= n
= IDENTIFIER_POINTER (name
);
213 && (q
== IDENTIFIER_POINTER (name
) || q
[-1] == '$'))
216 while (ISDIGIT (q
[l
]))
218 if (q
[l
] == '\0' || q
[l
] == '$')
220 memcpy (p
, n
, q
- n
);
221 memcpy (p
+ (q
- n
), "Dxxxx", 5);
231 memcpy (p
, n
, IDENTIFIER_LENGTH (name
) - (n
- IDENTIFIER_POINTER (name
)));
233 if (pp_translate_identifiers (pp
))
235 const char *text
= identifier_to_locale (str
);
236 pp_append_text (pp
, text
, text
+ strlen (text
));
239 pp_append_text (pp
, str
, str
+ length
);
243 /* Dump the name of a _DECL node and its DECL_UID if TDF_UID is set
247 dump_decl_name (pretty_printer
*pp
, tree node
, int flags
)
249 if (DECL_NAME (node
))
251 if ((flags
& TDF_ASMNAME
) && DECL_ASSEMBLER_NAME_SET_P (node
))
252 pp_tree_identifier (pp
, DECL_ASSEMBLER_NAME (node
));
253 /* For DECL_NAMELESS names look for embedded uids in the
254 names and sanitize them for TDF_NOUID. */
255 else if ((flags
& TDF_NOUID
) && DECL_NAMELESS (node
))
256 dump_fancy_name (pp
, DECL_NAME (node
));
258 pp_tree_identifier (pp
, DECL_NAME (node
));
260 char uid_sep
= (flags
& TDF_GIMPLE
) ? '_' : '.';
261 if ((flags
& TDF_UID
) || DECL_NAME (node
) == NULL_TREE
)
263 if (TREE_CODE (node
) == LABEL_DECL
&& LABEL_DECL_UID (node
) != -1)
264 pp_printf (pp
, "L%c%d", uid_sep
, (int) LABEL_DECL_UID (node
));
265 else if (TREE_CODE (node
) == DEBUG_EXPR_DECL
)
267 if (flags
& TDF_NOUID
)
268 pp_string (pp
, "D#xxxx");
270 pp_printf (pp
, "D#%i", DEBUG_TEMP_UID (node
));
274 char c
= TREE_CODE (node
) == CONST_DECL
? 'C' : 'D';
275 if (flags
& TDF_NOUID
)
276 pp_printf (pp
, "%c.xxxx", c
);
278 pp_printf (pp
, "%c%c%u", c
, uid_sep
, DECL_UID (node
));
281 if ((flags
& TDF_ALIAS
) && DECL_PT_UID (node
) != DECL_UID (node
))
283 if (flags
& TDF_NOUID
)
284 pp_printf (pp
, "ptD.xxxx");
286 pp_printf (pp
, "ptD.%u", DECL_PT_UID (node
));
290 /* Like the above, but used for pretty printing function calls. */
293 dump_function_name (pretty_printer
*pp
, tree node
, int flags
)
295 if (CONVERT_EXPR_P (node
))
296 node
= TREE_OPERAND (node
, 0);
297 if (DECL_NAME (node
) && (flags
& TDF_ASMNAME
) == 0)
298 pp_string (pp
, lang_hooks
.decl_printable_name (node
, 1));
300 dump_decl_name (pp
, node
, flags
);
303 /* Dump a function declaration. NODE is the FUNCTION_TYPE. PP, SPC and
304 FLAGS are as in dump_generic_node. */
307 dump_function_declaration (pretty_printer
*pp
, tree node
,
310 bool wrote_arg
= false;
316 /* Print the argument types. */
317 arg
= TYPE_ARG_TYPES (node
);
318 while (arg
&& arg
!= void_list_node
&& arg
!= error_mark_node
)
326 dump_generic_node (pp
, TREE_VALUE (arg
), spc
, flags
, false);
327 arg
= TREE_CHAIN (arg
);
330 /* Drop the trailing void_type_node if we had any previous argument. */
331 if (arg
== void_list_node
&& !wrote_arg
)
332 pp_string (pp
, "void");
333 /* Properly dump vararg function types. */
334 else if (!arg
&& wrote_arg
)
335 pp_string (pp
, ", ...");
336 /* Avoid printing any arg for unprototyped functions. */
341 /* Dump the domain associated with an array. */
344 dump_array_domain (pretty_printer
*pp
, tree domain
, int spc
, int flags
)
346 pp_left_bracket (pp
);
349 tree min
= TYPE_MIN_VALUE (domain
);
350 tree max
= TYPE_MAX_VALUE (domain
);
353 && integer_zerop (min
)
354 && tree_fits_shwi_p (max
))
355 pp_wide_integer (pp
, tree_to_shwi (max
) + 1);
359 dump_generic_node (pp
, min
, spc
, flags
, false);
362 dump_generic_node (pp
, max
, spc
, flags
, false);
366 pp_string (pp
, "<unknown>");
367 pp_right_bracket (pp
);
371 /* Dump OpenMP clause CLAUSE. PP, CLAUSE, SPC and FLAGS are as in
372 dump_generic_node. */
375 dump_omp_clause (pretty_printer
*pp
, tree clause
, int spc
, int flags
)
379 switch (OMP_CLAUSE_CODE (clause
))
381 case OMP_CLAUSE_PRIVATE
:
384 case OMP_CLAUSE_SHARED
:
387 case OMP_CLAUSE_FIRSTPRIVATE
:
388 name
= "firstprivate";
390 case OMP_CLAUSE_LASTPRIVATE
:
391 name
= "lastprivate";
393 case OMP_CLAUSE_COPYIN
:
396 case OMP_CLAUSE_COPYPRIVATE
:
397 name
= "copyprivate";
399 case OMP_CLAUSE_UNIFORM
:
402 case OMP_CLAUSE_USE_DEVICE_PTR
:
403 name
= "use_device_ptr";
405 case OMP_CLAUSE_IS_DEVICE_PTR
:
406 name
= "is_device_ptr";
408 case OMP_CLAUSE__LOOPTEMP_
:
411 case OMP_CLAUSE_TO_DECLARE
:
414 case OMP_CLAUSE_LINK
:
418 pp_string (pp
, name
);
420 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
425 case OMP_CLAUSE_REDUCTION
:
426 pp_string (pp
, "reduction(");
427 if (OMP_CLAUSE_REDUCTION_CODE (clause
) != ERROR_MARK
)
430 op_symbol_code (OMP_CLAUSE_REDUCTION_CODE (clause
)));
433 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
439 pp_string (pp
, "if(");
440 switch (OMP_CLAUSE_IF_MODIFIER (clause
))
442 case ERROR_MARK
: break;
443 case OMP_PARALLEL
: pp_string (pp
, "parallel:"); break;
444 case OMP_TASK
: pp_string (pp
, "task:"); break;
445 case OMP_TASKLOOP
: pp_string (pp
, "taskloop:"); break;
446 case OMP_TARGET_DATA
: pp_string (pp
, "target data:"); break;
447 case OMP_TARGET
: pp_string (pp
, "target:"); break;
448 case OMP_TARGET_UPDATE
: pp_string (pp
, "target update:"); break;
449 case OMP_TARGET_ENTER_DATA
:
450 pp_string (pp
, "target enter data:"); break;
451 case OMP_TARGET_EXIT_DATA
: pp_string (pp
, "target exit data:"); break;
452 default: gcc_unreachable ();
454 dump_generic_node (pp
, OMP_CLAUSE_IF_EXPR (clause
),
459 case OMP_CLAUSE_NUM_THREADS
:
460 pp_string (pp
, "num_threads(");
461 dump_generic_node (pp
, OMP_CLAUSE_NUM_THREADS_EXPR (clause
),
466 case OMP_CLAUSE__CILK_FOR_COUNT_
:
467 pp_string (pp
, "_Cilk_for_count_(");
468 dump_generic_node (pp
, OMP_CLAUSE_OPERAND (clause
, 0),
473 case OMP_CLAUSE_NOWAIT
:
474 pp_string (pp
, "nowait");
476 case OMP_CLAUSE_ORDERED
:
477 pp_string (pp
, "ordered");
478 if (OMP_CLAUSE_ORDERED_EXPR (clause
))
481 dump_generic_node (pp
, OMP_CLAUSE_ORDERED_EXPR (clause
),
487 case OMP_CLAUSE_DEFAULT
:
488 pp_string (pp
, "default(");
489 switch (OMP_CLAUSE_DEFAULT_KIND (clause
))
491 case OMP_CLAUSE_DEFAULT_UNSPECIFIED
:
493 case OMP_CLAUSE_DEFAULT_SHARED
:
494 pp_string (pp
, "shared");
496 case OMP_CLAUSE_DEFAULT_NONE
:
497 pp_string (pp
, "none");
499 case OMP_CLAUSE_DEFAULT_PRIVATE
:
500 pp_string (pp
, "private");
502 case OMP_CLAUSE_DEFAULT_FIRSTPRIVATE
:
503 pp_string (pp
, "firstprivate");
511 case OMP_CLAUSE_SCHEDULE
:
512 pp_string (pp
, "schedule(");
513 if (OMP_CLAUSE_SCHEDULE_KIND (clause
)
514 & (OMP_CLAUSE_SCHEDULE_MONOTONIC
515 | OMP_CLAUSE_SCHEDULE_NONMONOTONIC
))
517 if (OMP_CLAUSE_SCHEDULE_KIND (clause
)
518 & OMP_CLAUSE_SCHEDULE_MONOTONIC
)
519 pp_string (pp
, "monotonic");
521 pp_string (pp
, "nonmonotonic");
522 if (OMP_CLAUSE_SCHEDULE_SIMD (clause
))
527 if (OMP_CLAUSE_SCHEDULE_SIMD (clause
))
528 pp_string (pp
, "simd:");
530 switch (OMP_CLAUSE_SCHEDULE_KIND (clause
) & OMP_CLAUSE_SCHEDULE_MASK
)
532 case OMP_CLAUSE_SCHEDULE_STATIC
:
533 pp_string (pp
, "static");
535 case OMP_CLAUSE_SCHEDULE_DYNAMIC
:
536 pp_string (pp
, "dynamic");
538 case OMP_CLAUSE_SCHEDULE_GUIDED
:
539 pp_string (pp
, "guided");
541 case OMP_CLAUSE_SCHEDULE_RUNTIME
:
542 pp_string (pp
, "runtime");
544 case OMP_CLAUSE_SCHEDULE_AUTO
:
545 pp_string (pp
, "auto");
547 case OMP_CLAUSE_SCHEDULE_CILKFOR
:
548 pp_string (pp
, "cilk-for grain");
553 if (OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (clause
))
556 dump_generic_node (pp
, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (clause
),
562 case OMP_CLAUSE_UNTIED
:
563 pp_string (pp
, "untied");
566 case OMP_CLAUSE_COLLAPSE
:
567 pp_string (pp
, "collapse(");
568 dump_generic_node (pp
, OMP_CLAUSE_COLLAPSE_EXPR (clause
),
573 case OMP_CLAUSE_FINAL
:
574 pp_string (pp
, "final(");
575 dump_generic_node (pp
, OMP_CLAUSE_FINAL_EXPR (clause
),
580 case OMP_CLAUSE_MERGEABLE
:
581 pp_string (pp
, "mergeable");
584 case OMP_CLAUSE_LINEAR
:
585 pp_string (pp
, "linear(");
586 switch (OMP_CLAUSE_LINEAR_KIND (clause
))
588 case OMP_CLAUSE_LINEAR_DEFAULT
:
590 case OMP_CLAUSE_LINEAR_REF
:
591 pp_string (pp
, "ref(");
593 case OMP_CLAUSE_LINEAR_VAL
:
594 pp_string (pp
, "val(");
596 case OMP_CLAUSE_LINEAR_UVAL
:
597 pp_string (pp
, "uval(");
602 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
604 if (OMP_CLAUSE_LINEAR_KIND (clause
) != OMP_CLAUSE_LINEAR_DEFAULT
)
607 dump_generic_node (pp
, OMP_CLAUSE_LINEAR_STEP (clause
),
612 case OMP_CLAUSE_ALIGNED
:
613 pp_string (pp
, "aligned(");
614 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
616 if (OMP_CLAUSE_ALIGNED_ALIGNMENT (clause
))
619 dump_generic_node (pp
, OMP_CLAUSE_ALIGNED_ALIGNMENT (clause
),
625 case OMP_CLAUSE_DEPEND
:
626 pp_string (pp
, "depend(");
627 switch (OMP_CLAUSE_DEPEND_KIND (clause
))
629 case OMP_CLAUSE_DEPEND_IN
:
630 pp_string (pp
, "in");
632 case OMP_CLAUSE_DEPEND_OUT
:
633 pp_string (pp
, "out");
635 case OMP_CLAUSE_DEPEND_INOUT
:
636 pp_string (pp
, "inout");
638 case OMP_CLAUSE_DEPEND_SOURCE
:
639 pp_string (pp
, "source)");
641 case OMP_CLAUSE_DEPEND_SINK
:
642 pp_string (pp
, "sink:");
643 for (tree t
= OMP_CLAUSE_DECL (clause
); t
; t
= TREE_CHAIN (t
))
644 if (TREE_CODE (t
) == TREE_LIST
)
646 dump_generic_node (pp
, TREE_VALUE (t
), spc
, flags
, false);
647 if (TREE_PURPOSE (t
) != integer_zero_node
)
649 if (OMP_CLAUSE_DEPEND_SINK_NEGATIVE (t
))
653 dump_generic_node (pp
, TREE_PURPOSE (t
), spc
, flags
,
667 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
673 pp_string (pp
, "map(");
674 switch (OMP_CLAUSE_MAP_KIND (clause
))
677 case GOMP_MAP_POINTER
:
678 pp_string (pp
, "alloc");
681 case GOMP_MAP_TO_PSET
:
682 pp_string (pp
, "to");
685 pp_string (pp
, "from");
687 case GOMP_MAP_TOFROM
:
688 pp_string (pp
, "tofrom");
690 case GOMP_MAP_FORCE_ALLOC
:
691 pp_string (pp
, "force_alloc");
693 case GOMP_MAP_FORCE_TO
:
694 pp_string (pp
, "force_to");
696 case GOMP_MAP_FORCE_FROM
:
697 pp_string (pp
, "force_from");
699 case GOMP_MAP_FORCE_TOFROM
:
700 pp_string (pp
, "force_tofrom");
702 case GOMP_MAP_FORCE_PRESENT
:
703 pp_string (pp
, "force_present");
705 case GOMP_MAP_DELETE
:
706 pp_string (pp
, "delete");
708 case GOMP_MAP_FORCE_DEVICEPTR
:
709 pp_string (pp
, "force_deviceptr");
711 case GOMP_MAP_ALWAYS_TO
:
712 pp_string (pp
, "always,to");
714 case GOMP_MAP_ALWAYS_FROM
:
715 pp_string (pp
, "always,from");
717 case GOMP_MAP_ALWAYS_TOFROM
:
718 pp_string (pp
, "always,tofrom");
720 case GOMP_MAP_RELEASE
:
721 pp_string (pp
, "release");
723 case GOMP_MAP_FIRSTPRIVATE_POINTER
:
724 pp_string (pp
, "firstprivate");
726 case GOMP_MAP_FIRSTPRIVATE_REFERENCE
:
727 pp_string (pp
, "firstprivate ref");
729 case GOMP_MAP_STRUCT
:
730 pp_string (pp
, "struct");
732 case GOMP_MAP_ALWAYS_POINTER
:
733 pp_string (pp
, "always_pointer");
735 case GOMP_MAP_DEVICE_RESIDENT
:
736 pp_string (pp
, "device_resident");
739 pp_string (pp
, "link");
745 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
748 if (OMP_CLAUSE_SIZE (clause
))
750 switch (OMP_CLAUSE_CODE (clause
) == OMP_CLAUSE_MAP
751 ? OMP_CLAUSE_MAP_KIND (clause
) : GOMP_MAP_TO
)
753 case GOMP_MAP_POINTER
:
754 case GOMP_MAP_FIRSTPRIVATE_POINTER
:
755 case GOMP_MAP_FIRSTPRIVATE_REFERENCE
:
756 case GOMP_MAP_ALWAYS_POINTER
:
757 pp_string (pp
, " [pointer assign, bias: ");
759 case GOMP_MAP_TO_PSET
:
760 pp_string (pp
, " [pointer set, len: ");
763 pp_string (pp
, " [len: ");
766 dump_generic_node (pp
, OMP_CLAUSE_SIZE (clause
),
768 pp_right_bracket (pp
);
773 case OMP_CLAUSE_FROM
:
774 pp_string (pp
, "from(");
775 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
777 goto print_clause_size
;
780 pp_string (pp
, "to(");
781 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
783 goto print_clause_size
;
785 case OMP_CLAUSE__CACHE_
:
787 dump_generic_node (pp
, OMP_CLAUSE_DECL (clause
),
789 goto print_clause_size
;
791 case OMP_CLAUSE_NUM_TEAMS
:
792 pp_string (pp
, "num_teams(");
793 dump_generic_node (pp
, OMP_CLAUSE_NUM_TEAMS_EXPR (clause
),
798 case OMP_CLAUSE_THREAD_LIMIT
:
799 pp_string (pp
, "thread_limit(");
800 dump_generic_node (pp
, OMP_CLAUSE_THREAD_LIMIT_EXPR (clause
),
805 case OMP_CLAUSE_DEVICE
:
806 pp_string (pp
, "device(");
807 dump_generic_node (pp
, OMP_CLAUSE_DEVICE_ID (clause
),
812 case OMP_CLAUSE_DIST_SCHEDULE
:
813 pp_string (pp
, "dist_schedule(static");
814 if (OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR (clause
))
817 dump_generic_node (pp
,
818 OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR (clause
),
824 case OMP_CLAUSE_PROC_BIND
:
825 pp_string (pp
, "proc_bind(");
826 switch (OMP_CLAUSE_PROC_BIND_KIND (clause
))
828 case OMP_CLAUSE_PROC_BIND_MASTER
:
829 pp_string (pp
, "master");
831 case OMP_CLAUSE_PROC_BIND_CLOSE
:
832 pp_string (pp
, "close");
834 case OMP_CLAUSE_PROC_BIND_SPREAD
:
835 pp_string (pp
, "spread");
843 case OMP_CLAUSE_SAFELEN
:
844 pp_string (pp
, "safelen(");
845 dump_generic_node (pp
, OMP_CLAUSE_SAFELEN_EXPR (clause
),
850 case OMP_CLAUSE_SIMDLEN
:
851 pp_string (pp
, "simdlen(");
852 dump_generic_node (pp
, OMP_CLAUSE_SIMDLEN_EXPR (clause
),
857 case OMP_CLAUSE_PRIORITY
:
858 pp_string (pp
, "priority(");
859 dump_generic_node (pp
, OMP_CLAUSE_PRIORITY_EXPR (clause
),
864 case OMP_CLAUSE_GRAINSIZE
:
865 pp_string (pp
, "grainsize(");
866 dump_generic_node (pp
, OMP_CLAUSE_GRAINSIZE_EXPR (clause
),
871 case OMP_CLAUSE_NUM_TASKS
:
872 pp_string (pp
, "num_tasks(");
873 dump_generic_node (pp
, OMP_CLAUSE_NUM_TASKS_EXPR (clause
),
878 case OMP_CLAUSE_HINT
:
879 pp_string (pp
, "hint(");
880 dump_generic_node (pp
, OMP_CLAUSE_HINT_EXPR (clause
),
885 case OMP_CLAUSE_DEFAULTMAP
:
886 pp_string (pp
, "defaultmap(tofrom:scalar)");
889 case OMP_CLAUSE__SIMDUID_
:
890 pp_string (pp
, "_simduid_(");
891 dump_generic_node (pp
, OMP_CLAUSE__SIMDUID__DECL (clause
),
896 case OMP_CLAUSE__SIMT_
:
897 pp_string (pp
, "_simt_");
900 case OMP_CLAUSE_GANG
:
901 pp_string (pp
, "gang");
902 if (OMP_CLAUSE_GANG_EXPR (clause
) != NULL_TREE
)
904 pp_string (pp
, "(num: ");
905 dump_generic_node (pp
, OMP_CLAUSE_GANG_EXPR (clause
),
908 if (OMP_CLAUSE_GANG_STATIC_EXPR (clause
) != NULL_TREE
)
910 if (OMP_CLAUSE_GANG_EXPR (clause
) == NULL_TREE
)
914 pp_string (pp
, "static:");
915 if (OMP_CLAUSE_GANG_STATIC_EXPR (clause
)
916 == integer_minus_one_node
)
917 pp_character (pp
, '*');
919 dump_generic_node (pp
, OMP_CLAUSE_GANG_STATIC_EXPR (clause
),
922 if (OMP_CLAUSE_GANG_EXPR (clause
) != NULL_TREE
923 || OMP_CLAUSE_GANG_STATIC_EXPR (clause
) != NULL_TREE
)
927 case OMP_CLAUSE_ASYNC
:
928 pp_string (pp
, "async");
929 if (OMP_CLAUSE_ASYNC_EXPR (clause
))
931 pp_character(pp
, '(');
932 dump_generic_node (pp
, OMP_CLAUSE_ASYNC_EXPR (clause
),
934 pp_character(pp
, ')');
938 case OMP_CLAUSE_AUTO
:
940 pp_string (pp
, omp_clause_code_name
[OMP_CLAUSE_CODE (clause
)]);
943 case OMP_CLAUSE_WAIT
:
944 pp_string (pp
, "wait(");
945 dump_generic_node (pp
, OMP_CLAUSE_WAIT_EXPR (clause
),
947 pp_character(pp
, ')');
950 case OMP_CLAUSE_WORKER
:
951 pp_string (pp
, "worker");
952 if (OMP_CLAUSE_WORKER_EXPR (clause
) != NULL_TREE
)
955 dump_generic_node (pp
, OMP_CLAUSE_WORKER_EXPR (clause
),
961 case OMP_CLAUSE_VECTOR
:
962 pp_string (pp
, "vector");
963 if (OMP_CLAUSE_VECTOR_EXPR (clause
) != NULL_TREE
)
966 dump_generic_node (pp
, OMP_CLAUSE_VECTOR_EXPR (clause
),
972 case OMP_CLAUSE_NUM_GANGS
:
973 pp_string (pp
, "num_gangs(");
974 dump_generic_node (pp
, OMP_CLAUSE_NUM_GANGS_EXPR (clause
),
976 pp_character (pp
, ')');
979 case OMP_CLAUSE_NUM_WORKERS
:
980 pp_string (pp
, "num_workers(");
981 dump_generic_node (pp
, OMP_CLAUSE_NUM_WORKERS_EXPR (clause
),
983 pp_character (pp
, ')');
986 case OMP_CLAUSE_VECTOR_LENGTH
:
987 pp_string (pp
, "vector_length(");
988 dump_generic_node (pp
, OMP_CLAUSE_VECTOR_LENGTH_EXPR (clause
),
990 pp_character (pp
, ')');
993 case OMP_CLAUSE_INBRANCH
:
994 pp_string (pp
, "inbranch");
996 case OMP_CLAUSE_NOTINBRANCH
:
997 pp_string (pp
, "notinbranch");
1000 pp_string (pp
, "for");
1002 case OMP_CLAUSE_PARALLEL
:
1003 pp_string (pp
, "parallel");
1005 case OMP_CLAUSE_SECTIONS
:
1006 pp_string (pp
, "sections");
1008 case OMP_CLAUSE_TASKGROUP
:
1009 pp_string (pp
, "taskgroup");
1011 case OMP_CLAUSE_NOGROUP
:
1012 pp_string (pp
, "nogroup");
1014 case OMP_CLAUSE_THREADS
:
1015 pp_string (pp
, "threads");
1017 case OMP_CLAUSE_SIMD
:
1018 pp_string (pp
, "simd");
1020 case OMP_CLAUSE_INDEPENDENT
:
1021 pp_string (pp
, "independent");
1023 case OMP_CLAUSE_TILE
:
1024 pp_string (pp
, "tile(");
1025 dump_generic_node (pp
, OMP_CLAUSE_TILE_LIST (clause
),
1027 pp_right_paren (pp
);
1030 case OMP_CLAUSE__GRIDDIM_
:
1031 pp_string (pp
, "_griddim_(");
1032 pp_unsigned_wide_integer (pp
, OMP_CLAUSE__GRIDDIM__DIMENSION (clause
));
1034 dump_generic_node (pp
, OMP_CLAUSE__GRIDDIM__SIZE (clause
), spc
, flags
,
1037 dump_generic_node (pp
, OMP_CLAUSE__GRIDDIM__GROUP (clause
), spc
, flags
,
1039 pp_right_paren (pp
);
1043 /* Should never happen. */
1044 dump_generic_node (pp
, clause
, spc
, flags
, false);
1050 /* Dump the list of OpenMP clauses. PP, SPC and FLAGS are as in
1051 dump_generic_node. */
1054 dump_omp_clauses (pretty_printer
*pp
, tree clause
, int spc
, int flags
)
1062 dump_omp_clause (pp
, clause
, spc
, flags
);
1063 clause
= OMP_CLAUSE_CHAIN (clause
);
1071 /* Dump location LOC to PP. */
1074 dump_location (pretty_printer
*pp
, location_t loc
)
1076 expanded_location xloc
= expand_location (loc
);
1078 pp_left_bracket (pp
);
1081 pp_string (pp
, xloc
.file
);
1082 pp_string (pp
, ":");
1084 pp_decimal_int (pp
, xloc
.line
);
1086 pp_decimal_int (pp
, xloc
.column
);
1087 pp_string (pp
, "] ");
1091 /* Dump lexical block BLOCK. PP, SPC and FLAGS are as in
1092 dump_generic_node. */
1095 dump_block_node (pretty_printer
*pp
, tree block
, int spc
, int flags
)
1099 pp_printf (pp
, "BLOCK #%d ", BLOCK_NUMBER (block
));
1101 if (flags
& TDF_ADDRESS
)
1102 pp_printf (pp
, "[%p] ", (void *) block
);
1104 if (BLOCK_ABSTRACT (block
))
1105 pp_string (pp
, "[abstract] ");
1107 if (TREE_ASM_WRITTEN (block
))
1108 pp_string (pp
, "[written] ");
1110 if (flags
& TDF_SLIM
)
1113 if (BLOCK_SOURCE_LOCATION (block
))
1114 dump_location (pp
, BLOCK_SOURCE_LOCATION (block
));
1116 newline_and_indent (pp
, spc
+ 2);
1118 if (BLOCK_SUPERCONTEXT (block
))
1120 pp_string (pp
, "SUPERCONTEXT: ");
1121 dump_generic_node (pp
, BLOCK_SUPERCONTEXT (block
), 0,
1122 flags
| TDF_SLIM
, false);
1123 newline_and_indent (pp
, spc
+ 2);
1126 if (BLOCK_SUBBLOCKS (block
))
1128 pp_string (pp
, "SUBBLOCKS: ");
1129 for (t
= BLOCK_SUBBLOCKS (block
); t
; t
= BLOCK_CHAIN (t
))
1131 dump_generic_node (pp
, t
, 0, flags
| TDF_SLIM
, false);
1134 newline_and_indent (pp
, spc
+ 2);
1137 if (BLOCK_CHAIN (block
))
1139 pp_string (pp
, "SIBLINGS: ");
1140 for (t
= BLOCK_CHAIN (block
); t
; t
= BLOCK_CHAIN (t
))
1142 dump_generic_node (pp
, t
, 0, flags
| TDF_SLIM
, false);
1145 newline_and_indent (pp
, spc
+ 2);
1148 if (BLOCK_VARS (block
))
1150 pp_string (pp
, "VARS: ");
1151 for (t
= BLOCK_VARS (block
); t
; t
= TREE_CHAIN (t
))
1153 dump_generic_node (pp
, t
, 0, flags
, false);
1156 newline_and_indent (pp
, spc
+ 2);
1159 if (vec_safe_length (BLOCK_NONLOCALIZED_VARS (block
)) > 0)
1162 vec
<tree
, va_gc
> *nlv
= BLOCK_NONLOCALIZED_VARS (block
);
1164 pp_string (pp
, "NONLOCALIZED_VARS: ");
1165 FOR_EACH_VEC_ELT (*nlv
, i
, t
)
1167 dump_generic_node (pp
, t
, 0, flags
, false);
1170 newline_and_indent (pp
, spc
+ 2);
1173 if (BLOCK_ABSTRACT_ORIGIN (block
))
1175 pp_string (pp
, "ABSTRACT_ORIGIN: ");
1176 dump_generic_node (pp
, BLOCK_ABSTRACT_ORIGIN (block
), 0,
1177 flags
| TDF_SLIM
, false);
1178 newline_and_indent (pp
, spc
+ 2);
1181 if (BLOCK_FRAGMENT_ORIGIN (block
))
1183 pp_string (pp
, "FRAGMENT_ORIGIN: ");
1184 dump_generic_node (pp
, BLOCK_FRAGMENT_ORIGIN (block
), 0,
1185 flags
| TDF_SLIM
, false);
1186 newline_and_indent (pp
, spc
+ 2);
1189 if (BLOCK_FRAGMENT_CHAIN (block
))
1191 pp_string (pp
, "FRAGMENT_CHAIN: ");
1192 for (t
= BLOCK_FRAGMENT_CHAIN (block
); t
; t
= BLOCK_FRAGMENT_CHAIN (t
))
1194 dump_generic_node (pp
, t
, 0, flags
| TDF_SLIM
, false);
1197 newline_and_indent (pp
, spc
+ 2);
1202 /* Dump the node NODE on the pretty_printer PP, SPC spaces of
1203 indent. FLAGS specifies details to show in the dump (see TDF_* in
1204 dumpfile.h). If IS_STMT is true, the object printed is considered
1205 to be a statement and it is terminated by ';' if appropriate. */
1208 dump_generic_node (pretty_printer
*pp
, tree node
, int spc
, int flags
,
1215 enum tree_code code
;
1217 if (node
== NULL_TREE
)
1220 is_expr
= EXPR_P (node
);
1222 if (is_stmt
&& (flags
& TDF_STMTADDR
))
1223 pp_printf (pp
, "<&%p> ", (void *)node
);
1225 if ((flags
& TDF_LINENO
) && EXPR_HAS_LOCATION (node
))
1226 dump_location (pp
, EXPR_LOCATION (node
));
1228 code
= TREE_CODE (node
);
1232 pp_string (pp
, "<<< error >>>");
1235 case IDENTIFIER_NODE
:
1236 pp_tree_identifier (pp
, node
);
1240 while (node
&& node
!= error_mark_node
)
1242 if (TREE_PURPOSE (node
))
1244 dump_generic_node (pp
, TREE_PURPOSE (node
), spc
, flags
, false);
1247 dump_generic_node (pp
, TREE_VALUE (node
), spc
, flags
, false);
1248 node
= TREE_CHAIN (node
);
1249 if (node
&& TREE_CODE (node
) == TREE_LIST
)
1258 dump_generic_node (pp
, BINFO_TYPE (node
), spc
, flags
, false);
1264 if (TREE_VEC_LENGTH (node
) > 0)
1266 size_t len
= TREE_VEC_LENGTH (node
);
1267 for (i
= 0; i
< len
- 1; i
++)
1269 dump_generic_node (pp
, TREE_VEC_ELT (node
, i
), spc
, flags
,
1274 dump_generic_node (pp
, TREE_VEC_ELT (node
, len
- 1), spc
,
1281 case POINTER_BOUNDS_TYPE
:
1284 case FIXED_POINT_TYPE
:
1290 unsigned int quals
= TYPE_QUALS (node
);
1291 enum tree_code_class tclass
;
1293 if (quals
& TYPE_QUAL_ATOMIC
)
1294 pp_string (pp
, "atomic ");
1295 if (quals
& TYPE_QUAL_CONST
)
1296 pp_string (pp
, "const ");
1297 else if (quals
& TYPE_QUAL_VOLATILE
)
1298 pp_string (pp
, "volatile ");
1299 else if (quals
& TYPE_QUAL_RESTRICT
)
1300 pp_string (pp
, "restrict ");
1302 if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node
)))
1304 pp_string (pp
, "<address-space-");
1305 pp_decimal_int (pp
, TYPE_ADDR_SPACE (node
));
1306 pp_string (pp
, "> ");
1309 tclass
= TREE_CODE_CLASS (TREE_CODE (node
));
1311 if (tclass
== tcc_declaration
)
1313 if (DECL_NAME (node
))
1314 dump_decl_name (pp
, node
, flags
);
1316 pp_string (pp
, "<unnamed type decl>");
1318 else if (tclass
== tcc_type
)
1320 if (TYPE_NAME (node
))
1322 if (TREE_CODE (TYPE_NAME (node
)) == IDENTIFIER_NODE
)
1323 pp_tree_identifier (pp
, TYPE_NAME (node
));
1324 else if (TREE_CODE (TYPE_NAME (node
)) == TYPE_DECL
1325 && DECL_NAME (TYPE_NAME (node
)))
1326 dump_decl_name (pp
, TYPE_NAME (node
), flags
);
1328 pp_string (pp
, "<unnamed type>");
1330 else if (TREE_CODE (node
) == VECTOR_TYPE
)
1332 pp_string (pp
, "vector");
1334 pp_wide_integer (pp
, TYPE_VECTOR_SUBPARTS (node
));
1335 pp_string (pp
, ") ");
1336 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1338 else if (TREE_CODE (node
) == INTEGER_TYPE
)
1340 if (TYPE_PRECISION (node
) == CHAR_TYPE_SIZE
)
1341 pp_string (pp
, (TYPE_UNSIGNED (node
)
1344 else if (TYPE_PRECISION (node
) == SHORT_TYPE_SIZE
)
1345 pp_string (pp
, (TYPE_UNSIGNED (node
)
1348 else if (TYPE_PRECISION (node
) == INT_TYPE_SIZE
)
1349 pp_string (pp
, (TYPE_UNSIGNED (node
)
1352 else if (TYPE_PRECISION (node
) == LONG_TYPE_SIZE
)
1353 pp_string (pp
, (TYPE_UNSIGNED (node
)
1356 else if (TYPE_PRECISION (node
) == LONG_LONG_TYPE_SIZE
)
1357 pp_string (pp
, (TYPE_UNSIGNED (node
)
1358 ? "unsigned long long"
1359 : "signed long long"));
1360 else if (TYPE_PRECISION (node
) >= CHAR_TYPE_SIZE
1361 && pow2p_hwi (TYPE_PRECISION (node
)))
1363 pp_string (pp
, (TYPE_UNSIGNED (node
) ? "uint" : "int"));
1364 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1365 pp_string (pp
, "_t");
1369 pp_string (pp
, (TYPE_UNSIGNED (node
)
1370 ? "<unnamed-unsigned:"
1371 : "<unnamed-signed:"));
1372 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1376 else if (TREE_CODE (node
) == COMPLEX_TYPE
)
1378 pp_string (pp
, "__complex__ ");
1379 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1381 else if (TREE_CODE (node
) == REAL_TYPE
)
1383 pp_string (pp
, "<float:");
1384 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1387 else if (TREE_CODE (node
) == FIXED_POINT_TYPE
)
1389 pp_string (pp
, "<fixed-point-");
1390 pp_string (pp
, TYPE_SATURATING (node
) ? "sat:" : "nonsat:");
1391 pp_decimal_int (pp
, TYPE_PRECISION (node
));
1394 else if (TREE_CODE (node
) == VOID_TYPE
)
1395 pp_string (pp
, "void");
1397 pp_string (pp
, "<unnamed type>");
1403 case REFERENCE_TYPE
:
1404 str
= (TREE_CODE (node
) == POINTER_TYPE
? "*" : "&");
1406 if (TREE_TYPE (node
) == NULL
)
1408 pp_string (pp
, str
);
1409 pp_string (pp
, "<null type>");
1411 else if (TREE_CODE (TREE_TYPE (node
)) == FUNCTION_TYPE
)
1413 tree fnode
= TREE_TYPE (node
);
1415 dump_generic_node (pp
, TREE_TYPE (fnode
), spc
, flags
, false);
1418 pp_string (pp
, str
);
1419 if (TYPE_NAME (node
) && DECL_NAME (TYPE_NAME (node
)))
1420 dump_decl_name (pp
, TYPE_NAME (node
), flags
);
1421 else if (flags
& TDF_NOUID
)
1422 pp_printf (pp
, "<Txxxx>");
1424 pp_printf (pp
, "<T%x>", TYPE_UID (node
));
1426 pp_right_paren (pp
);
1427 dump_function_declaration (pp
, fnode
, spc
, flags
);
1431 unsigned int quals
= TYPE_QUALS (node
);
1433 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1435 pp_string (pp
, str
);
1437 if (quals
& TYPE_QUAL_CONST
)
1438 pp_string (pp
, " const");
1439 if (quals
& TYPE_QUAL_VOLATILE
)
1440 pp_string (pp
, " volatile");
1441 if (quals
& TYPE_QUAL_RESTRICT
)
1442 pp_string (pp
, " restrict");
1444 if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node
)))
1446 pp_string (pp
, " <address-space-");
1447 pp_decimal_int (pp
, TYPE_ADDR_SPACE (node
));
1451 if (TYPE_REF_CAN_ALIAS_ALL (node
))
1452 pp_string (pp
, " {ref-all}");
1462 if (flags
& TDF_GIMPLE
)
1464 pp_string (pp
, "__MEM <");
1465 dump_generic_node (pp
, TREE_TYPE (node
),
1466 spc
, flags
| TDF_SLIM
, false);
1467 if (TYPE_ALIGN (TREE_TYPE (node
))
1468 != TYPE_ALIGN (TYPE_MAIN_VARIANT (TREE_TYPE (node
))))
1470 pp_string (pp
, ", ");
1471 pp_decimal_int (pp
, TYPE_ALIGN (TREE_TYPE (node
)));
1474 pp_string (pp
, " (");
1475 if (TREE_TYPE (TREE_OPERAND (node
, 0))
1476 != TREE_TYPE (TREE_OPERAND (node
, 1)))
1479 dump_generic_node (pp
, TREE_TYPE (TREE_OPERAND (node
, 1)),
1480 spc
, flags
| TDF_SLIM
, false);
1481 pp_right_paren (pp
);
1483 dump_generic_node (pp
, TREE_OPERAND (node
, 0),
1484 spc
, flags
| TDF_SLIM
, false);
1485 if (! integer_zerop (TREE_OPERAND (node
, 1)))
1487 pp_string (pp
, " + ");
1488 dump_generic_node (pp
, TREE_OPERAND (node
, 1),
1489 spc
, flags
| TDF_SLIM
, false);
1491 pp_right_paren (pp
);
1493 else if (integer_zerop (TREE_OPERAND (node
, 1))
1494 /* Dump the types of INTEGER_CSTs explicitly, for we can't
1495 infer them and MEM_ATTR caching will share MEM_REFs
1496 with differently-typed op0s. */
1497 && TREE_CODE (TREE_OPERAND (node
, 0)) != INTEGER_CST
1498 /* Released SSA_NAMES have no TREE_TYPE. */
1499 && TREE_TYPE (TREE_OPERAND (node
, 0)) != NULL_TREE
1500 /* Same pointer types, but ignoring POINTER_TYPE vs.
1502 && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node
, 0)))
1503 == TREE_TYPE (TREE_TYPE (TREE_OPERAND (node
, 1))))
1504 && (TYPE_MODE (TREE_TYPE (TREE_OPERAND (node
, 0)))
1505 == TYPE_MODE (TREE_TYPE (TREE_OPERAND (node
, 1))))
1506 && (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node
, 0)))
1507 == TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (node
, 1))))
1508 /* Same value types ignoring qualifiers. */
1509 && (TYPE_MAIN_VARIANT (TREE_TYPE (node
))
1510 == TYPE_MAIN_VARIANT
1511 (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node
, 1)))))
1512 && (!(flags
& TDF_ALIAS
)
1513 || MR_DEPENDENCE_CLIQUE (node
) == 0))
1515 if (TREE_CODE (TREE_OPERAND (node
, 0)) != ADDR_EXPR
)
1518 dump_generic_node (pp
, TREE_OPERAND (node
, 0),
1522 dump_generic_node (pp
,
1523 TREE_OPERAND (TREE_OPERAND (node
, 0), 0),
1530 pp_string (pp
, "MEM[");
1532 ptype
= TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (node
, 1)));
1533 dump_generic_node (pp
, ptype
,
1534 spc
, flags
| TDF_SLIM
, false);
1535 pp_right_paren (pp
);
1536 dump_generic_node (pp
, TREE_OPERAND (node
, 0),
1538 if (!integer_zerop (TREE_OPERAND (node
, 1)))
1540 pp_string (pp
, " + ");
1541 dump_generic_node (pp
, TREE_OPERAND (node
, 1),
1544 if ((flags
& TDF_ALIAS
)
1545 && MR_DEPENDENCE_CLIQUE (node
) != 0)
1547 pp_string (pp
, " clique ");
1548 pp_unsigned_wide_integer (pp
, MR_DEPENDENCE_CLIQUE (node
));
1549 pp_string (pp
, " base ");
1550 pp_unsigned_wide_integer (pp
, MR_DEPENDENCE_BASE (node
));
1552 pp_right_bracket (pp
);
1557 case TARGET_MEM_REF
:
1559 const char *sep
= "";
1562 pp_string (pp
, "MEM[");
1564 if (TREE_CODE (TMR_BASE (node
)) == ADDR_EXPR
)
1566 pp_string (pp
, sep
);
1568 pp_string (pp
, "symbol: ");
1569 dump_generic_node (pp
, TREE_OPERAND (TMR_BASE (node
), 0),
1574 pp_string (pp
, sep
);
1576 pp_string (pp
, "base: ");
1577 dump_generic_node (pp
, TMR_BASE (node
), spc
, flags
, false);
1579 tmp
= TMR_INDEX2 (node
);
1582 pp_string (pp
, sep
);
1584 pp_string (pp
, "base: ");
1585 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1587 tmp
= TMR_INDEX (node
);
1590 pp_string (pp
, sep
);
1592 pp_string (pp
, "index: ");
1593 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1595 tmp
= TMR_STEP (node
);
1598 pp_string (pp
, sep
);
1600 pp_string (pp
, "step: ");
1601 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1603 tmp
= TMR_OFFSET (node
);
1606 pp_string (pp
, sep
);
1608 pp_string (pp
, "offset: ");
1609 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1611 pp_right_bracket (pp
);
1619 /* Print the innermost component type. */
1620 for (tmp
= TREE_TYPE (node
); TREE_CODE (tmp
) == ARRAY_TYPE
;
1621 tmp
= TREE_TYPE (tmp
))
1623 dump_generic_node (pp
, tmp
, spc
, flags
, false);
1625 /* Print the dimensions. */
1626 for (tmp
= node
; TREE_CODE (tmp
) == ARRAY_TYPE
; tmp
= TREE_TYPE (tmp
))
1627 dump_array_domain (pp
, TYPE_DOMAIN (tmp
), spc
, flags
);
1633 case QUAL_UNION_TYPE
:
1635 unsigned int quals
= TYPE_QUALS (node
);
1637 if (quals
& TYPE_QUAL_ATOMIC
)
1638 pp_string (pp
, "atomic ");
1639 if (quals
& TYPE_QUAL_CONST
)
1640 pp_string (pp
, "const ");
1641 if (quals
& TYPE_QUAL_VOLATILE
)
1642 pp_string (pp
, "volatile ");
1644 /* Print the name of the structure. */
1645 if (TREE_CODE (node
) == RECORD_TYPE
)
1646 pp_string (pp
, "struct ");
1647 else if (TREE_CODE (node
) == UNION_TYPE
)
1648 pp_string (pp
, "union ");
1650 if (TYPE_NAME (node
))
1651 dump_generic_node (pp
, TYPE_NAME (node
), spc
, flags
, false);
1652 else if (!(flags
& TDF_SLIM
))
1653 /* FIXME: If we eliminate the 'else' above and attempt
1654 to show the fields for named types, we may get stuck
1655 following a cycle of pointers to structs. The alleged
1656 self-reference check in print_struct_decl will not detect
1657 cycles involving more than one pointer or struct type. */
1658 print_struct_decl (pp
, node
, spc
, flags
);
1667 if (flags
& TDF_GIMPLE
1668 && (POINTER_TYPE_P (TREE_TYPE (node
))
1669 || (TYPE_PRECISION (TREE_TYPE (node
))
1670 < TYPE_PRECISION (integer_type_node
))
1671 || exact_log2 (TYPE_PRECISION (TREE_TYPE (node
))) == -1))
1673 pp_string (pp
, "_Literal (");
1674 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1675 pp_string (pp
, ") ");
1677 if (TREE_CODE (TREE_TYPE (node
)) == POINTER_TYPE
1678 && ! (flags
& TDF_GIMPLE
))
1680 /* In the case of a pointer, one may want to divide by the
1681 size of the pointed-to type. Unfortunately, this not
1682 straightforward. The C front-end maps expressions
1687 in such a way that the two INTEGER_CST nodes for "5" have
1688 different values but identical types. In the latter
1689 case, the 5 is multiplied by sizeof (int) in c-common.c
1690 (pointer_int_sum) to convert it to a byte address, and
1691 yet the type of the node is left unchanged. Argh. What
1692 is consistent though is that the number value corresponds
1693 to bytes (UNITS) offset.
1695 NB: Neither of the following divisors can be trivially
1696 used to recover the original literal:
1698 TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (node)))
1699 TYPE_PRECISION (TREE_TYPE (TREE_TYPE (node))) */
1700 pp_wide_integer (pp
, TREE_INT_CST_LOW (node
));
1701 pp_string (pp
, "B"); /* pseudo-unit */
1703 else if (tree_fits_shwi_p (node
))
1704 pp_wide_integer (pp
, tree_to_shwi (node
));
1705 else if (tree_fits_uhwi_p (node
))
1706 pp_unsigned_wide_integer (pp
, tree_to_uhwi (node
));
1709 wide_int val
= node
;
1711 if (wi::neg_p (val
, TYPE_SIGN (TREE_TYPE (node
))))
1716 print_hex (val
, pp_buffer (pp
)->digit_buffer
);
1717 pp_string (pp
, pp_buffer (pp
)->digit_buffer
);
1719 if ((flags
& TDF_GIMPLE
)
1720 && ! (POINTER_TYPE_P (TREE_TYPE (node
))
1721 || (TYPE_PRECISION (TREE_TYPE (node
))
1722 < TYPE_PRECISION (integer_type_node
))
1723 || exact_log2 (TYPE_PRECISION (TREE_TYPE (node
))) == -1))
1725 if (TYPE_UNSIGNED (TREE_TYPE (node
)))
1726 pp_character (pp
, 'u');
1727 if (TYPE_PRECISION (TREE_TYPE (node
))
1728 == TYPE_PRECISION (unsigned_type_node
))
1730 else if (TYPE_PRECISION (TREE_TYPE (node
))
1731 == TYPE_PRECISION (long_unsigned_type_node
))
1732 pp_character (pp
, 'l');
1733 else if (TYPE_PRECISION (TREE_TYPE (node
))
1734 == TYPE_PRECISION (long_long_unsigned_type_node
))
1735 pp_string (pp
, "ll");
1737 if (TREE_OVERFLOW (node
))
1738 pp_string (pp
, "(OVF)");
1742 /* Code copied from print_node. */
1745 if (TREE_OVERFLOW (node
))
1746 pp_string (pp
, " overflow");
1748 d
= TREE_REAL_CST (node
);
1749 if (REAL_VALUE_ISINF (d
))
1750 pp_string (pp
, REAL_VALUE_NEGATIVE (d
) ? " -Inf" : " Inf");
1751 else if (REAL_VALUE_ISNAN (d
))
1752 pp_string (pp
, " Nan");
1756 real_to_decimal (string
, &d
, sizeof (string
), 0, 1);
1757 pp_string (pp
, string
);
1765 fixed_to_decimal (string
, TREE_FIXED_CST_PTR (node
), sizeof (string
));
1766 pp_string (pp
, string
);
1771 pp_string (pp
, "__complex__ (");
1772 dump_generic_node (pp
, TREE_REALPART (node
), spc
, flags
, false);
1773 pp_string (pp
, ", ");
1774 dump_generic_node (pp
, TREE_IMAGPART (node
), spc
, flags
, false);
1775 pp_right_paren (pp
);
1779 pp_string (pp
, "\"");
1780 pretty_print_string (pp
, TREE_STRING_POINTER (node
));
1781 pp_string (pp
, "\"");
1787 pp_string (pp
, "{ ");
1788 for (i
= 0; i
< VECTOR_CST_NELTS (node
); ++i
)
1791 pp_string (pp
, ", ");
1792 dump_generic_node (pp
, VECTOR_CST_ELT (node
, i
),
1795 pp_string (pp
, " }");
1801 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1803 if (TREE_CODE (node
) == METHOD_TYPE
)
1805 if (TYPE_METHOD_BASETYPE (node
))
1806 dump_decl_name (pp
, TYPE_NAME (TYPE_METHOD_BASETYPE (node
)),
1809 pp_string (pp
, "<null method basetype>");
1810 pp_colon_colon (pp
);
1812 if (TYPE_NAME (node
) && DECL_NAME (TYPE_NAME (node
)))
1813 dump_decl_name (pp
, TYPE_NAME (node
), flags
);
1814 else if (flags
& TDF_NOUID
)
1815 pp_printf (pp
, "<Txxxx>");
1817 pp_printf (pp
, "<T%x>", TYPE_UID (node
));
1818 dump_function_declaration (pp
, node
, spc
, flags
);
1823 dump_decl_name (pp
, node
, flags
);
1827 if (DECL_NAME (node
))
1828 dump_decl_name (pp
, node
, flags
);
1829 else if (LABEL_DECL_UID (node
) != -1)
1831 if (flags
& TDF_GIMPLE
)
1832 pp_printf (pp
, "L%d", (int) LABEL_DECL_UID (node
));
1834 pp_printf (pp
, "<L%d>", (int) LABEL_DECL_UID (node
));
1838 if (flags
& TDF_NOUID
)
1839 pp_string (pp
, "<D.xxxx>");
1842 if (flags
& TDF_GIMPLE
)
1843 pp_printf (pp
, "<D%u>", DECL_UID (node
));
1845 pp_printf (pp
, "<D.%u>", DECL_UID (node
));
1851 if (DECL_IS_BUILTIN (node
))
1853 /* Don't print the declaration of built-in types. */
1856 if (DECL_NAME (node
))
1857 dump_decl_name (pp
, node
, flags
);
1858 else if (TYPE_NAME (TREE_TYPE (node
)) != node
)
1860 if ((TREE_CODE (TREE_TYPE (node
)) == RECORD_TYPE
1861 || TREE_CODE (TREE_TYPE (node
)) == UNION_TYPE
)
1862 && TYPE_METHODS (TREE_TYPE (node
)))
1864 /* The type is a c++ class: all structures have at least
1866 pp_string (pp
, "class ");
1867 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1872 (TREE_CODE (TREE_TYPE (node
)) == UNION_TYPE
1873 ? "union" : "struct "));
1874 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
1878 pp_string (pp
, "<anon>");
1884 case DEBUG_EXPR_DECL
:
1885 case NAMESPACE_DECL
:
1887 dump_decl_name (pp
, node
, flags
);
1891 pp_string (pp
, "<retval>");
1895 op0
= TREE_OPERAND (node
, 0);
1898 && (TREE_CODE (op0
) == INDIRECT_REF
1899 || (TREE_CODE (op0
) == MEM_REF
1900 && TREE_CODE (TREE_OPERAND (op0
, 0)) != ADDR_EXPR
1901 && integer_zerop (TREE_OPERAND (op0
, 1))
1902 /* Dump the types of INTEGER_CSTs explicitly, for we
1903 can't infer them and MEM_ATTR caching will share
1904 MEM_REFs with differently-typed op0s. */
1905 && TREE_CODE (TREE_OPERAND (op0
, 0)) != INTEGER_CST
1906 /* Released SSA_NAMES have no TREE_TYPE. */
1907 && TREE_TYPE (TREE_OPERAND (op0
, 0)) != NULL_TREE
1908 /* Same pointer types, but ignoring POINTER_TYPE vs.
1910 && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 0)))
1911 == TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 1))))
1912 && (TYPE_MODE (TREE_TYPE (TREE_OPERAND (op0
, 0)))
1913 == TYPE_MODE (TREE_TYPE (TREE_OPERAND (op0
, 1))))
1914 && (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (op0
, 0)))
1915 == TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (TREE_OPERAND (op0
, 1))))
1916 /* Same value types ignoring qualifiers. */
1917 && (TYPE_MAIN_VARIANT (TREE_TYPE (op0
))
1918 == TYPE_MAIN_VARIANT
1919 (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0
, 1)))))
1920 && MR_DEPENDENCE_CLIQUE (op0
) == 0)))
1922 op0
= TREE_OPERAND (op0
, 0);
1925 if (op_prio (op0
) < op_prio (node
))
1927 dump_generic_node (pp
, op0
, spc
, flags
, false);
1928 if (op_prio (op0
) < op_prio (node
))
1929 pp_right_paren (pp
);
1930 pp_string (pp
, str
);
1931 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1932 op0
= component_ref_field_offset (node
);
1933 if (op0
&& TREE_CODE (op0
) != INTEGER_CST
)
1935 pp_string (pp
, "{off: ");
1936 dump_generic_node (pp
, op0
, spc
, flags
, false);
1937 pp_right_brace (pp
);
1942 pp_string (pp
, "BIT_FIELD_REF <");
1943 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1944 pp_string (pp
, ", ");
1945 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1946 pp_string (pp
, ", ");
1947 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
1951 case BIT_INSERT_EXPR
:
1952 pp_string (pp
, "BIT_INSERT_EXPR <");
1953 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
1954 pp_string (pp
, ", ");
1955 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1956 pp_string (pp
, ", ");
1957 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
1958 pp_string (pp
, " (");
1959 if (INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (node
, 1))))
1961 TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (node
, 1))));
1963 dump_generic_node (pp
, TYPE_SIZE (TREE_TYPE (TREE_OPERAND (node
, 1))),
1965 pp_string (pp
, " bits)>");
1969 case ARRAY_RANGE_REF
:
1970 op0
= TREE_OPERAND (node
, 0);
1971 if (op_prio (op0
) < op_prio (node
))
1973 dump_generic_node (pp
, op0
, spc
, flags
, false);
1974 if (op_prio (op0
) < op_prio (node
))
1975 pp_right_paren (pp
);
1976 pp_left_bracket (pp
);
1977 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
1978 if (TREE_CODE (node
) == ARRAY_RANGE_REF
)
1979 pp_string (pp
, " ...");
1980 pp_right_bracket (pp
);
1982 op0
= array_ref_low_bound (node
);
1983 op1
= array_ref_element_size (node
);
1985 if (!integer_zerop (op0
)
1986 || TREE_OPERAND (node
, 2)
1987 || TREE_OPERAND (node
, 3))
1989 pp_string (pp
, "{lb: ");
1990 dump_generic_node (pp
, op0
, spc
, flags
, false);
1991 pp_string (pp
, " sz: ");
1992 dump_generic_node (pp
, op1
, spc
, flags
, false);
1993 pp_right_brace (pp
);
1999 unsigned HOST_WIDE_INT ix
;
2001 bool is_struct_init
= false;
2002 bool is_array_init
= false;
2005 if (TREE_CLOBBER_P (node
))
2006 pp_string (pp
, "CLOBBER");
2007 else if (TREE_CODE (TREE_TYPE (node
)) == RECORD_TYPE
2008 || TREE_CODE (TREE_TYPE (node
)) == UNION_TYPE
)
2009 is_struct_init
= true;
2010 else if (TREE_CODE (TREE_TYPE (node
)) == ARRAY_TYPE
2011 && TYPE_DOMAIN (TREE_TYPE (node
))
2012 && TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
)))
2013 && TREE_CODE (TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
))))
2016 tree minv
= TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (node
)));
2017 is_array_init
= true;
2018 curidx
= wi::to_widest (minv
);
2020 FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (node
), ix
, field
, val
)
2027 dump_generic_node (pp
, field
, spc
, flags
, false);
2030 else if (is_array_init
2031 && (TREE_CODE (field
) != INTEGER_CST
2032 || curidx
!= wi::to_widest (field
)))
2034 pp_left_bracket (pp
);
2035 if (TREE_CODE (field
) == RANGE_EXPR
)
2037 dump_generic_node (pp
, TREE_OPERAND (field
, 0), spc
,
2039 pp_string (pp
, " ... ");
2040 dump_generic_node (pp
, TREE_OPERAND (field
, 1), spc
,
2042 if (TREE_CODE (TREE_OPERAND (field
, 1)) == INTEGER_CST
)
2043 curidx
= wi::to_widest (TREE_OPERAND (field
, 1));
2046 dump_generic_node (pp
, field
, spc
, flags
, false);
2047 if (TREE_CODE (field
) == INTEGER_CST
)
2048 curidx
= wi::to_widest (field
);
2049 pp_string (pp
, "]=");
2054 if (val
&& TREE_CODE (val
) == ADDR_EXPR
)
2055 if (TREE_CODE (TREE_OPERAND (val
, 0)) == FUNCTION_DECL
)
2056 val
= TREE_OPERAND (val
, 0);
2057 if (val
&& TREE_CODE (val
) == FUNCTION_DECL
)
2058 dump_decl_name (pp
, val
, flags
);
2060 dump_generic_node (pp
, val
, spc
, flags
, false);
2061 if (ix
!= CONSTRUCTOR_NELTS (node
) - 1)
2067 pp_right_brace (pp
);
2074 if (flags
& TDF_SLIM
)
2076 pp_string (pp
, "<COMPOUND_EXPR>");
2080 dump_generic_node (pp
, TREE_OPERAND (node
, 0),
2081 spc
, flags
, !(flags
& TDF_SLIM
));
2082 if (flags
& TDF_SLIM
)
2083 newline_and_indent (pp
, spc
);
2090 for (tp
= &TREE_OPERAND (node
, 1);
2091 TREE_CODE (*tp
) == COMPOUND_EXPR
;
2092 tp
= &TREE_OPERAND (*tp
, 1))
2094 dump_generic_node (pp
, TREE_OPERAND (*tp
, 0),
2095 spc
, flags
, !(flags
& TDF_SLIM
));
2096 if (flags
& TDF_SLIM
)
2097 newline_and_indent (pp
, spc
);
2105 dump_generic_node (pp
, *tp
, spc
, flags
, !(flags
& TDF_SLIM
));
2109 case STATEMENT_LIST
:
2111 tree_stmt_iterator si
;
2114 if (flags
& TDF_SLIM
)
2116 pp_string (pp
, "<STATEMENT_LIST>");
2120 for (si
= tsi_start (node
); !tsi_end_p (si
); tsi_next (&si
))
2123 newline_and_indent (pp
, spc
);
2126 dump_generic_node (pp
, tsi_stmt (si
), spc
, flags
, true);
2133 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
,
2138 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
,
2143 pp_string (pp
, "TARGET_EXPR <");
2144 dump_generic_node (pp
, TARGET_EXPR_SLOT (node
), spc
, flags
, false);
2147 dump_generic_node (pp
, TARGET_EXPR_INITIAL (node
), spc
, flags
, false);
2152 print_declaration (pp
, DECL_EXPR_DECL (node
), spc
, flags
);
2157 if (TREE_TYPE (node
) == NULL
|| TREE_TYPE (node
) == void_type_node
)
2159 pp_string (pp
, "if (");
2160 dump_generic_node (pp
, COND_EXPR_COND (node
), spc
, flags
, false);
2161 pp_right_paren (pp
);
2162 /* The lowered cond_exprs should always be printed in full. */
2163 if (COND_EXPR_THEN (node
)
2164 && (IS_EMPTY_STMT (COND_EXPR_THEN (node
))
2165 || TREE_CODE (COND_EXPR_THEN (node
)) == GOTO_EXPR
)
2166 && COND_EXPR_ELSE (node
)
2167 && (IS_EMPTY_STMT (COND_EXPR_ELSE (node
))
2168 || TREE_CODE (COND_EXPR_ELSE (node
)) == GOTO_EXPR
))
2171 dump_generic_node (pp
, COND_EXPR_THEN (node
),
2173 if (!IS_EMPTY_STMT (COND_EXPR_ELSE (node
)))
2175 pp_string (pp
, " else ");
2176 dump_generic_node (pp
, COND_EXPR_ELSE (node
),
2180 else if (!(flags
& TDF_SLIM
))
2182 /* Output COND_EXPR_THEN. */
2183 if (COND_EXPR_THEN (node
))
2185 newline_and_indent (pp
, spc
+2);
2187 newline_and_indent (pp
, spc
+4);
2188 dump_generic_node (pp
, COND_EXPR_THEN (node
), spc
+4,
2190 newline_and_indent (pp
, spc
+2);
2191 pp_right_brace (pp
);
2194 /* Output COND_EXPR_ELSE. */
2195 if (COND_EXPR_ELSE (node
)
2196 && !IS_EMPTY_STMT (COND_EXPR_ELSE (node
)))
2198 newline_and_indent (pp
, spc
);
2199 pp_string (pp
, "else");
2200 newline_and_indent (pp
, spc
+2);
2202 newline_and_indent (pp
, spc
+4);
2203 dump_generic_node (pp
, COND_EXPR_ELSE (node
), spc
+4,
2205 newline_and_indent (pp
, spc
+2);
2206 pp_right_brace (pp
);
2213 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2217 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2221 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2227 if (!(flags
& TDF_SLIM
))
2229 if (BIND_EXPR_VARS (node
))
2233 for (op0
= BIND_EXPR_VARS (node
); op0
; op0
= DECL_CHAIN (op0
))
2235 print_declaration (pp
, op0
, spc
+2, flags
);
2240 newline_and_indent (pp
, spc
+2);
2241 dump_generic_node (pp
, BIND_EXPR_BODY (node
), spc
+2, flags
, true);
2242 newline_and_indent (pp
, spc
);
2243 pp_right_brace (pp
);
2249 if (CALL_EXPR_FN (node
) != NULL_TREE
)
2250 print_call_name (pp
, CALL_EXPR_FN (node
), flags
);
2252 pp_string (pp
, internal_fn_name (CALL_EXPR_IFN (node
)));
2254 /* Print parameters. */
2259 call_expr_arg_iterator iter
;
2260 FOR_EACH_CALL_EXPR_ARG (arg
, iter
, node
)
2262 dump_generic_node (pp
, arg
, spc
, flags
, false);
2263 if (more_call_expr_args_p (&iter
))
2270 if (CALL_EXPR_VA_ARG_PACK (node
))
2272 if (call_expr_nargs (node
) > 0)
2277 pp_string (pp
, "__builtin_va_arg_pack ()");
2279 pp_right_paren (pp
);
2281 op1
= CALL_EXPR_STATIC_CHAIN (node
);
2284 pp_string (pp
, " [static-chain: ");
2285 dump_generic_node (pp
, op1
, spc
, flags
, false);
2286 pp_right_bracket (pp
);
2289 if (CALL_EXPR_RETURN_SLOT_OPT (node
))
2290 pp_string (pp
, " [return slot optimization]");
2291 if (CALL_EXPR_TAILCALL (node
))
2292 pp_string (pp
, " [tail call]");
2295 case WITH_CLEANUP_EXPR
:
2299 case CLEANUP_POINT_EXPR
:
2300 pp_string (pp
, "<<cleanup_point ");
2301 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2302 pp_string (pp
, ">>");
2305 case PLACEHOLDER_EXPR
:
2306 pp_string (pp
, "<PLACEHOLDER_EXPR ");
2307 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
2311 /* Binary arithmetic and logic expressions. */
2312 case WIDEN_SUM_EXPR
:
2313 case WIDEN_MULT_EXPR
:
2315 case MULT_HIGHPART_EXPR
:
2317 case POINTER_PLUS_EXPR
:
2319 case TRUNC_DIV_EXPR
:
2321 case FLOOR_DIV_EXPR
:
2322 case ROUND_DIV_EXPR
:
2323 case TRUNC_MOD_EXPR
:
2325 case FLOOR_MOD_EXPR
:
2326 case ROUND_MOD_EXPR
:
2328 case EXACT_DIV_EXPR
:
2333 case WIDEN_LSHIFT_EXPR
:
2337 case TRUTH_ANDIF_EXPR
:
2338 case TRUTH_ORIF_EXPR
:
2339 case TRUTH_AND_EXPR
:
2341 case TRUTH_XOR_EXPR
:
2355 case UNORDERED_EXPR
:
2357 const char *op
= op_symbol (node
);
2358 op0
= TREE_OPERAND (node
, 0);
2359 op1
= TREE_OPERAND (node
, 1);
2361 /* When the operands are expressions with less priority,
2362 keep semantics of the tree representation. */
2363 if (op_prio (op0
) <= op_prio (node
))
2366 dump_generic_node (pp
, op0
, spc
, flags
, false);
2367 pp_right_paren (pp
);
2370 dump_generic_node (pp
, op0
, spc
, flags
, false);
2376 /* When the operands are expressions with less priority,
2377 keep semantics of the tree representation. */
2378 if (op_prio (op1
) <= op_prio (node
))
2381 dump_generic_node (pp
, op1
, spc
, flags
, false);
2382 pp_right_paren (pp
);
2385 dump_generic_node (pp
, op1
, spc
, flags
, false);
2389 /* Unary arithmetic and logic expressions. */
2392 case TRUTH_NOT_EXPR
:
2394 case PREDECREMENT_EXPR
:
2395 case PREINCREMENT_EXPR
:
2397 if (TREE_CODE (node
) == ADDR_EXPR
2398 && (TREE_CODE (TREE_OPERAND (node
, 0)) == STRING_CST
2399 || TREE_CODE (TREE_OPERAND (node
, 0)) == FUNCTION_DECL
))
2400 ; /* Do not output '&' for strings and function pointers. */
2402 pp_string (pp
, op_symbol (node
));
2404 if (op_prio (TREE_OPERAND (node
, 0)) < op_prio (node
))
2407 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2408 pp_right_paren (pp
);
2411 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2414 case POSTDECREMENT_EXPR
:
2415 case POSTINCREMENT_EXPR
:
2416 if (op_prio (TREE_OPERAND (node
, 0)) < op_prio (node
))
2419 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2420 pp_right_paren (pp
);
2423 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2424 pp_string (pp
, op_symbol (node
));
2428 pp_string (pp
, "MIN_EXPR <");
2429 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2430 pp_string (pp
, ", ");
2431 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2436 pp_string (pp
, "MAX_EXPR <");
2437 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2438 pp_string (pp
, ", ");
2439 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2444 pp_string (pp
, "ABS_EXPR <");
2445 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2453 case ADDR_SPACE_CONVERT_EXPR
:
2454 case FIXED_CONVERT_EXPR
:
2455 case FIX_TRUNC_EXPR
:
2458 type
= TREE_TYPE (node
);
2459 op0
= TREE_OPERAND (node
, 0);
2460 if (type
!= TREE_TYPE (op0
))
2463 dump_generic_node (pp
, type
, spc
, flags
, false);
2464 pp_string (pp
, ") ");
2466 if (op_prio (op0
) < op_prio (node
))
2468 dump_generic_node (pp
, op0
, spc
, flags
, false);
2469 if (op_prio (op0
) < op_prio (node
))
2470 pp_right_paren (pp
);
2473 case VIEW_CONVERT_EXPR
:
2474 pp_string (pp
, "VIEW_CONVERT_EXPR<");
2475 dump_generic_node (pp
, TREE_TYPE (node
), spc
, flags
, false);
2476 pp_string (pp
, ">(");
2477 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2478 pp_right_paren (pp
);
2482 pp_string (pp
, "((");
2483 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2484 pp_string (pp
, "))");
2487 case NON_LVALUE_EXPR
:
2488 pp_string (pp
, "NON_LVALUE_EXPR <");
2489 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2494 pp_string (pp
, "SAVE_EXPR <");
2495 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2500 pp_string (pp
, "COMPLEX_EXPR <");
2501 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2502 pp_string (pp
, ", ");
2503 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2508 pp_string (pp
, "CONJ_EXPR <");
2509 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2514 if (flags
& TDF_GIMPLE
)
2516 pp_string (pp
, "__real ");
2517 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2521 pp_string (pp
, "REALPART_EXPR <");
2522 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2528 if (flags
& TDF_GIMPLE
)
2530 pp_string (pp
, "__imag ");
2531 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2535 pp_string (pp
, "IMAGPART_EXPR <");
2536 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2542 pp_string (pp
, "VA_ARG_EXPR <");
2543 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2547 case TRY_FINALLY_EXPR
:
2548 case TRY_CATCH_EXPR
:
2549 pp_string (pp
, "try");
2550 newline_and_indent (pp
, spc
+2);
2552 newline_and_indent (pp
, spc
+4);
2553 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
+4, flags
, true);
2554 newline_and_indent (pp
, spc
+2);
2555 pp_right_brace (pp
);
2556 newline_and_indent (pp
, spc
);
2558 (TREE_CODE (node
) == TRY_CATCH_EXPR
) ? "catch" : "finally");
2559 newline_and_indent (pp
, spc
+2);
2561 newline_and_indent (pp
, spc
+4);
2562 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
+4, flags
, true);
2563 newline_and_indent (pp
, spc
+2);
2564 pp_right_brace (pp
);
2569 pp_string (pp
, "catch (");
2570 dump_generic_node (pp
, CATCH_TYPES (node
), spc
+2, flags
, false);
2571 pp_right_paren (pp
);
2572 newline_and_indent (pp
, spc
+2);
2574 newline_and_indent (pp
, spc
+4);
2575 dump_generic_node (pp
, CATCH_BODY (node
), spc
+4, flags
, true);
2576 newline_and_indent (pp
, spc
+2);
2577 pp_right_brace (pp
);
2581 case EH_FILTER_EXPR
:
2582 pp_string (pp
, "<<<eh_filter (");
2583 dump_generic_node (pp
, EH_FILTER_TYPES (node
), spc
+2, flags
, false);
2584 pp_string (pp
, ")>>>");
2585 newline_and_indent (pp
, spc
+2);
2587 newline_and_indent (pp
, spc
+4);
2588 dump_generic_node (pp
, EH_FILTER_FAILURE (node
), spc
+4, flags
, true);
2589 newline_and_indent (pp
, spc
+2);
2590 pp_right_brace (pp
);
2595 op0
= TREE_OPERAND (node
, 0);
2596 /* If this is for break or continue, don't bother printing it. */
2597 if (DECL_NAME (op0
))
2599 const char *name
= IDENTIFIER_POINTER (DECL_NAME (op0
));
2600 if (strcmp (name
, "break") == 0
2601 || strcmp (name
, "continue") == 0)
2604 dump_generic_node (pp
, op0
, spc
, flags
, false);
2606 if (DECL_NONLOCAL (op0
))
2607 pp_string (pp
, " [non-local]");
2611 pp_string (pp
, "while (1)");
2612 if (!(flags
& TDF_SLIM
))
2614 newline_and_indent (pp
, spc
+2);
2616 newline_and_indent (pp
, spc
+4);
2617 dump_generic_node (pp
, LOOP_EXPR_BODY (node
), spc
+4, flags
, true);
2618 newline_and_indent (pp
, spc
+2);
2619 pp_right_brace (pp
);
2625 pp_string (pp
, "// predicted ");
2626 if (PREDICT_EXPR_OUTCOME (node
))
2627 pp_string (pp
, "likely by ");
2629 pp_string (pp
, "unlikely by ");
2630 pp_string (pp
, predictor_name (PREDICT_EXPR_PREDICTOR (node
)));
2631 pp_string (pp
, " predictor.");
2635 pp_string (pp
, "ANNOTATE_EXPR <");
2636 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2637 switch ((enum annot_expr_kind
) TREE_INT_CST_LOW (TREE_OPERAND (node
, 1)))
2639 case annot_expr_ivdep_kind
:
2640 pp_string (pp
, ", ivdep");
2642 case annot_expr_no_vector_kind
:
2643 pp_string (pp
, ", no-vector");
2645 case annot_expr_vector_kind
:
2646 pp_string (pp
, ", vector");
2655 pp_string (pp
, "return");
2656 op0
= TREE_OPERAND (node
, 0);
2660 if (TREE_CODE (op0
) == MODIFY_EXPR
)
2661 dump_generic_node (pp
, TREE_OPERAND (op0
, 1),
2664 dump_generic_node (pp
, op0
, spc
, flags
, false);
2669 pp_string (pp
, "if (");
2670 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2671 pp_string (pp
, ") break");
2675 pp_string (pp
, "switch (");
2676 dump_generic_node (pp
, SWITCH_COND (node
), spc
, flags
, false);
2677 pp_right_paren (pp
);
2678 if (!(flags
& TDF_SLIM
))
2680 newline_and_indent (pp
, spc
+2);
2682 if (SWITCH_BODY (node
))
2684 newline_and_indent (pp
, spc
+4);
2685 dump_generic_node (pp
, SWITCH_BODY (node
), spc
+4, flags
,
2690 tree vec
= SWITCH_LABELS (node
);
2691 size_t i
, n
= TREE_VEC_LENGTH (vec
);
2692 for (i
= 0; i
< n
; ++i
)
2694 tree elt
= TREE_VEC_ELT (vec
, i
);
2695 newline_and_indent (pp
, spc
+4);
2698 dump_generic_node (pp
, elt
, spc
+4, flags
, false);
2699 pp_string (pp
, " goto ");
2700 dump_generic_node (pp
, CASE_LABEL (elt
), spc
+4,
2705 pp_string (pp
, "case ???: goto ???;");
2708 newline_and_indent (pp
, spc
+2);
2709 pp_right_brace (pp
);
2715 op0
= GOTO_DESTINATION (node
);
2716 if (TREE_CODE (op0
) != SSA_NAME
&& DECL_P (op0
) && DECL_NAME (op0
))
2718 const char *name
= IDENTIFIER_POINTER (DECL_NAME (op0
));
2719 if (strcmp (name
, "break") == 0
2720 || strcmp (name
, "continue") == 0)
2722 pp_string (pp
, name
);
2726 pp_string (pp
, "goto ");
2727 dump_generic_node (pp
, op0
, spc
, flags
, false);
2731 pp_string (pp
, "__asm__");
2732 if (ASM_VOLATILE_P (node
))
2733 pp_string (pp
, " __volatile__");
2735 dump_generic_node (pp
, ASM_STRING (node
), spc
, flags
, false);
2737 dump_generic_node (pp
, ASM_OUTPUTS (node
), spc
, flags
, false);
2739 dump_generic_node (pp
, ASM_INPUTS (node
), spc
, flags
, false);
2740 if (ASM_CLOBBERS (node
))
2743 dump_generic_node (pp
, ASM_CLOBBERS (node
), spc
, flags
, false);
2745 pp_right_paren (pp
);
2748 case CASE_LABEL_EXPR
:
2749 if (CASE_LOW (node
) && CASE_HIGH (node
))
2751 pp_string (pp
, "case ");
2752 dump_generic_node (pp
, CASE_LOW (node
), spc
, flags
, false);
2753 pp_string (pp
, " ... ");
2754 dump_generic_node (pp
, CASE_HIGH (node
), spc
, flags
, false);
2756 else if (CASE_LOW (node
))
2758 pp_string (pp
, "case ");
2759 dump_generic_node (pp
, CASE_LOW (node
), spc
, flags
, false);
2762 pp_string (pp
, "default");
2767 pp_string (pp
, "OBJ_TYPE_REF(");
2768 dump_generic_node (pp
, OBJ_TYPE_REF_EXPR (node
), spc
, flags
, false);
2770 if (!(flags
& TDF_SLIM
) && virtual_method_call_p (node
))
2772 pp_string (pp
, "(");
2773 dump_generic_node (pp
, obj_type_ref_class (node
), spc
, flags
, false);
2774 pp_string (pp
, ")");
2776 dump_generic_node (pp
, OBJ_TYPE_REF_OBJECT (node
), spc
, flags
, false);
2778 dump_generic_node (pp
, OBJ_TYPE_REF_TOKEN (node
), spc
, flags
, false);
2779 pp_right_paren (pp
);
2783 if (SSA_NAME_IDENTIFIER (node
))
2785 if ((flags
& TDF_NOUID
)
2786 && SSA_NAME_VAR (node
)
2787 && DECL_NAMELESS (SSA_NAME_VAR (node
)))
2788 dump_fancy_name (pp
, SSA_NAME_IDENTIFIER (node
));
2789 else if (! (flags
& TDF_GIMPLE
)
2790 || SSA_NAME_VAR (node
))
2791 dump_generic_node (pp
, SSA_NAME_IDENTIFIER (node
),
2795 pp_decimal_int (pp
, SSA_NAME_VERSION (node
));
2796 if (SSA_NAME_IS_DEFAULT_DEF (node
))
2797 pp_string (pp
, "(D)");
2798 if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (node
))
2799 pp_string (pp
, "(ab)");
2802 case WITH_SIZE_EXPR
:
2803 pp_string (pp
, "WITH_SIZE_EXPR <");
2804 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2805 pp_string (pp
, ", ");
2806 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2811 pp_string (pp
, "ASSERT_EXPR <");
2812 dump_generic_node (pp
, ASSERT_EXPR_VAR (node
), spc
, flags
, false);
2813 pp_string (pp
, ", ");
2814 dump_generic_node (pp
, ASSERT_EXPR_COND (node
), spc
, flags
, false);
2819 pp_string (pp
, "scev_known");
2822 case SCEV_NOT_KNOWN
:
2823 pp_string (pp
, "scev_not_known");
2826 case POLYNOMIAL_CHREC
:
2828 dump_generic_node (pp
, CHREC_LEFT (node
), spc
, flags
, false);
2829 pp_string (pp
, ", +, ");
2830 dump_generic_node (pp
, CHREC_RIGHT (node
), spc
, flags
, false);
2831 pp_string (pp
, "}_");
2832 dump_generic_node (pp
, CHREC_VAR (node
), spc
, flags
, false);
2836 case REALIGN_LOAD_EXPR
:
2837 pp_string (pp
, "REALIGN_LOAD <");
2838 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2839 pp_string (pp
, ", ");
2840 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2841 pp_string (pp
, ", ");
2842 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2847 pp_string (pp
, " VEC_COND_EXPR < ");
2848 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2849 pp_string (pp
, " , ");
2850 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2851 pp_string (pp
, " , ");
2852 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2853 pp_string (pp
, " > ");
2857 pp_string (pp
, " VEC_PERM_EXPR < ");
2858 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2859 pp_string (pp
, " , ");
2860 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2861 pp_string (pp
, " , ");
2862 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2863 pp_string (pp
, " > ");
2867 pp_string (pp
, " DOT_PROD_EXPR < ");
2868 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2869 pp_string (pp
, ", ");
2870 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2871 pp_string (pp
, ", ");
2872 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2873 pp_string (pp
, " > ");
2876 case WIDEN_MULT_PLUS_EXPR
:
2877 pp_string (pp
, " WIDEN_MULT_PLUS_EXPR < ");
2878 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2879 pp_string (pp
, ", ");
2880 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2881 pp_string (pp
, ", ");
2882 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2883 pp_string (pp
, " > ");
2886 case WIDEN_MULT_MINUS_EXPR
:
2887 pp_string (pp
, " WIDEN_MULT_MINUS_EXPR < ");
2888 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2889 pp_string (pp
, ", ");
2890 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2891 pp_string (pp
, ", ");
2892 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2893 pp_string (pp
, " > ");
2897 pp_string (pp
, " FMA_EXPR < ");
2898 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
2899 pp_string (pp
, ", ");
2900 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
2901 pp_string (pp
, ", ");
2902 dump_generic_node (pp
, TREE_OPERAND (node
, 2), spc
, flags
, false);
2903 pp_string (pp
, " > ");
2907 pp_string (pp
, "#pragma acc parallel");
2908 goto dump_omp_clauses_body
;
2911 pp_string (pp
, "#pragma acc kernels");
2912 goto dump_omp_clauses_body
;
2915 pp_string (pp
, "#pragma acc data");
2916 dump_omp_clauses (pp
, OACC_DATA_CLAUSES (node
), spc
, flags
);
2919 case OACC_HOST_DATA
:
2920 pp_string (pp
, "#pragma acc host_data");
2921 dump_omp_clauses (pp
, OACC_HOST_DATA_CLAUSES (node
), spc
, flags
);
2925 pp_string (pp
, "#pragma acc declare");
2926 dump_omp_clauses (pp
, OACC_DECLARE_CLAUSES (node
), spc
, flags
);
2930 pp_string (pp
, "#pragma acc update");
2931 dump_omp_clauses (pp
, OACC_UPDATE_CLAUSES (node
), spc
, flags
);
2934 case OACC_ENTER_DATA
:
2935 pp_string (pp
, "#pragma acc enter data");
2936 dump_omp_clauses (pp
, OACC_ENTER_DATA_CLAUSES (node
), spc
, flags
);
2939 case OACC_EXIT_DATA
:
2940 pp_string (pp
, "#pragma acc exit data");
2941 dump_omp_clauses (pp
, OACC_EXIT_DATA_CLAUSES (node
), spc
, flags
);
2945 pp_string (pp
, "#pragma acc cache");
2946 dump_omp_clauses (pp
, OACC_CACHE_CLAUSES (node
), spc
, flags
);
2950 pp_string (pp
, "#pragma omp parallel");
2951 dump_omp_clauses (pp
, OMP_PARALLEL_CLAUSES (node
), spc
, flags
);
2954 dump_omp_clauses_body
:
2955 dump_omp_clauses (pp
, OMP_CLAUSES (node
), spc
, flags
);
2959 if (!(flags
& TDF_SLIM
) && OMP_BODY (node
))
2961 newline_and_indent (pp
, spc
+ 2);
2963 newline_and_indent (pp
, spc
+ 4);
2964 dump_generic_node (pp
, OMP_BODY (node
), spc
+ 4, flags
, false);
2965 newline_and_indent (pp
, spc
+ 2);
2966 pp_right_brace (pp
);
2972 pp_string (pp
, "#pragma omp task");
2973 dump_omp_clauses (pp
, OMP_TASK_CLAUSES (node
), spc
, flags
);
2977 pp_string (pp
, "#pragma omp for");
2981 pp_string (pp
, "#pragma omp simd");
2985 pp_string (pp
, "#pragma simd");
2989 /* This label points one line after dumping the clauses.
2990 For _Cilk_for the clauses are dumped after the _Cilk_for (...)
2991 parameters are printed out. */
2992 goto dump_omp_loop_cilk_for
;
2994 case OMP_DISTRIBUTE
:
2995 pp_string (pp
, "#pragma omp distribute");
2999 pp_string (pp
, "#pragma omp taskloop");
3003 pp_string (pp
, "#pragma acc loop");
3007 pp_string (pp
, "#pragma omp teams");
3008 dump_omp_clauses (pp
, OMP_TEAMS_CLAUSES (node
), spc
, flags
);
3011 case OMP_TARGET_DATA
:
3012 pp_string (pp
, "#pragma omp target data");
3013 dump_omp_clauses (pp
, OMP_TARGET_DATA_CLAUSES (node
), spc
, flags
);
3016 case OMP_TARGET_ENTER_DATA
:
3017 pp_string (pp
, "#pragma omp target enter data");
3018 dump_omp_clauses (pp
, OMP_TARGET_ENTER_DATA_CLAUSES (node
), spc
, flags
);
3022 case OMP_TARGET_EXIT_DATA
:
3023 pp_string (pp
, "#pragma omp target exit data");
3024 dump_omp_clauses (pp
, OMP_TARGET_EXIT_DATA_CLAUSES (node
), spc
, flags
);
3029 pp_string (pp
, "#pragma omp target");
3030 dump_omp_clauses (pp
, OMP_TARGET_CLAUSES (node
), spc
, flags
);
3033 case OMP_TARGET_UPDATE
:
3034 pp_string (pp
, "#pragma omp target update");
3035 dump_omp_clauses (pp
, OMP_TARGET_UPDATE_CLAUSES (node
), spc
, flags
);
3040 dump_omp_clauses (pp
, OMP_FOR_CLAUSES (node
), spc
, flags
);
3042 dump_omp_loop_cilk_for
:
3043 if (!(flags
& TDF_SLIM
))
3047 if (OMP_FOR_PRE_BODY (node
))
3049 if (TREE_CODE (node
) == CILK_FOR
)
3050 pp_string (pp
, " ");
3052 newline_and_indent (pp
, spc
+ 2);
3055 newline_and_indent (pp
, spc
);
3056 dump_generic_node (pp
, OMP_FOR_PRE_BODY (node
),
3059 if (OMP_FOR_INIT (node
))
3062 for (i
= 0; i
< TREE_VEC_LENGTH (OMP_FOR_INIT (node
)); i
++)
3065 if (TREE_CODE (node
) != CILK_FOR
|| OMP_FOR_PRE_BODY (node
))
3066 newline_and_indent (pp
, spc
);
3067 if (TREE_CODE (node
) == CILK_FOR
)
3068 pp_string (pp
, "_Cilk_for (");
3070 pp_string (pp
, "for (");
3071 dump_generic_node (pp
,
3072 TREE_VEC_ELT (OMP_FOR_INIT (node
), i
),
3074 pp_string (pp
, "; ");
3075 dump_generic_node (pp
,
3076 TREE_VEC_ELT (OMP_FOR_COND (node
), i
),
3078 pp_string (pp
, "; ");
3079 dump_generic_node (pp
,
3080 TREE_VEC_ELT (OMP_FOR_INCR (node
), i
),
3082 pp_right_paren (pp
);
3084 if (TREE_CODE (node
) == CILK_FOR
)
3085 dump_omp_clauses (pp
, OMP_FOR_CLAUSES (node
), spc
, flags
);
3087 if (OMP_FOR_BODY (node
))
3089 newline_and_indent (pp
, spc
+ 2);
3091 newline_and_indent (pp
, spc
+ 4);
3092 dump_generic_node (pp
, OMP_FOR_BODY (node
), spc
+ 4, flags
,
3094 newline_and_indent (pp
, spc
+ 2);
3095 pp_right_brace (pp
);
3097 if (OMP_FOR_INIT (node
))
3098 spc
-= 2 * TREE_VEC_LENGTH (OMP_FOR_INIT (node
)) - 2;
3099 if (OMP_FOR_PRE_BODY (node
))
3102 newline_and_indent (pp
, spc
+ 2);
3103 pp_right_brace (pp
);
3110 pp_string (pp
, "#pragma omp sections");
3111 dump_omp_clauses (pp
, OMP_SECTIONS_CLAUSES (node
), spc
, flags
);
3115 pp_string (pp
, "#pragma omp section");
3119 pp_string (pp
, "#pragma omp master");
3123 pp_string (pp
, "#pragma omp taskgroup");
3127 pp_string (pp
, "#pragma omp ordered");
3128 dump_omp_clauses (pp
, OMP_ORDERED_CLAUSES (node
), spc
, flags
);
3132 pp_string (pp
, "#pragma omp critical");
3133 if (OMP_CRITICAL_NAME (node
))
3137 dump_generic_node (pp
, OMP_CRITICAL_NAME (node
), spc
,
3139 pp_right_paren (pp
);
3141 dump_omp_clauses (pp
, OMP_CRITICAL_CLAUSES (node
), spc
, flags
);
3145 pp_string (pp
, "#pragma omp atomic");
3146 if (OMP_ATOMIC_SEQ_CST (node
))
3147 pp_string (pp
, " seq_cst");
3148 newline_and_indent (pp
, spc
+ 2);
3149 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3153 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3156 case OMP_ATOMIC_READ
:
3157 pp_string (pp
, "#pragma omp atomic read");
3158 if (OMP_ATOMIC_SEQ_CST (node
))
3159 pp_string (pp
, " seq_cst");
3160 newline_and_indent (pp
, spc
+ 2);
3161 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3165 case OMP_ATOMIC_CAPTURE_OLD
:
3166 case OMP_ATOMIC_CAPTURE_NEW
:
3167 pp_string (pp
, "#pragma omp atomic capture");
3168 if (OMP_ATOMIC_SEQ_CST (node
))
3169 pp_string (pp
, " seq_cst");
3170 newline_and_indent (pp
, spc
+ 2);
3171 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3175 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3179 pp_string (pp
, "#pragma omp single");
3180 dump_omp_clauses (pp
, OMP_SINGLE_CLAUSES (node
), spc
, flags
);
3184 dump_omp_clause (pp
, node
, spc
, flags
);
3188 case TRANSACTION_EXPR
:
3189 if (TRANSACTION_EXPR_OUTER (node
))
3190 pp_string (pp
, "__transaction_atomic [[outer]]");
3191 else if (TRANSACTION_EXPR_RELAXED (node
))
3192 pp_string (pp
, "__transaction_relaxed");
3194 pp_string (pp
, "__transaction_atomic");
3195 if (!(flags
& TDF_SLIM
) && TRANSACTION_EXPR_BODY (node
))
3197 newline_and_indent (pp
, spc
);
3199 newline_and_indent (pp
, spc
+ 2);
3200 dump_generic_node (pp
, TRANSACTION_EXPR_BODY (node
),
3201 spc
+ 2, flags
, false);
3202 newline_and_indent (pp
, spc
);
3203 pp_right_brace (pp
);
3208 case REDUC_MAX_EXPR
:
3209 pp_string (pp
, " REDUC_MAX_EXPR < ");
3210 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3211 pp_string (pp
, " > ");
3214 case REDUC_MIN_EXPR
:
3215 pp_string (pp
, " REDUC_MIN_EXPR < ");
3216 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3217 pp_string (pp
, " > ");
3220 case REDUC_PLUS_EXPR
:
3221 pp_string (pp
, " REDUC_PLUS_EXPR < ");
3222 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3223 pp_string (pp
, " > ");
3226 case VEC_WIDEN_MULT_HI_EXPR
:
3227 case VEC_WIDEN_MULT_LO_EXPR
:
3228 case VEC_WIDEN_MULT_EVEN_EXPR
:
3229 case VEC_WIDEN_MULT_ODD_EXPR
:
3230 case VEC_WIDEN_LSHIFT_HI_EXPR
:
3231 case VEC_WIDEN_LSHIFT_LO_EXPR
:
3233 for (str
= get_tree_code_name (code
); *str
; str
++)
3234 pp_character (pp
, TOUPPER (*str
));
3235 pp_string (pp
, " < ");
3236 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3237 pp_string (pp
, ", ");
3238 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3239 pp_string (pp
, " > ");
3242 case VEC_UNPACK_HI_EXPR
:
3243 pp_string (pp
, " VEC_UNPACK_HI_EXPR < ");
3244 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3245 pp_string (pp
, " > ");
3248 case VEC_UNPACK_LO_EXPR
:
3249 pp_string (pp
, " VEC_UNPACK_LO_EXPR < ");
3250 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3251 pp_string (pp
, " > ");
3254 case VEC_UNPACK_FLOAT_HI_EXPR
:
3255 pp_string (pp
, " VEC_UNPACK_FLOAT_HI_EXPR < ");
3256 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3257 pp_string (pp
, " > ");
3260 case VEC_UNPACK_FLOAT_LO_EXPR
:
3261 pp_string (pp
, " VEC_UNPACK_FLOAT_LO_EXPR < ");
3262 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3263 pp_string (pp
, " > ");
3266 case VEC_PACK_TRUNC_EXPR
:
3267 pp_string (pp
, " VEC_PACK_TRUNC_EXPR < ");
3268 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3269 pp_string (pp
, ", ");
3270 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3271 pp_string (pp
, " > ");
3274 case VEC_PACK_SAT_EXPR
:
3275 pp_string (pp
, " VEC_PACK_SAT_EXPR < ");
3276 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3277 pp_string (pp
, ", ");
3278 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3279 pp_string (pp
, " > ");
3282 case VEC_PACK_FIX_TRUNC_EXPR
:
3283 pp_string (pp
, " VEC_PACK_FIX_TRUNC_EXPR < ");
3284 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3285 pp_string (pp
, ", ");
3286 dump_generic_node (pp
, TREE_OPERAND (node
, 1), spc
, flags
, false);
3287 pp_string (pp
, " > ");
3291 dump_block_node (pp
, node
, spc
, flags
);
3294 case CILK_SPAWN_STMT
:
3295 pp_string (pp
, "_Cilk_spawn ");
3296 dump_generic_node (pp
, TREE_OPERAND (node
, 0), spc
, flags
, false);
3299 case CILK_SYNC_STMT
:
3300 pp_string (pp
, "_Cilk_sync");
3307 if (is_stmt
&& is_expr
)
3313 /* Print the declaration of a variable. */
3316 print_declaration (pretty_printer
*pp
, tree t
, int spc
, int flags
)
3320 if (TREE_CODE(t
) == NAMELIST_DECL
)
3322 pp_string(pp
, "namelist ");
3323 dump_decl_name (pp
, t
, flags
);
3328 if (TREE_CODE (t
) == TYPE_DECL
)
3329 pp_string (pp
, "typedef ");
3331 if (CODE_CONTAINS_STRUCT (TREE_CODE (t
), TS_DECL_WRTL
) && DECL_REGISTER (t
))
3332 pp_string (pp
, "register ");
3334 if (TREE_PUBLIC (t
) && DECL_EXTERNAL (t
))
3335 pp_string (pp
, "extern ");
3336 else if (TREE_STATIC (t
))
3337 pp_string (pp
, "static ");
3339 /* Print the type and name. */
3340 if (TREE_TYPE (t
) && TREE_CODE (TREE_TYPE (t
)) == ARRAY_TYPE
)
3344 /* Print array's type. */
3345 tmp
= TREE_TYPE (t
);
3346 while (TREE_CODE (TREE_TYPE (tmp
)) == ARRAY_TYPE
)
3347 tmp
= TREE_TYPE (tmp
);
3348 dump_generic_node (pp
, TREE_TYPE (tmp
), spc
, flags
, false);
3350 /* Print variable's name. */
3352 dump_generic_node (pp
, t
, spc
, flags
, false);
3354 /* Print the dimensions. */
3355 tmp
= TREE_TYPE (t
);
3356 while (TREE_CODE (tmp
) == ARRAY_TYPE
)
3358 dump_array_domain (pp
, TYPE_DOMAIN (tmp
), spc
, flags
);
3359 tmp
= TREE_TYPE (tmp
);
3362 else if (TREE_CODE (t
) == FUNCTION_DECL
)
3364 dump_generic_node (pp
, TREE_TYPE (TREE_TYPE (t
)), spc
, flags
, false);
3366 dump_decl_name (pp
, t
, flags
);
3367 dump_function_declaration (pp
, TREE_TYPE (t
), spc
, flags
);
3371 /* Print type declaration. */
3372 dump_generic_node (pp
, TREE_TYPE (t
), spc
, flags
, false);
3374 /* Print variable's name. */
3376 dump_generic_node (pp
, t
, spc
, flags
, false);
3379 if (VAR_P (t
) && DECL_HARD_REGISTER (t
))
3381 pp_string (pp
, " __asm__ ");
3383 dump_generic_node (pp
, DECL_ASSEMBLER_NAME (t
), spc
, flags
, false);
3384 pp_right_paren (pp
);
3387 /* The initial value of a function serves to determine whether the function
3388 is declared or defined. So the following does not apply to function
3390 if (TREE_CODE (t
) != FUNCTION_DECL
)
3392 /* Print the initial value. */
3393 if (DECL_INITIAL (t
))
3398 dump_generic_node (pp
, DECL_INITIAL (t
), spc
, flags
, false);
3402 if (VAR_P (t
) && DECL_HAS_VALUE_EXPR_P (t
))
3404 pp_string (pp
, " [value-expr: ");
3405 dump_generic_node (pp
, DECL_VALUE_EXPR (t
), spc
, flags
, false);
3406 pp_right_bracket (pp
);
3413 /* Prints a structure: name, fields, and methods.
3414 FIXME: Still incomplete. */
3417 print_struct_decl (pretty_printer
*pp
, const_tree node
, int spc
, int flags
)
3419 /* Print the name of the structure. */
3420 if (TYPE_NAME (node
))
3423 if (TREE_CODE (node
) == RECORD_TYPE
)
3424 pp_string (pp
, "struct ");
3425 else if ((TREE_CODE (node
) == UNION_TYPE
3426 || TREE_CODE (node
) == QUAL_UNION_TYPE
))
3427 pp_string (pp
, "union ");
3429 dump_generic_node (pp
, TYPE_NAME (node
), spc
, 0, false);
3432 /* Print the contents of the structure. */
3438 /* Print the fields of the structure. */
3441 tmp
= TYPE_FIELDS (node
);
3444 /* Avoid to print recursively the structure. */
3445 /* FIXME : Not implemented correctly...,
3446 what about the case when we have a cycle in the contain graph? ...
3447 Maybe this could be solved by looking at the scope in which the
3448 structure was declared. */
3449 if (TREE_TYPE (tmp
) != node
3450 && (TREE_CODE (TREE_TYPE (tmp
)) != POINTER_TYPE
3451 || TREE_TYPE (TREE_TYPE (tmp
)) != node
))
3453 print_declaration (pp
, tmp
, spc
+2, flags
);
3456 tmp
= DECL_CHAIN (tmp
);
3460 pp_right_brace (pp
);
3463 /* Return the priority of the operator CODE.
3465 From lowest to highest precedence with either left-to-right (L-R)
3466 or right-to-left (R-L) associativity]:
3469 2 [R-L] = += -= *= /= %= &= ^= |= <<= >>=
3481 14 [R-L] ! ~ ++ -- + - * & (type) sizeof
3482 15 [L-R] fn() [] -> .
3484 unary +, - and * have higher precedence than the corresponding binary
3488 op_code_prio (enum tree_code code
)
3505 case TRUTH_ORIF_EXPR
:
3508 case TRUTH_AND_EXPR
:
3509 case TRUTH_ANDIF_EXPR
:
3516 case TRUTH_XOR_EXPR
:
3533 case UNORDERED_EXPR
:
3544 case VEC_WIDEN_LSHIFT_HI_EXPR
:
3545 case VEC_WIDEN_LSHIFT_LO_EXPR
:
3546 case WIDEN_LSHIFT_EXPR
:
3549 case WIDEN_SUM_EXPR
:
3551 case POINTER_PLUS_EXPR
:
3555 case VEC_WIDEN_MULT_HI_EXPR
:
3556 case VEC_WIDEN_MULT_LO_EXPR
:
3557 case WIDEN_MULT_EXPR
:
3559 case WIDEN_MULT_PLUS_EXPR
:
3560 case WIDEN_MULT_MINUS_EXPR
:
3562 case MULT_HIGHPART_EXPR
:
3563 case TRUNC_DIV_EXPR
:
3565 case FLOOR_DIV_EXPR
:
3566 case ROUND_DIV_EXPR
:
3568 case EXACT_DIV_EXPR
:
3569 case TRUNC_MOD_EXPR
:
3571 case FLOOR_MOD_EXPR
:
3572 case ROUND_MOD_EXPR
:
3576 case TRUTH_NOT_EXPR
:
3578 case POSTINCREMENT_EXPR
:
3579 case POSTDECREMENT_EXPR
:
3580 case PREINCREMENT_EXPR
:
3581 case PREDECREMENT_EXPR
:
3587 case FIX_TRUNC_EXPR
:
3593 case ARRAY_RANGE_REF
:
3597 /* Special expressions. */
3603 case REDUC_MAX_EXPR
:
3604 case REDUC_MIN_EXPR
:
3605 case REDUC_PLUS_EXPR
:
3606 case VEC_UNPACK_HI_EXPR
:
3607 case VEC_UNPACK_LO_EXPR
:
3608 case VEC_UNPACK_FLOAT_HI_EXPR
:
3609 case VEC_UNPACK_FLOAT_LO_EXPR
:
3610 case VEC_PACK_TRUNC_EXPR
:
3611 case VEC_PACK_SAT_EXPR
:
3615 /* Return an arbitrarily high precedence to avoid surrounding single
3616 VAR_DECLs in ()s. */
3621 /* Return the priority of the operator OP. */
3624 op_prio (const_tree op
)
3626 enum tree_code code
;
3631 code
= TREE_CODE (op
);
3632 if (code
== SAVE_EXPR
|| code
== NON_LVALUE_EXPR
)
3633 return op_prio (TREE_OPERAND (op
, 0));
3635 return op_code_prio (code
);
3638 /* Return the symbol associated with operator CODE. */
3641 op_symbol_code (enum tree_code code
)
3649 case TRUTH_ORIF_EXPR
:
3652 case TRUTH_AND_EXPR
:
3653 case TRUTH_ANDIF_EXPR
:
3659 case TRUTH_XOR_EXPR
:
3669 case UNORDERED_EXPR
:
3715 case WIDEN_LSHIFT_EXPR
:
3718 case POINTER_PLUS_EXPR
:
3724 case REDUC_PLUS_EXPR
:
3727 case WIDEN_SUM_EXPR
:
3730 case WIDEN_MULT_EXPR
:
3733 case MULT_HIGHPART_EXPR
:
3743 case TRUTH_NOT_EXPR
:
3750 case TRUNC_DIV_EXPR
:
3757 case FLOOR_DIV_EXPR
:
3760 case ROUND_DIV_EXPR
:
3763 case EXACT_DIV_EXPR
:
3766 case TRUNC_MOD_EXPR
:
3772 case FLOOR_MOD_EXPR
:
3775 case ROUND_MOD_EXPR
:
3778 case PREDECREMENT_EXPR
:
3781 case PREINCREMENT_EXPR
:
3784 case POSTDECREMENT_EXPR
:
3787 case POSTINCREMENT_EXPR
:
3797 return "<<< ??? >>>";
3801 /* Return the symbol associated with operator OP. */
3804 op_symbol (const_tree op
)
3806 return op_symbol_code (TREE_CODE (op
));
3809 /* Prints the name of a call. NODE is the CALL_EXPR_FN of a CALL_EXPR or
3810 the gimple_call_fn of a GIMPLE_CALL. */
3813 print_call_name (pretty_printer
*pp
, tree node
, int flags
)
3817 if (TREE_CODE (op0
) == NON_LVALUE_EXPR
)
3818 op0
= TREE_OPERAND (op0
, 0);
3821 switch (TREE_CODE (op0
))
3826 dump_function_name (pp
, op0
, flags
);
3832 op0
= TREE_OPERAND (op0
, 0);
3837 dump_generic_node (pp
, TREE_OPERAND (op0
, 0), 0, flags
, false);
3838 pp_string (pp
, ") ? ");
3839 dump_generic_node (pp
, TREE_OPERAND (op0
, 1), 0, flags
, false);
3840 pp_string (pp
, " : ");
3841 dump_generic_node (pp
, TREE_OPERAND (op0
, 2), 0, flags
, false);
3845 if (TREE_CODE (TREE_OPERAND (op0
, 0)) == VAR_DECL
)
3846 dump_function_name (pp
, TREE_OPERAND (op0
, 0), flags
);
3848 dump_generic_node (pp
, op0
, 0, flags
, false);
3852 if (integer_zerop (TREE_OPERAND (op0
, 1)))
3854 op0
= TREE_OPERAND (op0
, 0);
3861 dump_generic_node (pp
, op0
, 0, flags
, false);
3869 /* Parses the string STR and replaces new-lines by '\n', tabs by '\t', ... */
3872 pretty_print_string (pretty_printer
*pp
, const char *str
)
3882 pp_string (pp
, "\\b");
3886 pp_string (pp
, "\\f");
3890 pp_string (pp
, "\\n");
3894 pp_string (pp
, "\\r");
3898 pp_string (pp
, "\\t");
3902 pp_string (pp
, "\\v");
3906 pp_string (pp
, "\\\\");
3910 pp_string (pp
, "\\\"");
3914 pp_string (pp
, "\\'");
3917 /* No need to handle \0; the loop terminates on \0. */
3920 pp_string (pp
, "\\1");
3924 pp_string (pp
, "\\2");
3928 pp_string (pp
, "\\3");
3932 pp_string (pp
, "\\4");
3936 pp_string (pp
, "\\5");
3940 pp_string (pp
, "\\6");
3944 pp_string (pp
, "\\7");
3948 if (!ISPRINT (str
[0]))
3951 sprintf (buf
, "\\x%x", (unsigned char)str
[0]);
3952 pp_string (pp
, buf
);
3955 pp_character (pp
, str
[0]);
3963 maybe_init_pretty_print (FILE *file
)
3967 tree_pp
= new pretty_printer ();
3968 pp_needs_newline (tree_pp
) = true;
3969 pp_translate_identifiers (tree_pp
) = false;
3972 tree_pp
->buffer
->stream
= file
;
3976 newline_and_indent (pretty_printer
*pp
, int spc
)
3982 /* Handle a %K format for TEXT. Separate from default_tree_printer so
3983 it can also be used in front ends.
3984 %K: a statement, from which EXPR_LOCATION and TREE_BLOCK will be recorded.
3988 percent_K_format (text_info
*text
)
3990 tree t
= va_arg (*text
->args_ptr
, tree
), block
;
3991 text
->set_location (0, EXPR_LOCATION (t
), true);
3992 gcc_assert (pp_ti_abstract_origin (text
) != NULL
);
3993 block
= TREE_BLOCK (t
);
3994 *pp_ti_abstract_origin (text
) = NULL
;
3998 /* ??? LTO drops all BLOCK_ABSTRACT_ORIGINs apart from those
3999 representing the outermost block of an inlined function.
4000 So walk the BLOCK tree until we hit such a scope. */
4002 && TREE_CODE (block
) == BLOCK
)
4004 if (inlined_function_outer_scope_p (block
))
4006 *pp_ti_abstract_origin (text
) = block
;
4009 block
= BLOCK_SUPERCONTEXT (block
);
4015 && TREE_CODE (block
) == BLOCK
4016 && BLOCK_ABSTRACT_ORIGIN (block
))
4018 tree ao
= BLOCK_ABSTRACT_ORIGIN (block
);
4020 while (TREE_CODE (ao
) == BLOCK
4021 && BLOCK_ABSTRACT_ORIGIN (ao
)
4022 && BLOCK_ABSTRACT_ORIGIN (ao
) != ao
)
4023 ao
= BLOCK_ABSTRACT_ORIGIN (ao
);
4025 if (TREE_CODE (ao
) == FUNCTION_DECL
)
4027 *pp_ti_abstract_origin (text
) = block
;
4030 block
= BLOCK_SUPERCONTEXT (block
);
4034 /* Print the identifier ID to PRETTY-PRINTER. */
4037 pp_tree_identifier (pretty_printer
*pp
, tree id
)
4039 if (pp_translate_identifiers (pp
))
4041 const char *text
= identifier_to_locale (IDENTIFIER_POINTER (id
));
4042 pp_append_text (pp
, text
, text
+ strlen (text
));
4045 pp_append_text (pp
, IDENTIFIER_POINTER (id
),
4046 IDENTIFIER_POINTER (id
) + IDENTIFIER_LENGTH (id
));
4049 /* A helper function that is used to dump function information before the
4053 dump_function_header (FILE *dump_file
, tree fdecl
, int flags
)
4055 const char *dname
, *aname
;
4056 struct cgraph_node
*node
= cgraph_node::get (fdecl
);
4057 struct function
*fun
= DECL_STRUCT_FUNCTION (fdecl
);
4059 dname
= lang_hooks
.decl_printable_name (fdecl
, 2);
4061 if (DECL_ASSEMBLER_NAME_SET_P (fdecl
))
4062 aname
= (IDENTIFIER_POINTER
4063 (DECL_ASSEMBLER_NAME (fdecl
)));
4065 aname
= "<unset-asm-name>";
4067 fprintf (dump_file
, "\n;; Function %s (%s, funcdef_no=%d",
4068 dname
, aname
, fun
->funcdef_no
);
4069 if (!(flags
& TDF_NOUID
))
4070 fprintf (dump_file
, ", decl_uid=%d", DECL_UID (fdecl
));
4073 fprintf (dump_file
, ", cgraph_uid=%d", node
->uid
);
4074 fprintf (dump_file
, ", symbol_order=%d)%s\n\n", node
->order
,
4075 node
->frequency
== NODE_FREQUENCY_HOT
4077 : node
->frequency
== NODE_FREQUENCY_UNLIKELY_EXECUTED
4078 ? " (unlikely executed)"
4079 : node
->frequency
== NODE_FREQUENCY_EXECUTED_ONCE
4080 ? " (executed once)"
4084 fprintf (dump_file
, ")\n\n");
4087 /* Dump double_int D to pretty_printer PP. UNS is true
4088 if D is unsigned and false otherwise. */
4090 pp_double_int (pretty_printer
*pp
, double_int d
, bool uns
)
4093 pp_wide_integer (pp
, d
.low
);
4094 else if (d
.fits_uhwi ())
4095 pp_unsigned_wide_integer (pp
, d
.low
);
4098 unsigned HOST_WIDE_INT low
= d
.low
;
4099 HOST_WIDE_INT high
= d
.high
;
4100 if (!uns
&& d
.is_negative ())
4103 high
= ~high
+ !low
;
4106 /* Would "%x%0*x" or "%x%*0x" get zero-padding on all
4108 sprintf (pp_buffer (pp
)->digit_buffer
,
4109 HOST_WIDE_INT_PRINT_DOUBLE_HEX
,
4110 (unsigned HOST_WIDE_INT
) high
, low
);
4111 pp_string (pp
, pp_buffer (pp
)->digit_buffer
);