1 /* Pretty formatting of GIMPLE statements and expressions.
2 Copyright (C) 2001-2024 Free Software Foundation, Inc.
3 Contributed by Aldy Hernandez <aldyh@redhat.com> and
4 Diego Novillo <dnovillo@google.com>
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 3, or (at your option) any later
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
24 #include "coretypes.h"
29 #include "gimple-predict.h"
32 #include "gimple-pretty-print.h"
33 #include "value-range-pretty-print.h"
34 #include "internal-fn.h"
36 #include "gimple-iterator.h"
38 #include "dumpfile.h" /* for dump_flags */
39 #include "value-prof.h"
40 #include "trans-mem.h"
42 #include "stringpool.h"
46 #include "gimple-range.h"
48 /* Disable warnings about quoting issues in the pp_xxx calls below
49 that (intentionally) don't follow GCC diagnostic conventions. */
51 # pragma GCC diagnostic push
52 # pragma GCC diagnostic ignored "-Wformat-diag"
55 #define INDENT(SPACE) \
56 do { int i; for (i = 0; i < SPACE; i++) pp_space (pp); } while (0)
58 #define GIMPLE_NIY do_niy (pp,gs)
60 /* Try to print on PP a default message for the unrecognized
61 gimple statement GS. */
64 do_niy (pretty_printer
*pp
, const gimple
*gs
)
66 pp_printf (pp
, "<<< Unknown GIMPLE statement: %s >>>\n",
67 gimple_code_name
[(int) gimple_code (gs
)]);
71 /* Emit a newline and SPC indentation spaces to PP. */
74 newline_and_indent (pretty_printer
*pp
, int spc
)
81 /* Print the GIMPLE statement GS on stderr. */
84 debug_gimple_stmt (gimple
*gs
)
86 print_gimple_stmt (stderr
, gs
, 0, TDF_VOPS
|TDF_MEMSYMS
);
90 /* Return formatted string of a VALUE probability
91 (biased by REG_BR_PROB_BASE). Returned string is allocated
92 by xstrdup_for_dump. */
95 dump_profile (profile_count
&count
)
98 if (!count
.initialized_p ())
101 buf
= xasprintf ("[count: %" PRId64
"]",
102 count
.to_gcov_type ());
103 else if (count
.initialized_p ())
104 buf
= xasprintf ("[local count: %" PRId64
"]",
105 count
.to_gcov_type ());
107 const char *ret
= xstrdup_for_dump (buf
);
113 /* Return formatted string of a VALUE probability
114 (biased by REG_BR_PROB_BASE). Returned string is allocated
115 by xstrdup_for_dump. */
118 dump_probability (profile_probability probability
)
120 float minimum
= 0.01f
;
123 if (probability
.initialized_p ())
125 fvalue
= probability
.to_reg_br_prob_base () * 100.0f
/ REG_BR_PROB_BASE
;
126 if (fvalue
< minimum
&& probability
.to_reg_br_prob_base ())
131 if (probability
.initialized_p ())
132 buf
= xasprintf ("[%.2f%%]", fvalue
);
134 buf
= xasprintf ("[INV]");
136 const char *ret
= xstrdup_for_dump (buf
);
142 /* Dump E probability to PP. */
145 dump_edge_probability (pretty_printer
*pp
, edge e
)
147 pp_scalar (pp
, " %s", dump_probability (e
->probability
));
150 /* Print GIMPLE statement G to FILE using SPC indentation spaces and
151 FLAGS as in pp_gimple_stmt_1. */
154 print_gimple_stmt (FILE *file
, gimple
*g
, int spc
, dump_flags_t flags
)
157 pp_needs_newline (&pp
) = true;
158 pp
.set_output_stream (file
);
159 pp_gimple_stmt_1 (&pp
, g
, spc
, flags
);
160 pp_newline_and_flush (&pp
);
166 print_gimple_stmt (stderr
, &ref
, 0, TDF_NONE
);
175 fprintf (stderr
, "<nil>\n");
179 /* Print GIMPLE statement G to FILE using SPC indentation spaces and
180 FLAGS as in pp_gimple_stmt_1. Print only the right-hand side
184 print_gimple_expr (FILE *file
, gimple
*g
, int spc
, dump_flags_t flags
)
186 flags
|= TDF_RHS_ONLY
;
188 pp_needs_newline (&pp
) = true;
189 pp
.set_output_stream (file
);
190 pp_gimple_stmt_1 (&pp
, g
, spc
, flags
);
195 /* Print the GIMPLE sequence SEQ on PP using SPC indentation
196 spaces and FLAGS as in pp_gimple_stmt_1.
197 The caller is responsible for calling pp_flush on PP to finalize
198 the pretty printer. */
201 dump_gimple_seq (pretty_printer
*pp
, gimple_seq seq
, int spc
,
204 gimple_stmt_iterator i
;
206 for (i
= gsi_start (seq
); !gsi_end_p (i
); gsi_next (&i
))
208 gimple
*gs
= gsi_stmt (i
);
210 pp_gimple_stmt_1 (pp
, gs
, spc
, flags
);
211 if (!gsi_one_before_end_p (i
))
217 /* Print GIMPLE sequence SEQ to FILE using SPC indentation spaces and
218 FLAGS as in pp_gimple_stmt_1. */
221 print_gimple_seq (FILE *file
, gimple_seq seq
, int spc
, dump_flags_t flags
)
224 pp_needs_newline (&pp
) = true;
225 pp
.set_output_stream (file
);
226 dump_gimple_seq (&pp
, seq
, spc
, flags
);
227 pp_newline_and_flush (&pp
);
231 /* Print the GIMPLE sequence SEQ on stderr. */
234 debug_gimple_seq (gimple_seq seq
)
236 print_gimple_seq (stderr
, seq
, 0, TDF_VOPS
|TDF_MEMSYMS
);
240 /* A simple helper to pretty-print some of the gimple tuples in the printf
241 style. The format modifiers are preceded by '%' and are:
242 'G' - outputs a string corresponding to the code of the given gimple,
243 'S' - outputs a gimple_seq with indent of spc + 2,
244 'T' - outputs the tree t,
245 'd' - outputs an int as a decimal,
246 's' - outputs a string,
247 'n' - outputs a newline,
248 'x' - outputs an int as hexadecimal,
249 '+' - increases indent by 2 then outputs a newline,
250 '-' - decreases indent by 2 then outputs a newline. */
253 dump_gimple_fmt (pretty_printer
*pp
, int spc
, dump_flags_t flags
,
254 const char *fmt
, ...)
260 va_start (args
, fmt
);
261 for (c
= fmt
; *c
; c
++)
271 g
= va_arg (args
, gimple
*);
272 tmp
= gimple_code_name
[gimple_code (g
)];
277 seq
= va_arg (args
, gimple_seq
);
279 dump_gimple_seq (pp
, seq
, spc
+ 2, flags
);
280 newline_and_indent (pp
, spc
);
284 t
= va_arg (args
, tree
);
286 pp_string (pp
, "NULL");
288 dump_generic_node (pp
, t
, spc
, flags
, false);
292 pp_decimal_int (pp
, va_arg (args
, int));
296 pp_string (pp
, va_arg (args
, char *));
300 newline_and_indent (pp
, spc
);
304 pp_scalar (pp
, "%x", va_arg (args
, int));
309 newline_and_indent (pp
, spc
);
314 newline_and_indent (pp
, spc
);
322 pp_character (pp
, *c
);
328 /* Helper for dump_gimple_assign. Print the unary RHS of the
329 assignment GS. PP, SPC and FLAGS are as in pp_gimple_stmt_1. */
332 dump_unary_rhs (pretty_printer
*pp
, const gassign
*gs
, int spc
,
335 enum tree_code rhs_code
= gimple_assign_rhs_code (gs
);
336 tree lhs
= gimple_assign_lhs (gs
);
337 tree rhs
= gimple_assign_rhs1 (gs
);
341 case VIEW_CONVERT_EXPR
:
342 dump_generic_node (pp
, rhs
, spc
, flags
, false);
345 case FIXED_CONVERT_EXPR
:
346 case ADDR_SPACE_CONVERT_EXPR
:
351 dump_generic_node (pp
, TREE_TYPE (lhs
), spc
, flags
, false);
352 pp_string (pp
, ") ");
353 if (op_prio (rhs
) < op_code_prio (rhs_code
))
356 dump_generic_node (pp
, rhs
, spc
, flags
, false);
360 dump_generic_node (pp
, rhs
, spc
, flags
, false);
364 pp_string (pp
, "((");
365 dump_generic_node (pp
, rhs
, spc
, flags
, false);
366 pp_string (pp
, "))");
371 if (flags
& TDF_GIMPLE
)
374 rhs_code
== ABS_EXPR
? "__ABS " : "__ABSU ");
375 dump_generic_node (pp
, rhs
, spc
, flags
, false);
380 rhs_code
== ABS_EXPR
? "ABS_EXPR <" : "ABSU_EXPR <");
381 dump_generic_node (pp
, rhs
, spc
, flags
, false);
387 if (TREE_CODE_CLASS (rhs_code
) == tcc_declaration
388 || TREE_CODE_CLASS (rhs_code
) == tcc_constant
389 || TREE_CODE_CLASS (rhs_code
) == tcc_reference
390 || rhs_code
== SSA_NAME
391 || rhs_code
== ADDR_EXPR
392 || rhs_code
== CONSTRUCTOR
)
394 dump_generic_node (pp
, rhs
, spc
, flags
, false);
397 else if (rhs_code
== BIT_NOT_EXPR
)
399 else if (rhs_code
== TRUTH_NOT_EXPR
)
401 else if (rhs_code
== NEGATE_EXPR
)
405 pp_left_bracket (pp
);
406 pp_string (pp
, get_tree_code_name (rhs_code
));
407 pp_string (pp
, "] ");
410 if (op_prio (rhs
) < op_code_prio (rhs_code
))
413 dump_generic_node (pp
, rhs
, spc
, flags
, false);
417 dump_generic_node (pp
, rhs
, spc
, flags
, false);
423 /* Helper for dump_gimple_assign. Print the binary RHS of the
424 assignment GS. PP, SPC and FLAGS are as in pp_gimple_stmt_1. */
427 dump_binary_rhs (pretty_printer
*pp
, const gassign
*gs
, int spc
,
431 enum tree_code code
= gimple_assign_rhs_code (gs
);
436 if (flags
& TDF_GIMPLE
)
438 pp_string (pp
, code
== MIN_EXPR
? "__MIN (" : "__MAX (");
439 dump_generic_node (pp
, gimple_assign_rhs1 (gs
), spc
, flags
,
441 pp_string (pp
, ", ");
442 dump_generic_node (pp
, gimple_assign_rhs2 (gs
), spc
, flags
,
452 case VEC_WIDEN_MULT_HI_EXPR
:
453 case VEC_WIDEN_MULT_LO_EXPR
:
454 case VEC_WIDEN_MULT_EVEN_EXPR
:
455 case VEC_WIDEN_MULT_ODD_EXPR
:
456 case VEC_PACK_TRUNC_EXPR
:
457 case VEC_PACK_SAT_EXPR
:
458 case VEC_PACK_FIX_TRUNC_EXPR
:
459 case VEC_PACK_FLOAT_EXPR
:
460 case VEC_WIDEN_LSHIFT_HI_EXPR
:
461 case VEC_WIDEN_LSHIFT_LO_EXPR
:
462 case VEC_SERIES_EXPR
:
463 for (p
= get_tree_code_name (code
); *p
; p
++)
464 pp_character (pp
, TOUPPER (*p
));
465 pp_string (pp
, " <");
466 dump_generic_node (pp
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
467 pp_string (pp
, ", ");
468 dump_generic_node (pp
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
473 if (op_prio (gimple_assign_rhs1 (gs
)) <= op_code_prio (code
))
476 dump_generic_node (pp
, gimple_assign_rhs1 (gs
), spc
, flags
,
481 dump_generic_node (pp
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
483 pp_string (pp
, op_symbol_code (gimple_assign_rhs_code (gs
), flags
));
485 if (op_prio (gimple_assign_rhs2 (gs
)) <= op_code_prio (code
))
488 dump_generic_node (pp
, gimple_assign_rhs2 (gs
), spc
, flags
,
493 dump_generic_node (pp
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
497 /* Helper for dump_gimple_assign. Print the ternary RHS of the
498 assignment GS. PP, SPC and FLAGS are as in pp_gimple_stmt_1. */
501 dump_ternary_rhs (pretty_printer
*pp
, const gassign
*gs
, int spc
,
505 enum tree_code code
= gimple_assign_rhs_code (gs
);
508 case WIDEN_MULT_PLUS_EXPR
:
509 case WIDEN_MULT_MINUS_EXPR
:
510 for (p
= get_tree_code_name (code
); *p
; p
++)
511 pp_character (pp
, TOUPPER (*p
));
512 pp_string (pp
, " <");
513 dump_generic_node (pp
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
514 pp_string (pp
, ", ");
515 dump_generic_node (pp
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
516 pp_string (pp
, ", ");
517 dump_generic_node (pp
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
522 pp_string (pp
, "DOT_PROD_EXPR <");
523 dump_generic_node (pp
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
524 pp_string (pp
, ", ");
525 dump_generic_node (pp
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
526 pp_string (pp
, ", ");
527 dump_generic_node (pp
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
532 pp_string (pp
, "SAD_EXPR <");
533 dump_generic_node (pp
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
534 pp_string (pp
, ", ");
535 dump_generic_node (pp
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
536 pp_string (pp
, ", ");
537 dump_generic_node (pp
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
542 if (flags
& TDF_GIMPLE
)
543 pp_string (pp
, "__VEC_PERM (");
545 pp_string (pp
, "VEC_PERM_EXPR <");
546 dump_generic_node (pp
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
547 pp_string (pp
, ", ");
548 dump_generic_node (pp
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
549 pp_string (pp
, ", ");
550 dump_generic_node (pp
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
551 if (flags
& TDF_GIMPLE
)
557 case REALIGN_LOAD_EXPR
:
558 pp_string (pp
, "REALIGN_LOAD <");
559 dump_generic_node (pp
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
560 pp_string (pp
, ", ");
561 dump_generic_node (pp
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
562 pp_string (pp
, ", ");
563 dump_generic_node (pp
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
568 dump_generic_node (pp
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
569 pp_string (pp
, " ? ");
570 dump_generic_node (pp
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
571 pp_string (pp
, " : ");
572 dump_generic_node (pp
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
576 pp_string (pp
, "VEC_COND_EXPR <");
577 dump_generic_node (pp
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
578 pp_string (pp
, ", ");
579 dump_generic_node (pp
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
580 pp_string (pp
, ", ");
581 dump_generic_node (pp
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
585 case BIT_INSERT_EXPR
:
586 if (flags
& TDF_GIMPLE
)
588 pp_string (pp
, "__BIT_INSERT (");
589 dump_generic_node (pp
, gimple_assign_rhs1 (gs
), spc
,
590 flags
| TDF_SLIM
, false);
591 pp_string (pp
, ", ");
592 dump_generic_node (pp
, gimple_assign_rhs2 (gs
), spc
,
593 flags
| TDF_SLIM
, false);
594 pp_string (pp
, ", ");
595 dump_generic_node (pp
, gimple_assign_rhs3 (gs
), spc
,
596 flags
| TDF_SLIM
, false);
601 pp_string (pp
, "BIT_INSERT_EXPR <");
602 dump_generic_node (pp
, gimple_assign_rhs1 (gs
),
604 pp_string (pp
, ", ");
605 dump_generic_node (pp
, gimple_assign_rhs2 (gs
),
607 pp_string (pp
, ", ");
608 dump_generic_node (pp
, gimple_assign_rhs3 (gs
),
610 if (INTEGRAL_TYPE_P (TREE_TYPE (gimple_assign_rhs2 (gs
))))
612 pp_string (pp
, " (");
613 pp_decimal_int (pp
, TYPE_PRECISION
614 (TREE_TYPE (gimple_assign_rhs2 (gs
))));
615 pp_string (pp
, " bits)");
627 /* Dump the gimple assignment GS. PP, SPC and FLAGS are as in
631 dump_gimple_assign (pretty_printer
*pp
, const gassign
*gs
, int spc
,
639 switch (gimple_num_ops (gs
))
642 arg3
= gimple_assign_rhs3 (gs
);
645 arg2
= gimple_assign_rhs2 (gs
);
648 arg1
= gimple_assign_rhs1 (gs
);
654 dump_gimple_fmt (pp
, spc
, flags
, "%G <%s, %T, %T, %T, %T>", gs
,
655 get_tree_code_name (gimple_assign_rhs_code (gs
)),
656 gimple_assign_lhs (gs
), arg1
, arg2
, arg3
);
660 if (!(flags
& TDF_RHS_ONLY
))
662 dump_generic_node (pp
, gimple_assign_lhs (gs
), spc
, flags
, false);
666 if (gimple_assign_nontemporal_move_p (gs
))
667 pp_string (pp
, "{nt}");
669 if (gimple_has_volatile_ops (gs
))
670 pp_string (pp
, "{v}");
675 if (gimple_num_ops (gs
) == 2)
676 dump_unary_rhs (pp
, gs
, spc
,
677 ((flags
& TDF_GIMPLE
)
678 && gimple_assign_rhs_class (gs
) != GIMPLE_SINGLE_RHS
)
679 ? (flags
| TDF_GIMPLE_VAL
) : flags
);
680 else if (gimple_num_ops (gs
) == 3)
681 dump_binary_rhs (pp
, gs
, spc
,
683 ? (flags
| TDF_GIMPLE_VAL
) : flags
);
684 else if (gimple_num_ops (gs
) == 4)
685 dump_ternary_rhs (pp
, gs
, spc
,
687 ? (flags
| TDF_GIMPLE_VAL
) : flags
);
690 if (!(flags
& TDF_RHS_ONLY
))
696 /* Dump the return statement GS. PP, SPC and FLAGS are as in
700 dump_gimple_return (pretty_printer
*pp
, const greturn
*gs
, int spc
,
705 t
= gimple_return_retval (gs
);
707 dump_gimple_fmt (pp
, spc
, flags
, "%G <%T>", gs
, t
);
710 pp_string (pp
, "return");
714 dump_generic_node (pp
, t
, spc
, flags
, false);
721 /* Dump the call arguments for a gimple call. PP, FLAGS are as in
725 dump_gimple_call_args (pretty_printer
*pp
, const gcall
*gs
,
730 /* Pretty print first arg to certain internal fns. */
731 if (gimple_call_internal_p (gs
))
733 const char *const *enums
= NULL
;
736 switch (gimple_call_internal_fn (gs
))
740 static const char *const unique_args
[] = {IFN_UNIQUE_CODES
};
744 limit
= ARRAY_SIZE (unique_args
);
749 static const char *const loop_args
[] = {IFN_GOACC_LOOP_CODES
};
752 limit
= ARRAY_SIZE (loop_args
);
755 case IFN_GOACC_REDUCTION
:
757 static const char *const reduction_args
[]
758 = {IFN_GOACC_REDUCTION_CODES
};
760 enums
= reduction_args
;
761 limit
= ARRAY_SIZE (reduction_args
);
764 case IFN_HWASAN_MARK
:
767 static const char *const asan_mark_args
[] = {IFN_ASAN_MARK_FLAGS
};
769 enums
= asan_mark_args
;
770 limit
= ARRAY_SIZE (asan_mark_args
);
778 tree arg0
= gimple_call_arg (gs
, 0);
781 if (TREE_CODE (arg0
) == INTEGER_CST
782 && tree_fits_shwi_p (arg0
)
783 && (v
= tree_to_shwi (arg0
)) >= 0 && v
< limit
)
786 pp_string (pp
, enums
[v
]);
791 for (; i
< gimple_call_num_args (gs
); i
++)
794 pp_string (pp
, ", ");
795 dump_generic_node (pp
, gimple_call_arg (gs
, i
), 0, flags
, false);
798 if (gimple_call_va_arg_pack_p (gs
))
801 pp_string (pp
, ", ");
803 pp_string (pp
, "__builtin_va_arg_pack ()");
807 /* Dump the points-to solution *PT to PP. */
810 pp_points_to_solution (pretty_printer
*pp
, const pt_solution
*pt
)
814 pp_string (pp
, "anything ");
818 pp_string (pp
, "nonlocal ");
820 pp_string (pp
, "escaped ");
822 pp_string (pp
, "unit-escaped ");
824 pp_string (pp
, "null ");
826 pp_string (pp
, "const-pool ");
828 && !bitmap_empty_p (pt
->vars
))
832 pp_string (pp
, "{ ");
833 EXECUTE_IF_SET_IN_BITMAP (pt
->vars
, 0, i
, bi
)
835 pp_string (pp
, "D.");
836 pp_decimal_int (pp
, i
);
840 if (pt
->vars_contains_nonlocal
841 || pt
->vars_contains_escaped
842 || pt
->vars_contains_escaped_heap
843 || pt
->vars_contains_restrict
844 || pt
->vars_contains_interposable
)
846 const char *comma
= "";
847 pp_string (pp
, " (");
848 if (pt
->vars_contains_nonlocal
)
850 pp_string (pp
, "nonlocal");
853 if (pt
->vars_contains_escaped
)
855 pp_string (pp
, comma
);
856 pp_string (pp
, "escaped");
859 if (pt
->vars_contains_escaped_heap
)
861 pp_string (pp
, comma
);
862 pp_string (pp
, "escaped heap");
865 if (pt
->vars_contains_restrict
)
867 pp_string (pp
, comma
);
868 pp_string (pp
, "restrict");
871 if (pt
->vars_contains_interposable
)
873 pp_string (pp
, comma
);
874 pp_string (pp
, "interposable");
882 /* Dump the call statement GS. PP, SPC and FLAGS are as in
886 dump_gimple_call (pretty_printer
*pp
, const gcall
*gs
, int spc
,
889 tree lhs
= gimple_call_lhs (gs
);
890 tree fn
= gimple_call_fn (gs
);
892 if (flags
& TDF_ALIAS
)
894 const pt_solution
*pt
;
895 pt
= gimple_call_use_set (gs
);
896 if (!pt_solution_empty_p (pt
))
898 pp_string (pp
, "# USE = ");
899 pp_points_to_solution (pp
, pt
);
900 newline_and_indent (pp
, spc
);
902 pt
= gimple_call_clobber_set (gs
);
903 if (!pt_solution_empty_p (pt
))
905 pp_string (pp
, "# CLB = ");
906 pp_points_to_solution (pp
, pt
);
907 newline_and_indent (pp
, spc
);
913 if (gimple_call_internal_p (gs
))
914 dump_gimple_fmt (pp
, spc
, flags
, "%G <.%s, %T", gs
,
915 internal_fn_name (gimple_call_internal_fn (gs
)), lhs
);
917 dump_gimple_fmt (pp
, spc
, flags
, "%G <%T, %T", gs
, fn
, lhs
);
918 if (gimple_call_num_args (gs
) > 0)
920 pp_string (pp
, ", ");
921 dump_gimple_call_args (pp
, gs
, flags
);
927 if (lhs
&& !(flags
& TDF_RHS_ONLY
))
929 dump_generic_node (pp
, lhs
, spc
, flags
, false);
930 pp_string (pp
, " =");
932 if (gimple_has_volatile_ops (gs
))
933 pp_string (pp
, "{v}");
937 if (gimple_call_internal_p (gs
))
940 pp_string (pp
, internal_fn_name (gimple_call_internal_fn (gs
)));
943 print_call_name (pp
, fn
, flags
);
944 pp_string (pp
, " (");
945 dump_gimple_call_args (pp
, gs
, flags
);
947 if (!(flags
& TDF_RHS_ONLY
))
951 if (gimple_call_chain (gs
))
953 pp_string (pp
, " [static-chain: ");
954 dump_generic_node (pp
, gimple_call_chain (gs
), spc
, flags
, false);
955 pp_right_bracket (pp
);
958 if (gimple_call_return_slot_opt_p (gs
))
959 pp_string (pp
, " [return slot optimization]");
960 if (gimple_call_tail_p (gs
))
961 pp_string (pp
, " [tail call]");
962 if (gimple_call_must_tail_p (gs
))
963 pp_string (pp
, " [must tail call]");
968 /* Dump the arguments of _ITM_beginTransaction sanely. */
969 if (TREE_CODE (fn
) == ADDR_EXPR
)
970 fn
= TREE_OPERAND (fn
, 0);
971 if (TREE_CODE (fn
) == FUNCTION_DECL
&& decl_is_tm_clone (fn
))
972 pp_string (pp
, " [tm-clone]");
973 if (TREE_CODE (fn
) == FUNCTION_DECL
974 && fndecl_built_in_p (fn
, BUILT_IN_TM_START
)
975 && gimple_call_num_args (gs
) > 0)
977 tree t
= gimple_call_arg (gs
, 0);
978 unsigned HOST_WIDE_INT props
;
979 gcc_assert (TREE_CODE (t
) == INTEGER_CST
);
981 pp_string (pp
, " [ ");
983 /* Get the transaction code properties. */
984 props
= TREE_INT_CST_LOW (t
);
986 if (props
& PR_INSTRUMENTEDCODE
)
987 pp_string (pp
, "instrumentedCode ");
988 if (props
& PR_UNINSTRUMENTEDCODE
)
989 pp_string (pp
, "uninstrumentedCode ");
990 if (props
& PR_HASNOXMMUPDATE
)
991 pp_string (pp
, "hasNoXMMUpdate ");
992 if (props
& PR_HASNOABORT
)
993 pp_string (pp
, "hasNoAbort ");
994 if (props
& PR_HASNOIRREVOCABLE
)
995 pp_string (pp
, "hasNoIrrevocable ");
996 if (props
& PR_DOESGOIRREVOCABLE
)
997 pp_string (pp
, "doesGoIrrevocable ");
998 if (props
& PR_HASNOSIMPLEREADS
)
999 pp_string (pp
, "hasNoSimpleReads ");
1000 if (props
& PR_AWBARRIERSOMITTED
)
1001 pp_string (pp
, "awBarriersOmitted ");
1002 if (props
& PR_RARBARRIERSOMITTED
)
1003 pp_string (pp
, "RaRBarriersOmitted ");
1004 if (props
& PR_UNDOLOGCODE
)
1005 pp_string (pp
, "undoLogCode ");
1006 if (props
& PR_PREFERUNINSTRUMENTED
)
1007 pp_string (pp
, "preferUninstrumented ");
1008 if (props
& PR_EXCEPTIONBLOCK
)
1009 pp_string (pp
, "exceptionBlock ");
1010 if (props
& PR_HASELSE
)
1011 pp_string (pp
, "hasElse ");
1012 if (props
& PR_READONLY
)
1013 pp_string (pp
, "readOnly ");
1015 pp_right_bracket (pp
);
1020 /* Dump the switch statement GS. PP, SPC and FLAGS are as in
1021 pp_gimple_stmt_1. */
1024 dump_gimple_switch (pretty_printer
*pp
, const gswitch
*gs
, int spc
,
1029 GIMPLE_CHECK (gs
, GIMPLE_SWITCH
);
1030 if (flags
& TDF_RAW
)
1031 dump_gimple_fmt (pp
, spc
, flags
, "%G <%T, ", gs
,
1032 gimple_switch_index (gs
));
1035 pp_string (pp
, "switch (");
1036 dump_generic_node (pp
, gimple_switch_index (gs
), spc
, flags
, true);
1037 if (flags
& TDF_GIMPLE
)
1038 pp_string (pp
, ") {");
1040 pp_string (pp
, ") <");
1043 for (i
= 0; i
< gimple_switch_num_labels (gs
); i
++)
1045 tree case_label
= gimple_switch_label (gs
, i
);
1046 gcc_checking_assert (case_label
!= NULL_TREE
);
1047 dump_generic_node (pp
, case_label
, spc
, flags
, false);
1049 tree label
= CASE_LABEL (case_label
);
1050 dump_generic_node (pp
, label
, spc
, flags
, false);
1052 if (cfun
&& cfun
->cfg
)
1054 basic_block dest
= label_to_block (cfun
, label
);
1057 edge label_edge
= find_edge (gimple_bb (gs
), dest
);
1058 if (label_edge
&& !(flags
& TDF_GIMPLE
))
1059 dump_edge_probability (pp
, label_edge
);
1063 if (i
< gimple_switch_num_labels (gs
) - 1)
1065 if (flags
& TDF_GIMPLE
)
1066 pp_string (pp
, "; ");
1068 pp_string (pp
, ", ");
1071 if (flags
& TDF_GIMPLE
)
1072 pp_string (pp
, "; }");
1078 /* Dump the gimple conditional GS. PP, SPC and FLAGS are as in
1079 pp_gimple_stmt_1. */
1082 dump_gimple_cond (pretty_printer
*pp
, const gcond
*gs
, int spc
,
1085 if (flags
& TDF_RAW
)
1086 dump_gimple_fmt (pp
, spc
, flags
, "%G <%s, %T, %T, %T, %T>", gs
,
1087 get_tree_code_name (gimple_cond_code (gs
)),
1088 gimple_cond_lhs (gs
), gimple_cond_rhs (gs
),
1089 gimple_cond_true_label (gs
), gimple_cond_false_label (gs
));
1092 if (!(flags
& TDF_RHS_ONLY
))
1093 pp_string (pp
, "if (");
1094 dump_generic_node (pp
, gimple_cond_lhs (gs
), spc
,
1095 flags
| ((flags
& TDF_GIMPLE
) ? TDF_GIMPLE_VAL
: TDF_NONE
),
1098 pp_string (pp
, op_symbol_code (gimple_cond_code (gs
), flags
));
1100 dump_generic_node (pp
, gimple_cond_rhs (gs
), spc
,
1101 flags
| ((flags
& TDF_GIMPLE
) ? TDF_GIMPLE_VAL
: TDF_NONE
),
1103 if (!(flags
& TDF_RHS_ONLY
))
1106 edge e
, true_edge
= NULL
, false_edge
= NULL
;
1107 basic_block bb
= gimple_bb (gs
);
1111 FOR_EACH_EDGE (e
, ei
, bb
->succs
)
1113 if (e
->flags
& EDGE_TRUE_VALUE
)
1115 else if (e
->flags
& EDGE_FALSE_VALUE
)
1120 bool has_edge_info
= true_edge
!= NULL
&& false_edge
!= NULL
;
1122 pp_right_paren (pp
);
1124 if (gimple_cond_true_label (gs
))
1126 pp_string (pp
, " goto ");
1127 dump_generic_node (pp
, gimple_cond_true_label (gs
),
1129 if (has_edge_info
&& !(flags
& TDF_GIMPLE
))
1130 dump_edge_probability (pp
, true_edge
);
1133 if (gimple_cond_false_label (gs
))
1135 pp_string (pp
, " else goto ");
1136 dump_generic_node (pp
, gimple_cond_false_label (gs
),
1138 if (has_edge_info
&& !(flags
& TDF_GIMPLE
))
1139 dump_edge_probability (pp
, false_edge
);
1148 /* Dump a GIMPLE_LABEL tuple on the pretty_printer PP, SPC
1149 spaces of indent. FLAGS specifies details to show in the dump (see
1150 TDF_* in dumpfils.h). */
1153 dump_gimple_label (pretty_printer
*pp
, const glabel
*gs
, int spc
,
1156 tree label
= gimple_label_label (gs
);
1157 if (flags
& TDF_RAW
)
1158 dump_gimple_fmt (pp
, spc
, flags
, "%G <%T>", gs
, label
);
1161 dump_generic_node (pp
, label
, spc
, flags
, false);
1164 if (flags
& TDF_GIMPLE
)
1166 if (DECL_NONLOCAL (label
))
1167 pp_string (pp
, " [non-local]");
1168 if ((flags
& TDF_EH
) && EH_LANDING_PAD_NR (label
))
1169 pp_printf (pp
, " [LP %d]", EH_LANDING_PAD_NR (label
));
1172 /* Dump a GIMPLE_GOTO tuple on the pretty_printer PP, SPC
1173 spaces of indent. FLAGS specifies details to show in the dump (see
1174 TDF_* in dumpfile.h). */
1177 dump_gimple_goto (pretty_printer
*pp
, const ggoto
*gs
, int spc
,
1180 tree label
= gimple_goto_dest (gs
);
1181 if (flags
& TDF_RAW
)
1182 dump_gimple_fmt (pp
, spc
, flags
, "%G <%T>", gs
, label
);
1184 dump_gimple_fmt (pp
, spc
, flags
, "goto %T;", label
);
1188 /* Dump a GIMPLE_BIND tuple on the pretty_printer PP, SPC
1189 spaces of indent. FLAGS specifies details to show in the dump (see
1190 TDF_* in dumpfile.h). */
1193 dump_gimple_bind (pretty_printer
*pp
, const gbind
*gs
, int spc
,
1196 if (flags
& TDF_RAW
)
1197 dump_gimple_fmt (pp
, spc
, flags
, "%G <", gs
);
1200 if (!(flags
& TDF_SLIM
))
1204 for (var
= gimple_bind_vars (gs
); var
; var
= DECL_CHAIN (var
))
1206 newline_and_indent (pp
, 2);
1207 print_declaration (pp
, var
, spc
, flags
);
1209 if (gimple_bind_vars (gs
))
1213 dump_gimple_seq (pp
, gimple_bind_body (gs
), spc
+ 2, flags
);
1214 newline_and_indent (pp
, spc
);
1215 if (flags
& TDF_RAW
)
1218 pp_right_brace (pp
);
1222 /* Dump a GIMPLE_TRY tuple on the pretty_printer PP, SPC spaces of
1223 indent. FLAGS specifies details to show in the dump (see TDF_* in
1227 dump_gimple_try (pretty_printer
*pp
, const gtry
*gs
, int spc
,
1230 if (flags
& TDF_RAW
)
1233 if (gimple_try_kind (gs
) == GIMPLE_TRY_CATCH
)
1234 type
= "GIMPLE_TRY_CATCH";
1235 else if (gimple_try_kind (gs
) == GIMPLE_TRY_FINALLY
)
1236 type
= "GIMPLE_TRY_FINALLY";
1238 type
= "UNKNOWN GIMPLE_TRY";
1239 dump_gimple_fmt (pp
, spc
, flags
,
1240 "%G <%s,%+EVAL <%S>%nCLEANUP <%S>%->", gs
, type
,
1241 gimple_try_eval (gs
), gimple_try_cleanup (gs
));
1245 pp_string (pp
, "try");
1246 newline_and_indent (pp
, spc
+ 2);
1250 dump_gimple_seq (pp
, gimple_try_eval (gs
), spc
+ 4, flags
);
1251 newline_and_indent (pp
, spc
+ 2);
1252 pp_right_brace (pp
);
1254 gimple_seq seq
= gimple_try_cleanup (gs
);
1256 if (gimple_try_kind (gs
) == GIMPLE_TRY_CATCH
)
1258 newline_and_indent (pp
, spc
);
1259 pp_string (pp
, "catch");
1260 newline_and_indent (pp
, spc
+ 2);
1263 else if (gimple_try_kind (gs
) == GIMPLE_TRY_FINALLY
)
1265 newline_and_indent (pp
, spc
);
1266 pp_string (pp
, "finally");
1267 newline_and_indent (pp
, spc
+ 2);
1270 if (seq
&& is_a
<geh_else
*> (gimple_seq_first_stmt (seq
))
1271 && gimple_seq_nondebug_singleton_p (seq
))
1273 geh_else
*stmt
= as_a
<geh_else
*> (gimple_seq_first_stmt (seq
));
1274 seq
= gimple_eh_else_n_body (stmt
);
1276 dump_gimple_seq (pp
, seq
, spc
+ 4, flags
);
1277 newline_and_indent (pp
, spc
+ 2);
1278 pp_right_brace (pp
);
1279 seq
= gimple_eh_else_e_body (stmt
);
1280 newline_and_indent (pp
, spc
);
1281 pp_string (pp
, "else");
1282 newline_and_indent (pp
, spc
+ 2);
1287 pp_string (pp
, " <UNKNOWN GIMPLE_TRY> {");
1290 dump_gimple_seq (pp
, seq
, spc
+ 4, flags
);
1291 newline_and_indent (pp
, spc
+ 2);
1292 pp_right_brace (pp
);
1297 /* Dump a GIMPLE_CATCH tuple on the pretty_printer PP, SPC spaces of
1298 indent. FLAGS specifies details to show in the dump (see TDF_* in
1302 dump_gimple_catch (pretty_printer
*pp
, const gcatch
*gs
, int spc
,
1305 if (flags
& TDF_RAW
)
1306 dump_gimple_fmt (pp
, spc
, flags
, "%G <%T, %+CATCH <%S>%->", gs
,
1307 gimple_catch_types (gs
), gimple_catch_handler (gs
));
1309 dump_gimple_fmt (pp
, spc
, flags
, "catch (%T)%+{%S}",
1310 gimple_catch_types (gs
), gimple_catch_handler (gs
));
1314 /* Dump a GIMPLE_EH_FILTER tuple on the pretty_printer PP, SPC spaces of
1315 indent. FLAGS specifies details to show in the dump (see TDF_* in
1319 dump_gimple_eh_filter (pretty_printer
*pp
, const geh_filter
*gs
, int spc
,
1322 if (flags
& TDF_RAW
)
1323 dump_gimple_fmt (pp
, spc
, flags
, "%G <%T, %+FAILURE <%S>%->", gs
,
1324 gimple_eh_filter_types (gs
),
1325 gimple_eh_filter_failure (gs
));
1327 dump_gimple_fmt (pp
, spc
, flags
, "<<<eh_filter (%T)>>>%+{%+%S%-}",
1328 gimple_eh_filter_types (gs
),
1329 gimple_eh_filter_failure (gs
));
1333 /* Dump a GIMPLE_EH_MUST_NOT_THROW tuple. */
1336 dump_gimple_eh_must_not_throw (pretty_printer
*pp
,
1337 const geh_mnt
*gs
, int spc
, dump_flags_t flags
)
1339 if (flags
& TDF_RAW
)
1340 dump_gimple_fmt (pp
, spc
, flags
, "%G <%T>", gs
,
1341 gimple_eh_must_not_throw_fndecl (gs
));
1343 dump_gimple_fmt (pp
, spc
, flags
, "<<<eh_must_not_throw (%T)>>>",
1344 gimple_eh_must_not_throw_fndecl (gs
));
1348 /* Dump a GIMPLE_EH_ELSE tuple on the pretty_printer PP, SPC spaces of
1349 indent. FLAGS specifies details to show in the dump (see TDF_* in
1353 dump_gimple_eh_else (pretty_printer
*pp
, const geh_else
*gs
, int spc
,
1356 if (flags
& TDF_RAW
)
1357 dump_gimple_fmt (pp
, spc
, flags
,
1358 "%G <%+N_BODY <%S>%nE_BODY <%S>%->", gs
,
1359 gimple_eh_else_n_body (gs
), gimple_eh_else_e_body (gs
));
1361 dump_gimple_fmt (pp
, spc
, flags
,
1362 "<<<if_normal_exit>>>%+{%S}%-<<<else_eh_exit>>>%+{%S}",
1363 gimple_eh_else_n_body (gs
), gimple_eh_else_e_body (gs
));
1367 /* Dump a GIMPLE_RESX tuple on the pretty_printer PP, SPC spaces of
1368 indent. FLAGS specifies details to show in the dump (see TDF_* in
1372 dump_gimple_resx (pretty_printer
*pp
, const gresx
*gs
, int spc
,
1375 if (flags
& TDF_RAW
)
1376 dump_gimple_fmt (pp
, spc
, flags
, "%G <%d>", gs
,
1377 gimple_resx_region (gs
));
1379 dump_gimple_fmt (pp
, spc
, flags
, "resx %d", gimple_resx_region (gs
));
1382 /* Dump a GIMPLE_EH_DISPATCH tuple on the pretty_printer PP. */
1385 dump_gimple_eh_dispatch (pretty_printer
*pp
, const geh_dispatch
*gs
,
1386 int spc
, dump_flags_t flags
)
1388 if (flags
& TDF_RAW
)
1389 dump_gimple_fmt (pp
, spc
, flags
, "%G <%d>", gs
,
1390 gimple_eh_dispatch_region (gs
));
1392 dump_gimple_fmt (pp
, spc
, flags
, "eh_dispatch %d",
1393 gimple_eh_dispatch_region (gs
));
1396 /* Dump a GIMPLE_DEBUG tuple on the pretty_printer PP, SPC spaces
1397 of indent. FLAGS specifies details to show in the dump (see TDF_*
1401 dump_gimple_debug (pretty_printer
*pp
, const gdebug
*gs
, int spc
,
1404 switch (gs
->subcode
)
1406 case GIMPLE_DEBUG_BIND
:
1407 if (flags
& TDF_RAW
)
1408 dump_gimple_fmt (pp
, spc
, flags
, "%G BIND <%T, %T>", gs
,
1409 gimple_debug_bind_get_var (gs
),
1410 gimple_debug_bind_get_value (gs
));
1412 dump_gimple_fmt (pp
, spc
, flags
, "# DEBUG %T => %T",
1413 gimple_debug_bind_get_var (gs
),
1414 gimple_debug_bind_get_value (gs
));
1417 case GIMPLE_DEBUG_SOURCE_BIND
:
1418 if (flags
& TDF_RAW
)
1419 dump_gimple_fmt (pp
, spc
, flags
, "%G SRCBIND <%T, %T>", gs
,
1420 gimple_debug_source_bind_get_var (gs
),
1421 gimple_debug_source_bind_get_value (gs
));
1423 dump_gimple_fmt (pp
, spc
, flags
, "# DEBUG %T s=> %T",
1424 gimple_debug_source_bind_get_var (gs
),
1425 gimple_debug_source_bind_get_value (gs
));
1428 case GIMPLE_DEBUG_BEGIN_STMT
:
1429 if (flags
& TDF_RAW
)
1430 dump_gimple_fmt (pp
, spc
, flags
, "%G BEGIN_STMT", gs
);
1432 dump_gimple_fmt (pp
, spc
, flags
, "# DEBUG BEGIN_STMT");
1435 case GIMPLE_DEBUG_INLINE_ENTRY
:
1436 if (flags
& TDF_RAW
)
1437 dump_gimple_fmt (pp
, spc
, flags
, "%G INLINE_ENTRY %T", gs
,
1439 ? block_ultimate_origin (gimple_block (gs
))
1442 dump_gimple_fmt (pp
, spc
, flags
, "# DEBUG INLINE_ENTRY %T",
1444 ? block_ultimate_origin (gimple_block (gs
))
1453 /* Dump a GIMPLE_OMP_FOR tuple on the pretty_printer PP. */
1455 dump_gimple_omp_for (pretty_printer
*pp
, const gomp_for
*gs
, int spc
,
1460 if (flags
& TDF_RAW
)
1463 switch (gimple_omp_for_kind (gs
))
1465 case GF_OMP_FOR_KIND_FOR
:
1468 case GF_OMP_FOR_KIND_DISTRIBUTE
:
1469 kind
= " distribute";
1471 case GF_OMP_FOR_KIND_TASKLOOP
:
1474 case GF_OMP_FOR_KIND_OACC_LOOP
:
1475 kind
= " oacc_loop";
1477 case GF_OMP_FOR_KIND_SIMD
:
1483 dump_gimple_fmt (pp
, spc
, flags
, "%G%s <%+BODY <%S>%nCLAUSES <", gs
,
1484 kind
, gimple_omp_body (gs
));
1485 dump_omp_clauses (pp
, gimple_omp_for_clauses (gs
), spc
, flags
);
1486 dump_gimple_fmt (pp
, spc
, flags
, " >,");
1487 for (i
= 0; i
< gimple_omp_for_collapse (gs
); i
++)
1488 dump_gimple_fmt (pp
, spc
, flags
,
1489 "%+%T, %T, %T, %s, %T,%n",
1490 gimple_omp_for_index (gs
, i
),
1491 gimple_omp_for_initial (gs
, i
),
1492 gimple_omp_for_final (gs
, i
),
1493 get_tree_code_name (gimple_omp_for_cond (gs
, i
)),
1494 gimple_omp_for_incr (gs
, i
));
1495 dump_gimple_fmt (pp
, spc
, flags
, "PRE_BODY <%S>%->",
1496 gimple_omp_for_pre_body (gs
));
1500 switch (gimple_omp_for_kind (gs
))
1502 case GF_OMP_FOR_KIND_FOR
:
1503 pp_string (pp
, "#pragma omp for");
1505 case GF_OMP_FOR_KIND_DISTRIBUTE
:
1506 pp_string (pp
, "#pragma omp distribute");
1508 case GF_OMP_FOR_KIND_TASKLOOP
:
1509 pp_string (pp
, "#pragma omp taskloop");
1511 case GF_OMP_FOR_KIND_OACC_LOOP
:
1512 pp_string (pp
, "#pragma acc loop");
1514 case GF_OMP_FOR_KIND_SIMD
:
1515 pp_string (pp
, "#pragma omp simd");
1520 dump_omp_clauses (pp
, gimple_omp_for_clauses (gs
), spc
, flags
);
1521 for (i
= 0; i
< gimple_omp_for_collapse (gs
); i
++)
1525 newline_and_indent (pp
, spc
);
1526 pp_string (pp
, "for (");
1527 dump_generic_node (pp
, gimple_omp_for_index (gs
, i
), spc
,
1529 pp_string (pp
, " = ");
1530 tree init
= gimple_omp_for_initial (gs
, i
);
1531 if (TREE_CODE (init
) != TREE_VEC
)
1532 dump_generic_node (pp
, init
, spc
, flags
, false);
1534 dump_omp_loop_non_rect_expr (pp
, init
, spc
, flags
);
1535 pp_string (pp
, "; ");
1537 dump_generic_node (pp
, gimple_omp_for_index (gs
, i
), spc
,
1540 switch (gimple_omp_for_cond (gs
, i
))
1552 pp_greater_equal (pp
);
1555 pp_string (pp
, "!=");
1561 tree cond
= gimple_omp_for_final (gs
, i
);
1562 if (TREE_CODE (cond
) != TREE_VEC
)
1563 dump_generic_node (pp
, cond
, spc
, flags
, false);
1565 dump_omp_loop_non_rect_expr (pp
, cond
, spc
, flags
);
1566 pp_string (pp
, "; ");
1568 dump_generic_node (pp
, gimple_omp_for_index (gs
, i
), spc
,
1570 pp_string (pp
, " = ");
1571 dump_generic_node (pp
, gimple_omp_for_incr (gs
, i
), spc
,
1573 pp_right_paren (pp
);
1576 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1578 newline_and_indent (pp
, spc
+ 2);
1581 dump_gimple_seq (pp
, gimple_omp_body (gs
), spc
+ 4, flags
);
1582 newline_and_indent (pp
, spc
+ 2);
1583 pp_right_brace (pp
);
1588 /* Dump a GIMPLE_OMP_CONTINUE tuple on the pretty_printer PP. */
1591 dump_gimple_omp_continue (pretty_printer
*pp
, const gomp_continue
*gs
,
1592 int spc
, dump_flags_t flags
)
1594 if (flags
& TDF_RAW
)
1596 dump_gimple_fmt (pp
, spc
, flags
, "%G <%T, %T>", gs
,
1597 gimple_omp_continue_control_def (gs
),
1598 gimple_omp_continue_control_use (gs
));
1602 pp_string (pp
, "#pragma omp continue (");
1603 dump_generic_node (pp
, gimple_omp_continue_control_def (gs
),
1607 dump_generic_node (pp
, gimple_omp_continue_control_use (gs
),
1609 pp_right_paren (pp
);
1613 /* Dump a GIMPLE_OMP_SINGLE tuple on the pretty_printer PP. */
1616 dump_gimple_omp_single (pretty_printer
*pp
, const gomp_single
*gs
,
1617 int spc
, dump_flags_t flags
)
1619 if (flags
& TDF_RAW
)
1621 dump_gimple_fmt (pp
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1622 gimple_omp_body (gs
));
1623 dump_omp_clauses (pp
, gimple_omp_single_clauses (gs
), spc
, flags
);
1624 dump_gimple_fmt (pp
, spc
, flags
, " >");
1628 pp_string (pp
, "#pragma omp single");
1629 dump_omp_clauses (pp
, gimple_omp_single_clauses (gs
), spc
, flags
);
1630 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1632 newline_and_indent (pp
, spc
+ 2);
1635 dump_gimple_seq (pp
, gimple_omp_body (gs
), spc
+ 4, flags
);
1636 newline_and_indent (pp
, spc
+ 2);
1637 pp_right_brace (pp
);
1642 /* Dump a GIMPLE_OMP_TASKGROUP tuple on the pretty_printer PP. */
1645 dump_gimple_omp_taskgroup (pretty_printer
*pp
, const gimple
*gs
,
1646 int spc
, dump_flags_t flags
)
1648 if (flags
& TDF_RAW
)
1650 dump_gimple_fmt (pp
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1651 gimple_omp_body (gs
));
1652 dump_omp_clauses (pp
, gimple_omp_taskgroup_clauses (gs
), spc
, flags
);
1653 dump_gimple_fmt (pp
, spc
, flags
, " >");
1657 pp_string (pp
, "#pragma omp taskgroup");
1658 dump_omp_clauses (pp
, gimple_omp_taskgroup_clauses (gs
), spc
, flags
);
1659 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1661 newline_and_indent (pp
, spc
+ 2);
1664 dump_gimple_seq (pp
, gimple_omp_body (gs
), spc
+ 4, flags
);
1665 newline_and_indent (pp
, spc
+ 2);
1666 pp_right_brace (pp
);
1671 /* Dump a GIMPLE_OMP_MASKED tuple on the pretty_printer PP. */
1674 dump_gimple_omp_masked (pretty_printer
*pp
, const gimple
*gs
,
1675 int spc
, dump_flags_t flags
)
1677 if (flags
& TDF_RAW
)
1679 dump_gimple_fmt (pp
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1680 gimple_omp_body (gs
));
1681 dump_omp_clauses (pp
, gimple_omp_masked_clauses (gs
), spc
, flags
);
1682 dump_gimple_fmt (pp
, spc
, flags
, " >");
1686 pp_string (pp
, "#pragma omp masked");
1687 dump_omp_clauses (pp
, gimple_omp_masked_clauses (gs
), spc
, flags
);
1688 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1690 newline_and_indent (pp
, spc
+ 2);
1693 dump_gimple_seq (pp
, gimple_omp_body (gs
), spc
+ 4, flags
);
1694 newline_and_indent (pp
, spc
+ 2);
1695 pp_right_brace (pp
);
1700 /* Dump a GIMPLE_OMP_SCOPE tuple on the pretty_printer PP. */
1703 dump_gimple_omp_scope (pretty_printer
*pp
, const gimple
*gs
,
1704 int spc
, dump_flags_t flags
)
1706 if (flags
& TDF_RAW
)
1708 dump_gimple_fmt (pp
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1709 gimple_omp_body (gs
));
1710 dump_omp_clauses (pp
, gimple_omp_scope_clauses (gs
), spc
, flags
);
1711 dump_gimple_fmt (pp
, spc
, flags
, " >");
1715 pp_string (pp
, "#pragma omp scope");
1716 dump_omp_clauses (pp
, gimple_omp_scope_clauses (gs
), spc
, flags
);
1717 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1719 newline_and_indent (pp
, spc
+ 2);
1722 dump_gimple_seq (pp
, gimple_omp_body (gs
), spc
+ 4, flags
);
1723 newline_and_indent (pp
, spc
+ 2);
1724 pp_right_brace (pp
);
1729 /* Dump a GIMPLE_OMP_TARGET tuple on the pretty_printer PP. */
1732 dump_gimple_omp_target (pretty_printer
*pp
, const gomp_target
*gs
,
1733 int spc
, dump_flags_t flags
)
1736 switch (gimple_omp_target_kind (gs
))
1738 case GF_OMP_TARGET_KIND_REGION
:
1741 case GF_OMP_TARGET_KIND_DATA
:
1744 case GF_OMP_TARGET_KIND_UPDATE
:
1747 case GF_OMP_TARGET_KIND_ENTER_DATA
:
1748 kind
= " enter data";
1750 case GF_OMP_TARGET_KIND_EXIT_DATA
:
1751 kind
= " exit data";
1753 case GF_OMP_TARGET_KIND_OACC_KERNELS
:
1754 kind
= " oacc_kernels";
1756 case GF_OMP_TARGET_KIND_OACC_PARALLEL
:
1757 kind
= " oacc_parallel";
1759 case GF_OMP_TARGET_KIND_OACC_SERIAL
:
1760 kind
= " oacc_serial";
1762 case GF_OMP_TARGET_KIND_OACC_DATA
:
1763 kind
= " oacc_data";
1765 case GF_OMP_TARGET_KIND_OACC_UPDATE
:
1766 kind
= " oacc_update";
1768 case GF_OMP_TARGET_KIND_OACC_ENTER_DATA
:
1769 kind
= " oacc_enter_data";
1771 case GF_OMP_TARGET_KIND_OACC_EXIT_DATA
:
1772 kind
= " oacc_exit_data";
1774 case GF_OMP_TARGET_KIND_OACC_DECLARE
:
1775 kind
= " oacc_declare";
1777 case GF_OMP_TARGET_KIND_OACC_HOST_DATA
:
1778 kind
= " oacc_host_data";
1780 case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED
:
1781 kind
= " oacc_parallel_kernels_parallelized";
1783 case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE
:
1784 kind
= " oacc_parallel_kernels_gang_single";
1786 case GF_OMP_TARGET_KIND_OACC_DATA_KERNELS
:
1787 kind
= " oacc_data_kernels";
1792 if (flags
& TDF_RAW
)
1794 dump_gimple_fmt (pp
, spc
, flags
, "%G%s <%+BODY <%S>%nCLAUSES <", gs
,
1795 kind
, gimple_omp_body (gs
));
1796 dump_omp_clauses (pp
, gimple_omp_target_clauses (gs
), spc
, flags
);
1797 dump_gimple_fmt (pp
, spc
, flags
, " >, %T, %T%n>",
1798 gimple_omp_target_child_fn (gs
),
1799 gimple_omp_target_data_arg (gs
));
1803 pp_string (pp
, "#pragma omp target");
1804 pp_string (pp
, kind
);
1805 dump_omp_clauses (pp
, gimple_omp_target_clauses (gs
), spc
, flags
);
1806 if (gimple_omp_target_child_fn (gs
))
1808 pp_string (pp
, " [child fn: ");
1809 dump_generic_node (pp
, gimple_omp_target_child_fn (gs
),
1811 pp_string (pp
, " (");
1812 if (gimple_omp_target_data_arg (gs
))
1813 dump_generic_node (pp
, gimple_omp_target_data_arg (gs
),
1816 pp_string (pp
, "???");
1817 pp_string (pp
, ")]");
1819 gimple_seq body
= gimple_omp_body (gs
);
1820 if (body
&& gimple_code (gimple_seq_first_stmt (body
)) != GIMPLE_BIND
)
1822 newline_and_indent (pp
, spc
+ 2);
1825 dump_gimple_seq (pp
, body
, spc
+ 4, flags
);
1826 newline_and_indent (pp
, spc
+ 2);
1827 pp_right_brace (pp
);
1832 dump_gimple_seq (pp
, body
, spc
+ 2, flags
);
1837 /* Dump a GIMPLE_OMP_TEAMS tuple on the pretty_printer PP. */
1840 dump_gimple_omp_teams (pretty_printer
*pp
, const gomp_teams
*gs
, int spc
,
1843 if (flags
& TDF_RAW
)
1845 dump_gimple_fmt (pp
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1846 gimple_omp_body (gs
));
1847 dump_omp_clauses (pp
, gimple_omp_teams_clauses (gs
), spc
, flags
);
1848 dump_gimple_fmt (pp
, spc
, flags
, " >");
1852 pp_string (pp
, "#pragma omp teams");
1853 dump_omp_clauses (pp
, gimple_omp_teams_clauses (gs
), spc
, flags
);
1854 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1856 newline_and_indent (pp
, spc
+ 2);
1857 pp_character (pp
, '{');
1859 dump_gimple_seq (pp
, gimple_omp_body (gs
), spc
+ 4, flags
);
1860 newline_and_indent (pp
, spc
+ 2);
1861 pp_character (pp
, '}');
1866 /* Dump a GIMPLE_OMP_SECTIONS tuple on the pretty_printer PP. */
1869 dump_gimple_omp_sections (pretty_printer
*pp
, const gomp_sections
*gs
,
1870 int spc
, dump_flags_t flags
)
1872 if (flags
& TDF_RAW
)
1874 dump_gimple_fmt (pp
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1875 gimple_omp_body (gs
));
1876 dump_omp_clauses (pp
, gimple_omp_sections_clauses (gs
), spc
, flags
);
1877 dump_gimple_fmt (pp
, spc
, flags
, " >");
1881 pp_string (pp
, "#pragma omp sections");
1882 if (gimple_omp_sections_control (gs
))
1884 pp_string (pp
, " <");
1885 dump_generic_node (pp
, gimple_omp_sections_control (gs
), spc
,
1889 dump_omp_clauses (pp
, gimple_omp_sections_clauses (gs
), spc
, flags
);
1890 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1892 newline_and_indent (pp
, spc
+ 2);
1895 dump_gimple_seq (pp
, gimple_omp_body (gs
), spc
+ 4, flags
);
1896 newline_and_indent (pp
, spc
+ 2);
1897 pp_right_brace (pp
);
1902 /* Dump a GIMPLE_OMP_{MASTER,ORDERED,SECTION,STRUCTURED_BLOCK} tuple on the
1903 pretty_printer PP. */
1906 dump_gimple_omp_block (pretty_printer
*pp
, const gimple
*gs
, int spc
,
1909 if (flags
& TDF_RAW
)
1910 dump_gimple_fmt (pp
, spc
, flags
, "%G <%+BODY <%S> >", gs
,
1911 gimple_omp_body (gs
));
1914 switch (gimple_code (gs
))
1916 case GIMPLE_OMP_MASTER
:
1917 pp_string (pp
, "#pragma omp master");
1919 case GIMPLE_OMP_SECTION
:
1920 pp_string (pp
, "#pragma omp section");
1922 case GIMPLE_OMP_STRUCTURED_BLOCK
:
1923 pp_string (pp
, "#pragma omp __structured_block");
1928 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1930 newline_and_indent (pp
, spc
+ 2);
1933 dump_gimple_seq (pp
, gimple_omp_body (gs
), spc
+ 4, flags
);
1934 newline_and_indent (pp
, spc
+ 2);
1935 pp_right_brace (pp
);
1940 /* Dump a GIMPLE_OMP_CRITICAL tuple on the pretty_printer PP. */
1943 dump_gimple_omp_critical (pretty_printer
*pp
, const gomp_critical
*gs
,
1944 int spc
, dump_flags_t flags
)
1946 if (flags
& TDF_RAW
)
1947 dump_gimple_fmt (pp
, spc
, flags
, "%G <%+BODY <%S> >", gs
,
1948 gimple_omp_body (gs
));
1951 pp_string (pp
, "#pragma omp critical");
1952 if (gimple_omp_critical_name (gs
))
1954 pp_string (pp
, " (");
1955 dump_generic_node (pp
, gimple_omp_critical_name (gs
), spc
,
1957 pp_right_paren (pp
);
1959 dump_omp_clauses (pp
, gimple_omp_critical_clauses (gs
), spc
, flags
);
1960 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1962 newline_and_indent (pp
, spc
+ 2);
1965 dump_gimple_seq (pp
, gimple_omp_body (gs
), spc
+ 4, flags
);
1966 newline_and_indent (pp
, spc
+ 2);
1967 pp_right_brace (pp
);
1972 /* Dump a GIMPLE_OMP_ORDERED tuple on the pretty_printer PP. */
1975 dump_gimple_omp_ordered (pretty_printer
*pp
, const gomp_ordered
*gs
,
1976 int spc
, dump_flags_t flags
)
1978 if (flags
& TDF_RAW
)
1979 dump_gimple_fmt (pp
, spc
, flags
, "%G <%+BODY <%S> >", gs
,
1980 gimple_omp_body (gs
));
1983 pp_string (pp
, "#pragma omp ordered");
1984 dump_omp_clauses (pp
, gimple_omp_ordered_clauses (gs
), spc
, flags
);
1985 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1987 newline_and_indent (pp
, spc
+ 2);
1990 dump_gimple_seq (pp
, gimple_omp_body (gs
), spc
+ 4, flags
);
1991 newline_and_indent (pp
, spc
+ 2);
1992 pp_right_brace (pp
);
1997 /* Dump a GIMPLE_OMP_SCAN tuple on the pretty_printer PP. */
2000 dump_gimple_omp_scan (pretty_printer
*pp
, const gomp_scan
*gs
,
2001 int spc
, dump_flags_t flags
)
2003 if (flags
& TDF_RAW
)
2004 dump_gimple_fmt (pp
, spc
, flags
, "%G <%+BODY <%S> >", gs
,
2005 gimple_omp_body (gs
));
2008 if (gimple_omp_scan_clauses (gs
))
2010 pp_string (pp
, "#pragma omp scan");
2011 dump_omp_clauses (pp
, gimple_omp_scan_clauses (gs
), spc
, flags
);
2013 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
2015 newline_and_indent (pp
, spc
+ 2);
2018 dump_gimple_seq (pp
, gimple_omp_body (gs
), spc
+ 4, flags
);
2019 newline_and_indent (pp
, spc
+ 2);
2020 pp_right_brace (pp
);
2025 /* Dump a GIMPLE_OMP_RETURN tuple on the pretty_printer PP. */
2028 dump_gimple_omp_return (pretty_printer
*pp
, const gimple
*gs
, int spc
,
2031 if (flags
& TDF_RAW
)
2033 dump_gimple_fmt (pp
, spc
, flags
, "%G <nowait=%d", gs
,
2034 (int) gimple_omp_return_nowait_p (gs
));
2035 if (gimple_omp_return_lhs (gs
))
2036 dump_gimple_fmt (pp
, spc
, flags
, ", lhs=%T>",
2037 gimple_omp_return_lhs (gs
));
2039 dump_gimple_fmt (pp
, spc
, flags
, ">");
2043 pp_string (pp
, "#pragma omp return");
2044 if (gimple_omp_return_nowait_p (gs
))
2045 pp_string (pp
, "(nowait)");
2046 if (gimple_omp_return_lhs (gs
))
2048 pp_string (pp
, " (set ");
2049 dump_generic_node (pp
, gimple_omp_return_lhs (gs
),
2051 pp_character (pp
, ')');
2056 /* Dump a GIMPLE_ASSUME tuple on the pretty_printer PP. */
2059 dump_gimple_assume (pretty_printer
*pp
, const gimple
*gs
,
2060 int spc
, dump_flags_t flags
)
2062 if (flags
& TDF_RAW
)
2063 dump_gimple_fmt (pp
, spc
, flags
,
2064 "%G [GUARD=%T] <%+BODY <%S> >",
2065 gs
, gimple_assume_guard (gs
),
2066 gimple_assume_body (gs
));
2069 pp_string (pp
, "[[assume (");
2070 dump_generic_node (pp
, gimple_assume_guard (gs
), spc
, flags
, false);
2071 pp_string (pp
, ")]]");
2072 newline_and_indent (pp
, spc
+ 2);
2075 dump_gimple_seq (pp
, gimple_assume_body (gs
), spc
+ 4, flags
);
2076 newline_and_indent (pp
, spc
+ 2);
2077 pp_right_brace (pp
);
2081 /* Dump a GIMPLE_TRANSACTION tuple on the pretty_printer PP. */
2084 dump_gimple_transaction (pretty_printer
*pp
, const gtransaction
*gs
,
2085 int spc
, dump_flags_t flags
)
2087 unsigned subcode
= gimple_transaction_subcode (gs
);
2089 if (flags
& TDF_RAW
)
2091 dump_gimple_fmt (pp
, spc
, flags
,
2092 "%G [SUBCODE=%x,NORM=%T,UNINST=%T,OVER=%T] "
2094 gs
, subcode
, gimple_transaction_label_norm (gs
),
2095 gimple_transaction_label_uninst (gs
),
2096 gimple_transaction_label_over (gs
),
2097 gimple_transaction_body (gs
));
2101 if (subcode
& GTMA_IS_OUTER
)
2102 pp_string (pp
, "__transaction_atomic [[outer]]");
2103 else if (subcode
& GTMA_IS_RELAXED
)
2104 pp_string (pp
, "__transaction_relaxed");
2106 pp_string (pp
, "__transaction_atomic");
2107 subcode
&= ~GTMA_DECLARATION_MASK
;
2109 if (gimple_transaction_body (gs
))
2111 newline_and_indent (pp
, spc
+ 2);
2114 dump_gimple_seq (pp
, gimple_transaction_body (gs
),
2116 newline_and_indent (pp
, spc
+ 2);
2117 pp_right_brace (pp
);
2121 pp_string (pp
, " //");
2122 if (gimple_transaction_label_norm (gs
))
2124 pp_string (pp
, " NORM=");
2125 dump_generic_node (pp
, gimple_transaction_label_norm (gs
),
2128 if (gimple_transaction_label_uninst (gs
))
2130 pp_string (pp
, " UNINST=");
2131 dump_generic_node (pp
, gimple_transaction_label_uninst (gs
),
2134 if (gimple_transaction_label_over (gs
))
2136 pp_string (pp
, " OVER=");
2137 dump_generic_node (pp
, gimple_transaction_label_over (gs
),
2142 pp_string (pp
, " SUBCODE=[ ");
2143 if (subcode
& GTMA_HAVE_ABORT
)
2145 pp_string (pp
, "GTMA_HAVE_ABORT ");
2146 subcode
&= ~GTMA_HAVE_ABORT
;
2148 if (subcode
& GTMA_HAVE_LOAD
)
2150 pp_string (pp
, "GTMA_HAVE_LOAD ");
2151 subcode
&= ~GTMA_HAVE_LOAD
;
2153 if (subcode
& GTMA_HAVE_STORE
)
2155 pp_string (pp
, "GTMA_HAVE_STORE ");
2156 subcode
&= ~GTMA_HAVE_STORE
;
2158 if (subcode
& GTMA_MAY_ENTER_IRREVOCABLE
)
2160 pp_string (pp
, "GTMA_MAY_ENTER_IRREVOCABLE ");
2161 subcode
&= ~GTMA_MAY_ENTER_IRREVOCABLE
;
2163 if (subcode
& GTMA_DOES_GO_IRREVOCABLE
)
2165 pp_string (pp
, "GTMA_DOES_GO_IRREVOCABLE ");
2166 subcode
&= ~GTMA_DOES_GO_IRREVOCABLE
;
2168 if (subcode
& GTMA_HAS_NO_INSTRUMENTATION
)
2170 pp_string (pp
, "GTMA_HAS_NO_INSTRUMENTATION ");
2171 subcode
&= ~GTMA_HAS_NO_INSTRUMENTATION
;
2174 pp_printf (pp
, "0x%x ", subcode
);
2175 pp_right_bracket (pp
);
2181 /* Dump a GIMPLE_ASM tuple on the pretty_printer PP, SPC spaces of
2182 indent. FLAGS specifies details to show in the dump (see TDF_* in
2186 dump_gimple_asm (pretty_printer
*pp
, const gasm
*gs
, int spc
,
2189 unsigned int i
, n
, f
, fields
;
2191 if (flags
& TDF_RAW
)
2193 dump_gimple_fmt (pp
, spc
, flags
, "%G <%+STRING <%n%s%n>", gs
,
2194 gimple_asm_string (gs
));
2196 n
= gimple_asm_noutputs (gs
);
2199 newline_and_indent (pp
, spc
+ 2);
2200 pp_string (pp
, "OUTPUT: ");
2201 for (i
= 0; i
< n
; i
++)
2203 dump_generic_node (pp
, gimple_asm_output_op (gs
, i
),
2206 pp_string (pp
, ", ");
2210 n
= gimple_asm_ninputs (gs
);
2213 newline_and_indent (pp
, spc
+ 2);
2214 pp_string (pp
, "INPUT: ");
2215 for (i
= 0; i
< n
; i
++)
2217 dump_generic_node (pp
, gimple_asm_input_op (gs
, i
),
2220 pp_string (pp
, ", ");
2224 n
= gimple_asm_nclobbers (gs
);
2227 newline_and_indent (pp
, spc
+ 2);
2228 pp_string (pp
, "CLOBBER: ");
2229 for (i
= 0; i
< n
; i
++)
2231 dump_generic_node (pp
, gimple_asm_clobber_op (gs
, i
),
2234 pp_string (pp
, ", ");
2238 n
= gimple_asm_nlabels (gs
);
2241 newline_and_indent (pp
, spc
+ 2);
2242 pp_string (pp
, "LABEL: ");
2243 for (i
= 0; i
< n
; i
++)
2245 dump_generic_node (pp
, gimple_asm_label_op (gs
, i
),
2248 pp_string (pp
, ", ");
2252 newline_and_indent (pp
, spc
);
2257 pp_string (pp
, "__asm__");
2258 if (gimple_asm_volatile_p (gs
))
2259 pp_string (pp
, " __volatile__");
2260 if (gimple_asm_inline_p (gs
))
2261 pp_string (pp
, " __inline__");
2262 if (gimple_asm_nlabels (gs
))
2263 pp_string (pp
, " goto");
2264 pp_string (pp
, "(\"");
2265 pp_string (pp
, gimple_asm_string (gs
));
2266 pp_string (pp
, "\"");
2268 if (gimple_asm_nlabels (gs
))
2270 else if (gimple_asm_nclobbers (gs
))
2272 else if (gimple_asm_ninputs (gs
))
2274 else if (gimple_asm_noutputs (gs
))
2279 for (f
= 0; f
< fields
; ++f
)
2281 pp_string (pp
, " : ");
2286 n
= gimple_asm_noutputs (gs
);
2287 for (i
= 0; i
< n
; i
++)
2289 dump_generic_node (pp
, gimple_asm_output_op (gs
, i
),
2292 pp_string (pp
, ", ");
2297 n
= gimple_asm_ninputs (gs
);
2298 for (i
= 0; i
< n
; i
++)
2300 dump_generic_node (pp
, gimple_asm_input_op (gs
, i
),
2303 pp_string (pp
, ", ");
2308 n
= gimple_asm_nclobbers (gs
);
2309 for (i
= 0; i
< n
; i
++)
2311 dump_generic_node (pp
, gimple_asm_clobber_op (gs
, i
),
2314 pp_string (pp
, ", ");
2319 n
= gimple_asm_nlabels (gs
);
2320 for (i
= 0; i
< n
; i
++)
2322 dump_generic_node (pp
, gimple_asm_label_op (gs
, i
),
2325 pp_string (pp
, ", ");
2334 pp_string (pp
, ");");
2338 /* Dump ptr_info and range_info for NODE on pretty_printer PP with
2339 SPC spaces of indent. */
2342 dump_ssaname_info (pretty_printer
*pp
, tree node
, int spc
)
2344 if (TREE_CODE (node
) != SSA_NAME
)
2347 if (POINTER_TYPE_P (TREE_TYPE (node
))
2348 && SSA_NAME_PTR_INFO (node
))
2350 unsigned int align
, misalign
;
2351 struct ptr_info_def
*pi
= SSA_NAME_PTR_INFO (node
);
2352 pp_string (pp
, "# PT = ");
2353 pp_points_to_solution (pp
, &pi
->pt
);
2354 newline_and_indent (pp
, spc
);
2355 if (get_ptr_info_alignment (pi
, &align
, &misalign
))
2357 pp_printf (pp
, "# ALIGN = %u, MISALIGN = %u", align
, misalign
);
2358 newline_and_indent (pp
, spc
);
2362 if (!POINTER_TYPE_P (TREE_TYPE (node
))
2363 && SSA_NAME_RANGE_INFO (node
))
2365 value_range
r (TREE_TYPE (node
));
2366 get_global_range_query ()->range_of_expr (r
, node
);
2367 pp_string (pp
, "# RANGE ");
2369 newline_and_indent (pp
, spc
);
2373 /* As dump_ssaname_info, but dump to FILE. */
2376 dump_ssaname_info_to_file (FILE *file
, tree node
, int spc
)
2379 pp_needs_newline (&pp
) = true;
2380 pp
.set_output_stream (file
);
2381 dump_ssaname_info (&pp
, node
, spc
);
2385 /* Dump a PHI node PHI. PP, SPC and FLAGS are as in pp_gimple_stmt_1.
2386 The caller is responsible for calling pp_flush on PP to finalize
2387 pretty printer. If COMMENT is true, print this after #. */
2390 dump_gimple_phi (pretty_printer
*pp
, const gphi
*phi
, int spc
, bool comment
,
2394 tree lhs
= gimple_phi_result (phi
);
2396 if (flags
& TDF_ALIAS
)
2397 dump_ssaname_info (pp
, lhs
, spc
);
2400 pp_string (pp
, "# ");
2402 if (flags
& TDF_RAW
)
2403 dump_gimple_fmt (pp
, spc
, flags
, "%G <%T, ", phi
,
2404 gimple_phi_result (phi
));
2407 dump_generic_node (pp
, lhs
, spc
, flags
, false);
2408 if (flags
& TDF_GIMPLE
)
2409 pp_string (pp
, " = __PHI (");
2411 pp_string (pp
, " = PHI <");
2413 for (i
= 0; i
< gimple_phi_num_args (phi
); i
++)
2415 if ((flags
& TDF_LINENO
) && gimple_phi_arg_has_location (phi
, i
))
2416 dump_location (pp
, gimple_phi_arg_location (phi
, i
));
2417 basic_block src
= gimple_phi_arg_edge (phi
, i
)->src
;
2418 if (flags
& TDF_GIMPLE
)
2420 pp_string (pp
, "__BB");
2421 pp_decimal_int (pp
, src
->index
);
2422 pp_string (pp
, ": ");
2424 dump_generic_node (pp
, gimple_phi_arg_def (phi
, i
), spc
, flags
,
2426 if (! (flags
& TDF_GIMPLE
))
2429 pp_decimal_int (pp
, src
->index
);
2430 pp_right_paren (pp
);
2432 if (i
< gimple_phi_num_args (phi
) - 1)
2433 pp_string (pp
, ", ");
2435 if (flags
& TDF_GIMPLE
)
2436 pp_string (pp
, ");");
2442 /* Dump a GIMPLE_OMP_PARALLEL tuple on the pretty_printer PP, SPC spaces
2443 of indent. FLAGS specifies details to show in the dump (see TDF_* in
2447 dump_gimple_omp_parallel (pretty_printer
*pp
, const gomp_parallel
*gs
,
2448 int spc
, dump_flags_t flags
)
2450 if (flags
& TDF_RAW
)
2452 dump_gimple_fmt (pp
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
2453 gimple_omp_body (gs
));
2454 dump_omp_clauses (pp
, gimple_omp_parallel_clauses (gs
), spc
, flags
);
2455 dump_gimple_fmt (pp
, spc
, flags
, " >, %T, %T%n>",
2456 gimple_omp_parallel_child_fn (gs
),
2457 gimple_omp_parallel_data_arg (gs
));
2462 pp_string (pp
, "#pragma omp parallel");
2463 dump_omp_clauses (pp
, gimple_omp_parallel_clauses (gs
), spc
, flags
);
2464 if (gimple_omp_parallel_child_fn (gs
))
2466 pp_string (pp
, " [child fn: ");
2467 dump_generic_node (pp
, gimple_omp_parallel_child_fn (gs
),
2469 pp_string (pp
, " (");
2470 if (gimple_omp_parallel_data_arg (gs
))
2471 dump_generic_node (pp
, gimple_omp_parallel_data_arg (gs
),
2474 pp_string (pp
, "???");
2475 pp_string (pp
, ")]");
2477 body
= gimple_omp_body (gs
);
2478 if (body
&& gimple_code (gimple_seq_first_stmt (body
)) != GIMPLE_BIND
)
2480 newline_and_indent (pp
, spc
+ 2);
2483 dump_gimple_seq (pp
, body
, spc
+ 4, flags
);
2484 newline_and_indent (pp
, spc
+ 2);
2485 pp_right_brace (pp
);
2490 dump_gimple_seq (pp
, body
, spc
+ 2, flags
);
2496 /* Dump a GIMPLE_OMP_TASK tuple on the pretty_printer PP, SPC spaces
2497 of indent. FLAGS specifies details to show in the dump (see TDF_* in
2501 dump_gimple_omp_task (pretty_printer
*pp
, const gomp_task
*gs
, int spc
,
2504 if (flags
& TDF_RAW
)
2506 dump_gimple_fmt (pp
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
2507 gimple_omp_body (gs
));
2508 dump_omp_clauses (pp
, gimple_omp_task_clauses (gs
), spc
, flags
);
2509 dump_gimple_fmt (pp
, spc
, flags
, " >, %T, %T, %T, %T, %T%n>",
2510 gimple_omp_task_child_fn (gs
),
2511 gimple_omp_task_data_arg (gs
),
2512 gimple_omp_task_copy_fn (gs
),
2513 gimple_omp_task_arg_size (gs
),
2514 gimple_omp_task_arg_size (gs
));
2519 if (gimple_omp_task_taskloop_p (gs
))
2520 pp_string (pp
, "#pragma omp taskloop");
2521 else if (gimple_omp_task_taskwait_p (gs
))
2522 pp_string (pp
, "#pragma omp taskwait");
2524 pp_string (pp
, "#pragma omp task");
2525 dump_omp_clauses (pp
, gimple_omp_task_clauses (gs
), spc
, flags
);
2526 if (gimple_omp_task_child_fn (gs
))
2528 pp_string (pp
, " [child fn: ");
2529 dump_generic_node (pp
, gimple_omp_task_child_fn (gs
),
2531 pp_string (pp
, " (");
2532 if (gimple_omp_task_data_arg (gs
))
2533 dump_generic_node (pp
, gimple_omp_task_data_arg (gs
),
2536 pp_string (pp
, "???");
2537 pp_string (pp
, ")]");
2539 body
= gimple_omp_body (gs
);
2540 if (body
&& gimple_code (gimple_seq_first_stmt (body
)) != GIMPLE_BIND
)
2542 newline_and_indent (pp
, spc
+ 2);
2545 dump_gimple_seq (pp
, body
, spc
+ 4, flags
);
2546 newline_and_indent (pp
, spc
+ 2);
2547 pp_right_brace (pp
);
2552 dump_gimple_seq (pp
, body
, spc
+ 2, flags
);
2558 /* Dump a GIMPLE_OMP_ATOMIC_LOAD tuple on the pretty_printer PP, SPC
2559 spaces of indent. FLAGS specifies details to show in the dump (see TDF_*
2563 dump_gimple_omp_atomic_load (pretty_printer
*pp
, const gomp_atomic_load
*gs
,
2564 int spc
, dump_flags_t flags
)
2566 if (flags
& TDF_RAW
)
2568 dump_gimple_fmt (pp
, spc
, flags
, "%G <%T, %T>", gs
,
2569 gimple_omp_atomic_load_lhs (gs
),
2570 gimple_omp_atomic_load_rhs (gs
));
2574 pp_string (pp
, "#pragma omp atomic_load");
2575 dump_omp_atomic_memory_order (pp
,
2576 gimple_omp_atomic_memory_order (gs
));
2577 if (gimple_omp_atomic_need_value_p (gs
))
2578 pp_string (pp
, " [needed]");
2579 if (gimple_omp_atomic_weak_p (gs
))
2580 pp_string (pp
, " [weak]");
2581 newline_and_indent (pp
, spc
+ 2);
2582 dump_generic_node (pp
, gimple_omp_atomic_load_lhs (gs
),
2588 dump_generic_node (pp
, gimple_omp_atomic_load_rhs (gs
),
2593 /* Dump a GIMPLE_OMP_ATOMIC_STORE tuple on the pretty_printer PP, SPC
2594 spaces of indent. FLAGS specifies details to show in the dump (see TDF_*
2598 dump_gimple_omp_atomic_store (pretty_printer
*pp
,
2599 const gomp_atomic_store
*gs
, int spc
,
2602 if (flags
& TDF_RAW
)
2604 dump_gimple_fmt (pp
, spc
, flags
, "%G <%T>", gs
,
2605 gimple_omp_atomic_store_val (gs
));
2609 pp_string (pp
, "#pragma omp atomic_store");
2610 dump_omp_atomic_memory_order (pp
,
2611 gimple_omp_atomic_memory_order (gs
));
2613 if (gimple_omp_atomic_need_value_p (gs
))
2614 pp_string (pp
, "[needed] ");
2615 if (gimple_omp_atomic_weak_p (gs
))
2616 pp_string (pp
, "[weak] ");
2618 dump_generic_node (pp
, gimple_omp_atomic_store_val (gs
),
2620 pp_right_paren (pp
);
2625 /* Dump all the memory operands for statement GS. PP, SPC and
2626 FLAGS are as in pp_gimple_stmt_1. */
2629 dump_gimple_mem_ops (pretty_printer
*pp
, const gimple
*gs
, int spc
,
2632 tree vdef
= gimple_vdef (gs
);
2633 tree vuse
= gimple_vuse (gs
);
2635 if (vdef
!= NULL_TREE
)
2637 pp_string (pp
, "# ");
2638 dump_generic_node (pp
, vdef
, spc
+ 2, flags
, false);
2639 pp_string (pp
, " = VDEF <");
2640 dump_generic_node (pp
, vuse
, spc
+ 2, flags
, false);
2642 newline_and_indent (pp
, spc
);
2644 else if (vuse
!= NULL_TREE
)
2646 pp_string (pp
, "# VUSE <");
2647 dump_generic_node (pp
, vuse
, spc
+ 2, flags
, false);
2649 newline_and_indent (pp
, spc
);
2654 /* Print the gimple statement GS on the pretty printer PP, SPC
2655 spaces of indent. FLAGS specifies details to show in the dump (see
2656 TDF_* in dumpfile.h). The caller is responsible for calling
2657 pp_flush on PP to finalize the pretty printer. */
2660 pp_gimple_stmt_1 (pretty_printer
*pp
, const gimple
*gs
, int spc
,
2666 if (flags
& TDF_STMTADDR
)
2667 pp_printf (pp
, "<&%p> ", (const void *) gs
);
2669 if ((flags
& TDF_LINENO
) && gimple_has_location (gs
))
2670 dump_location (pp
, gimple_location (gs
));
2674 int lp_nr
= lookup_stmt_eh_lp (gs
);
2676 pp_printf (pp
, "[LP %d] ", lp_nr
);
2678 pp_printf (pp
, "[MNT %d] ", -lp_nr
);
2681 if ((flags
& (TDF_VOPS
|TDF_MEMSYMS
))
2682 && gimple_has_mem_ops (gs
))
2683 dump_gimple_mem_ops (pp
, gs
, spc
, flags
);
2685 if (gimple_has_lhs (gs
)
2686 && (flags
& TDF_ALIAS
))
2687 dump_ssaname_info (pp
, gimple_get_lhs (gs
), spc
);
2689 switch (gimple_code (gs
))
2692 dump_gimple_asm (pp
, as_a
<const gasm
*> (gs
), spc
, flags
);
2696 dump_gimple_assign (pp
, as_a
<const gassign
*> (gs
), spc
, flags
);
2700 dump_gimple_bind (pp
, as_a
<const gbind
*> (gs
), spc
, flags
);
2704 dump_gimple_call (pp
, as_a
<const gcall
*> (gs
), spc
, flags
);
2708 dump_gimple_cond (pp
, as_a
<const gcond
*> (gs
), spc
, flags
);
2712 dump_gimple_label (pp
, as_a
<const glabel
*> (gs
), spc
, flags
);
2716 dump_gimple_goto (pp
, as_a
<const ggoto
*> (gs
), spc
, flags
);
2720 pp_string (pp
, "GIMPLE_NOP");
2724 dump_gimple_return (pp
, as_a
<const greturn
*> (gs
), spc
, flags
);
2728 dump_gimple_switch (pp
, as_a
<const gswitch
*> (gs
), spc
, flags
);
2732 dump_gimple_try (pp
, as_a
<const gtry
*> (gs
), spc
, flags
);
2736 dump_gimple_phi (pp
, as_a
<const gphi
*> (gs
), spc
, false, flags
);
2739 case GIMPLE_OMP_PARALLEL
:
2740 dump_gimple_omp_parallel (pp
, as_a
<const gomp_parallel
*> (gs
), spc
,
2744 case GIMPLE_OMP_TASK
:
2745 dump_gimple_omp_task (pp
, as_a
<const gomp_task
*> (gs
), spc
, flags
);
2748 case GIMPLE_OMP_ATOMIC_LOAD
:
2749 dump_gimple_omp_atomic_load (pp
, as_a
<const gomp_atomic_load
*> (gs
),
2753 case GIMPLE_OMP_ATOMIC_STORE
:
2754 dump_gimple_omp_atomic_store (pp
,
2755 as_a
<const gomp_atomic_store
*> (gs
),
2759 case GIMPLE_OMP_FOR
:
2760 dump_gimple_omp_for (pp
, as_a
<const gomp_for
*> (gs
), spc
, flags
);
2763 case GIMPLE_OMP_CONTINUE
:
2764 dump_gimple_omp_continue (pp
, as_a
<const gomp_continue
*> (gs
), spc
,
2768 case GIMPLE_OMP_SINGLE
:
2769 dump_gimple_omp_single (pp
, as_a
<const gomp_single
*> (gs
), spc
,
2773 case GIMPLE_OMP_TARGET
:
2774 dump_gimple_omp_target (pp
, as_a
<const gomp_target
*> (gs
), spc
,
2778 case GIMPLE_OMP_TEAMS
:
2779 dump_gimple_omp_teams (pp
, as_a
<const gomp_teams
*> (gs
), spc
,
2783 case GIMPLE_OMP_RETURN
:
2784 dump_gimple_omp_return (pp
, gs
, spc
, flags
);
2787 case GIMPLE_OMP_SECTIONS
:
2788 dump_gimple_omp_sections (pp
, as_a
<const gomp_sections
*> (gs
),
2792 case GIMPLE_OMP_SECTIONS_SWITCH
:
2793 pp_string (pp
, "GIMPLE_SECTIONS_SWITCH");
2796 case GIMPLE_OMP_TASKGROUP
:
2797 dump_gimple_omp_taskgroup (pp
, gs
, spc
, flags
);
2800 case GIMPLE_OMP_MASKED
:
2801 dump_gimple_omp_masked (pp
, gs
, spc
, flags
);
2804 case GIMPLE_OMP_SCOPE
:
2805 dump_gimple_omp_scope (pp
, gs
, spc
, flags
);
2808 case GIMPLE_OMP_MASTER
:
2809 case GIMPLE_OMP_SECTION
:
2810 case GIMPLE_OMP_STRUCTURED_BLOCK
:
2811 dump_gimple_omp_block (pp
, gs
, spc
, flags
);
2814 case GIMPLE_OMP_ORDERED
:
2815 dump_gimple_omp_ordered (pp
, as_a
<const gomp_ordered
*> (gs
), spc
,
2819 case GIMPLE_OMP_SCAN
:
2820 dump_gimple_omp_scan (pp
, as_a
<const gomp_scan
*> (gs
), spc
,
2824 case GIMPLE_OMP_CRITICAL
:
2825 dump_gimple_omp_critical (pp
, as_a
<const gomp_critical
*> (gs
), spc
,
2830 dump_gimple_catch (pp
, as_a
<const gcatch
*> (gs
), spc
, flags
);
2833 case GIMPLE_EH_FILTER
:
2834 dump_gimple_eh_filter (pp
, as_a
<const geh_filter
*> (gs
), spc
,
2838 case GIMPLE_EH_MUST_NOT_THROW
:
2839 dump_gimple_eh_must_not_throw (pp
,
2840 as_a
<const geh_mnt
*> (gs
),
2844 case GIMPLE_EH_ELSE
:
2845 dump_gimple_eh_else (pp
, as_a
<const geh_else
*> (gs
), spc
, flags
);
2849 dump_gimple_resx (pp
, as_a
<const gresx
*> (gs
), spc
, flags
);
2852 case GIMPLE_EH_DISPATCH
:
2853 dump_gimple_eh_dispatch (pp
, as_a
<const geh_dispatch
*> (gs
), spc
,
2858 dump_gimple_debug (pp
, as_a
<const gdebug
*> (gs
), spc
, flags
);
2861 case GIMPLE_PREDICT
:
2862 pp_string (pp
, "// predicted ");
2863 if (gimple_predict_outcome (gs
))
2864 pp_string (pp
, "likely by ");
2866 pp_string (pp
, "unlikely by ");
2867 pp_string (pp
, predictor_name (gimple_predict_predictor (gs
)));
2868 pp_string (pp
, " predictor.");
2872 dump_gimple_assume (pp
, gs
, spc
, flags
);
2875 case GIMPLE_TRANSACTION
:
2876 dump_gimple_transaction (pp
, as_a
<const gtransaction
*> (gs
), spc
,
2886 /* Dumps header of basic block BB to OUTF indented by INDENT
2887 spaces and details described by flags. */
2890 dump_gimple_bb_header (FILE *outf
, basic_block bb
, int indent
,
2893 if (flags
& TDF_BLOCKS
)
2895 if (flags
& TDF_LINENO
)
2897 gimple_stmt_iterator gsi
;
2899 fputs (";; ", outf
);
2901 for (gsi
= gsi_start_bb (bb
); !gsi_end_p (gsi
); gsi_next (&gsi
))
2902 if (!is_gimple_debug (gsi_stmt (gsi
))
2903 && get_lineno (gsi_stmt (gsi
)) != UNKNOWN_LOCATION
)
2905 fprintf (outf
, "%*sstarting at line %d",
2906 indent
, "", get_lineno (gsi_stmt (gsi
)));
2914 if (flags
& TDF_GIMPLE
)
2916 fprintf (outf
, "%*s__BB(%d", indent
, "", bb
->index
);
2917 if (bb
->loop_father
->header
== bb
)
2918 fprintf (outf
, ",loop_header(%d)", bb
->loop_father
->num
);
2919 if (bb
->count
.initialized_p ())
2920 fprintf (outf
, ",%s(%" PRIu64
")",
2921 profile_quality_as_string (bb
->count
.quality ()),
2922 bb
->count
.value ());
2923 fprintf (outf
, "):\n");
2926 fprintf (outf
, "%*s<bb %d> %s:\n",
2927 indent
, "", bb
->index
, dump_profile (bb
->count
));
2932 /* Dumps end of basic block BB to PP indented by INDENT
2936 dump_gimple_bb_footer (FILE *outf ATTRIBUTE_UNUSED
,
2937 basic_block bb ATTRIBUTE_UNUSED
,
2938 int indent ATTRIBUTE_UNUSED
,
2939 dump_flags_t flags ATTRIBUTE_UNUSED
)
2941 /* There is currently no GIMPLE-specific basic block info to dump. */
2946 /* Dump PHI nodes of basic block BB to PP with details described
2947 by FLAGS and indented by INDENT spaces. */
2950 dump_phi_nodes (pretty_printer
*pp
, basic_block bb
, int indent
,
2955 for (i
= gsi_start_phis (bb
); !gsi_end_p (i
); gsi_next (&i
))
2957 gphi
*phi
= i
.phi ();
2958 if (!virtual_operand_p (gimple_phi_result (phi
)) || (flags
& TDF_VOPS
))
2961 dump_gimple_phi (pp
, phi
, indent
,
2962 (flags
& TDF_GIMPLE
) ? false : true, flags
);
2969 /* Dump jump to basic block BB that is represented implicitly in the cfg
2973 pp_cfg_jump (pretty_printer
*pp
, edge e
, dump_flags_t flags
)
2975 if (flags
& TDF_GIMPLE
)
2977 pp_string (pp
, "goto __BB");
2978 pp_decimal_int (pp
, e
->dest
->index
);
2979 if (e
->probability
.initialized_p ())
2981 pp_string (pp
, "(");
2983 profile_quality_as_string (e
->probability
.quality ()));
2984 pp_string (pp
, "(");
2985 pp_decimal_int (pp
, e
->probability
.value ());
2986 pp_string (pp
, "))");
2992 pp_string (pp
, "goto <bb ");
2993 pp_decimal_int (pp
, e
->dest
->index
);
2997 dump_edge_probability (pp
, e
);
3002 /* Dump edges represented implicitly in basic block BB to PP, indented
3003 by INDENT spaces, with details given by FLAGS. */
3006 dump_implicit_edges (pretty_printer
*pp
, basic_block bb
, int indent
,
3011 if (safe_is_a
<gcond
*> (*gsi_last_bb (bb
)))
3013 edge true_edge
, false_edge
;
3015 /* When we are emitting the code or changing CFG, it is possible that
3016 the edges are not yet created. When we are using debug_bb in such
3017 a situation, we do not want it to crash. */
3018 if (EDGE_COUNT (bb
->succs
) != 2)
3020 extract_true_false_edges_from_block (bb
, &true_edge
, &false_edge
);
3022 INDENT (indent
+ 2);
3023 pp_cfg_jump (pp
, true_edge
, flags
);
3024 newline_and_indent (pp
, indent
);
3025 pp_string (pp
, "else");
3026 newline_and_indent (pp
, indent
+ 2);
3027 pp_cfg_jump (pp
, false_edge
, flags
);
3032 /* If there is a fallthru edge, we may need to add an artificial
3033 goto to the dump. */
3034 e
= find_fallthru_edge (bb
->succs
);
3036 if (e
&& (e
->dest
!= bb
->next_bb
|| (flags
& TDF_GIMPLE
)))
3040 if ((flags
& TDF_LINENO
)
3041 && e
->goto_locus
!= UNKNOWN_LOCATION
)
3042 dump_location (pp
, e
->goto_locus
);
3044 pp_cfg_jump (pp
, e
, flags
);
3050 /* Dumps basic block BB to PP with details described by FLAGS and
3051 indented by INDENT spaces. */
3054 gimple_dump_bb_buff (pretty_printer
*pp
, basic_block bb
, int indent
,
3057 gimple_stmt_iterator gsi
;
3059 int label_indent
= indent
- 2;
3061 if (label_indent
< 0)
3064 dump_phi_nodes (pp
, bb
, indent
, flags
);
3066 for (gsi
= gsi_start_bb (bb
); !gsi_end_p (gsi
); gsi_next (&gsi
))
3070 stmt
= gsi_stmt (gsi
);
3072 curr_indent
= gimple_code (stmt
) == GIMPLE_LABEL
? label_indent
: indent
;
3074 INDENT (curr_indent
);
3075 pp_gimple_stmt_1 (pp
, stmt
, curr_indent
, flags
);
3076 pp_newline_and_flush (pp
);
3077 gcc_checking_assert (DECL_STRUCT_FUNCTION (current_function_decl
));
3078 dump_histograms_for_stmt (DECL_STRUCT_FUNCTION (current_function_decl
),
3079 pp_buffer (pp
)->m_stream
, stmt
);
3082 dump_implicit_edges (pp
, bb
, indent
, flags
);
3087 /* Dumps basic block BB to FILE with details described by FLAGS and
3088 indented by INDENT spaces. */
3091 gimple_dump_bb (FILE *file
, basic_block bb
, int indent
, dump_flags_t flags
)
3093 dump_gimple_bb_header (file
, bb
, indent
, flags
);
3094 if (bb
->index
>= NUM_FIXED_BLOCKS
)
3097 pp_needs_newline (&pp
) = true;
3098 pp
.set_output_stream (file
);
3099 gimple_dump_bb_buff (&pp
, bb
, indent
, flags
);
3101 dump_gimple_bb_footer (file
, bb
, indent
, flags
);
3104 /* Dumps basic block BB to pretty-printer PP with default dump flags and
3105 no indentation, for use as a label of a DOT graph record-node.
3106 ??? Should just use gimple_dump_bb_buff here, except that value profiling
3107 histogram dumping doesn't know about pretty-printers. */
3110 gimple_dump_bb_for_graph (pretty_printer
*pp
, basic_block bb
)
3112 pp_printf (pp
, "<bb %d>:\n", bb
->index
);
3113 pp_write_text_as_dot_label_to_stream (pp
, /*for_record=*/true);
3115 for (gphi_iterator gsi
= gsi_start_phis (bb
); !gsi_end_p (gsi
);
3118 gphi
*phi
= gsi
.phi ();
3119 if (!virtual_operand_p (gimple_phi_result (phi
))
3120 || (dump_flags
& TDF_VOPS
))
3123 pp_write_text_to_stream (pp
);
3124 pp_string (pp
, "# ");
3125 pp_gimple_stmt_1 (pp
, phi
, 0, dump_flags
);
3127 pp_write_text_as_dot_label_to_stream (pp
, /*for_record=*/true);
3131 for (gimple_stmt_iterator gsi
= gsi_start_bb (bb
); !gsi_end_p (gsi
);
3134 gimple
*stmt
= gsi_stmt (gsi
);
3136 pp_write_text_to_stream (pp
);
3137 pp_gimple_stmt_1 (pp
, stmt
, 0, dump_flags
);
3139 pp_write_text_as_dot_label_to_stream (pp
, /*for_record=*/true);
3141 dump_implicit_edges (pp
, bb
, 0, dump_flags
);
3142 pp_write_text_as_dot_label_to_stream (pp
, /*for_record=*/true);
3146 # pragma GCC diagnostic pop