1 /* Pretty formatting of GIMPLE statements and expressions.
2 Copyright (C) 2001-2021 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 "internal-fn.h"
35 #include "gimple-iterator.h"
37 #include "dumpfile.h" /* for dump_flags */
38 #include "value-prof.h"
39 #include "trans-mem.h"
41 #include "stringpool.h"
46 /* Disable warnings about quoting issues in the pp_xxx calls below
47 that (intentionally) don't follow GCC diagnostic conventions. */
49 # pragma GCC diagnostic push
50 # pragma GCC diagnostic ignored "-Wformat-diag"
53 #define INDENT(SPACE) \
54 do { int i; for (i = 0; i < SPACE; i++) pp_space (buffer); } while (0)
56 #define GIMPLE_NIY do_niy (buffer,gs)
58 /* Try to print on BUFFER a default message for the unrecognized
59 gimple statement GS. */
62 do_niy (pretty_printer
*buffer
, const gimple
*gs
)
64 pp_printf (buffer
, "<<< Unknown GIMPLE statement: %s >>>\n",
65 gimple_code_name
[(int) gimple_code (gs
)]);
69 /* Emit a newline and SPC indentation spaces to BUFFER. */
72 newline_and_indent (pretty_printer
*buffer
, int spc
)
79 /* Print the GIMPLE statement GS on stderr. */
82 debug_gimple_stmt (gimple
*gs
)
84 print_gimple_stmt (stderr
, gs
, 0, TDF_VOPS
|TDF_MEMSYMS
);
88 /* Return formatted string of a VALUE probability
89 (biased by REG_BR_PROB_BASE). Returned string is allocated
90 by xstrdup_for_dump. */
93 dump_profile (profile_count
&count
)
96 if (!count
.initialized_p ())
99 buf
= xasprintf ("[count: %" PRId64
"]",
100 count
.to_gcov_type ());
101 else if (count
.initialized_p ())
102 buf
= xasprintf ("[local count: %" PRId64
"]",
103 count
.to_gcov_type ());
105 const char *ret
= xstrdup_for_dump (buf
);
111 /* Return formatted string of a VALUE probability
112 (biased by REG_BR_PROB_BASE). Returned string is allocated
113 by xstrdup_for_dump. */
116 dump_probability (profile_probability probability
)
118 float minimum
= 0.01f
;
121 if (probability
.initialized_p ())
123 fvalue
= probability
.to_reg_br_prob_base () * 100.0f
/ REG_BR_PROB_BASE
;
124 if (fvalue
< minimum
&& probability
.to_reg_br_prob_base ())
129 if (probability
.initialized_p ())
130 buf
= xasprintf ("[%.2f%%]", fvalue
);
132 buf
= xasprintf ("[INV]");
134 const char *ret
= xstrdup_for_dump (buf
);
140 /* Dump E probability to BUFFER. */
143 dump_edge_probability (pretty_printer
*buffer
, edge e
)
145 pp_scalar (buffer
, " %s", dump_probability (e
->probability
));
148 /* Print GIMPLE statement G to FILE using SPC indentation spaces and
149 FLAGS as in pp_gimple_stmt_1. */
152 print_gimple_stmt (FILE *file
, gimple
*g
, int spc
, dump_flags_t flags
)
154 pretty_printer buffer
;
155 pp_needs_newline (&buffer
) = true;
156 buffer
.buffer
->stream
= file
;
157 pp_gimple_stmt_1 (&buffer
, g
, spc
, flags
);
158 pp_newline_and_flush (&buffer
);
164 print_gimple_stmt (stderr
, &ref
, 0, TDF_NONE
);
173 fprintf (stderr
, "<nil>\n");
177 /* Print GIMPLE statement G to FILE using SPC indentation spaces and
178 FLAGS as in pp_gimple_stmt_1. Print only the right-hand side
182 print_gimple_expr (FILE *file
, gimple
*g
, int spc
, dump_flags_t flags
)
184 flags
|= TDF_RHS_ONLY
;
185 pretty_printer buffer
;
186 pp_needs_newline (&buffer
) = true;
187 buffer
.buffer
->stream
= file
;
188 pp_gimple_stmt_1 (&buffer
, g
, spc
, flags
);
193 /* Print the GIMPLE sequence SEQ on BUFFER using SPC indentation
194 spaces and FLAGS as in pp_gimple_stmt_1.
195 The caller is responsible for calling pp_flush on BUFFER to finalize
196 the pretty printer. */
199 dump_gimple_seq (pretty_printer
*buffer
, gimple_seq seq
, int spc
,
202 gimple_stmt_iterator i
;
204 for (i
= gsi_start (seq
); !gsi_end_p (i
); gsi_next (&i
))
206 gimple
*gs
= gsi_stmt (i
);
208 pp_gimple_stmt_1 (buffer
, gs
, spc
, flags
);
209 if (!gsi_one_before_end_p (i
))
215 /* Print GIMPLE sequence SEQ to FILE using SPC indentation spaces and
216 FLAGS as in pp_gimple_stmt_1. */
219 print_gimple_seq (FILE *file
, gimple_seq seq
, int spc
, dump_flags_t flags
)
221 pretty_printer buffer
;
222 pp_needs_newline (&buffer
) = true;
223 buffer
.buffer
->stream
= file
;
224 dump_gimple_seq (&buffer
, seq
, spc
, flags
);
225 pp_newline_and_flush (&buffer
);
229 /* Print the GIMPLE sequence SEQ on stderr. */
232 debug_gimple_seq (gimple_seq seq
)
234 print_gimple_seq (stderr
, seq
, 0, TDF_VOPS
|TDF_MEMSYMS
);
238 /* A simple helper to pretty-print some of the gimple tuples in the printf
239 style. The format modifiers are preceded by '%' and are:
240 'G' - outputs a string corresponding to the code of the given gimple,
241 'S' - outputs a gimple_seq with indent of spc + 2,
242 'T' - outputs the tree t,
243 'd' - outputs an int as a decimal,
244 's' - outputs a string,
245 'n' - outputs a newline,
246 'x' - outputs an int as hexadecimal,
247 '+' - increases indent by 2 then outputs a newline,
248 '-' - decreases indent by 2 then outputs a newline. */
251 dump_gimple_fmt (pretty_printer
*buffer
, int spc
, dump_flags_t flags
,
252 const char *fmt
, ...)
258 va_start (args
, fmt
);
259 for (c
= fmt
; *c
; c
++)
269 g
= va_arg (args
, gimple
*);
270 tmp
= gimple_code_name
[gimple_code (g
)];
271 pp_string (buffer
, tmp
);
275 seq
= va_arg (args
, gimple_seq
);
277 dump_gimple_seq (buffer
, seq
, spc
+ 2, flags
);
278 newline_and_indent (buffer
, spc
);
282 t
= va_arg (args
, tree
);
284 pp_string (buffer
, "NULL");
286 dump_generic_node (buffer
, t
, spc
, flags
, false);
290 pp_decimal_int (buffer
, va_arg (args
, int));
294 pp_string (buffer
, va_arg (args
, char *));
298 newline_and_indent (buffer
, spc
);
302 pp_scalar (buffer
, "%x", va_arg (args
, int));
307 newline_and_indent (buffer
, spc
);
312 newline_and_indent (buffer
, spc
);
320 pp_character (buffer
, *c
);
326 /* Helper for dump_gimple_assign. Print the unary RHS of the
327 assignment GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1. */
330 dump_unary_rhs (pretty_printer
*buffer
, const gassign
*gs
, int spc
,
333 enum tree_code rhs_code
= gimple_assign_rhs_code (gs
);
334 tree lhs
= gimple_assign_lhs (gs
);
335 tree rhs
= gimple_assign_rhs1 (gs
);
339 case VIEW_CONVERT_EXPR
:
341 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
344 case FIXED_CONVERT_EXPR
:
345 case ADDR_SPACE_CONVERT_EXPR
:
349 pp_left_paren (buffer
);
350 dump_generic_node (buffer
, TREE_TYPE (lhs
), spc
, flags
, false);
351 pp_string (buffer
, ") ");
352 if (op_prio (rhs
) < op_code_prio (rhs_code
))
354 pp_left_paren (buffer
);
355 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
356 pp_right_paren (buffer
);
359 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
363 pp_string (buffer
, "((");
364 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
365 pp_string (buffer
, "))");
370 if (flags
& TDF_GIMPLE
)
373 rhs_code
== ABS_EXPR
? "__ABS " : "__ABSU ");
374 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
379 rhs_code
== ABS_EXPR
? "ABS_EXPR <" : "ABSU_EXPR <");
380 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
386 if (TREE_CODE_CLASS (rhs_code
) == tcc_declaration
387 || TREE_CODE_CLASS (rhs_code
) == tcc_constant
388 || TREE_CODE_CLASS (rhs_code
) == tcc_reference
389 || rhs_code
== SSA_NAME
390 || rhs_code
== ADDR_EXPR
391 || rhs_code
== CONSTRUCTOR
)
393 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
396 else if (rhs_code
== BIT_NOT_EXPR
)
397 pp_complement (buffer
);
398 else if (rhs_code
== TRUTH_NOT_EXPR
)
399 pp_exclamation (buffer
);
400 else if (rhs_code
== NEGATE_EXPR
)
404 pp_left_bracket (buffer
);
405 pp_string (buffer
, get_tree_code_name (rhs_code
));
406 pp_string (buffer
, "] ");
409 if (op_prio (rhs
) < op_code_prio (rhs_code
))
411 pp_left_paren (buffer
);
412 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
413 pp_right_paren (buffer
);
416 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
422 /* Helper for dump_gimple_assign. Print the binary RHS of the
423 assignment GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1. */
426 dump_binary_rhs (pretty_printer
*buffer
, const gassign
*gs
, int spc
,
430 enum tree_code code
= gimple_assign_rhs_code (gs
);
435 if (flags
& TDF_GIMPLE
)
437 pp_string (buffer
, code
== MIN_EXPR
? "__MIN (" : "__MAX (");
438 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
,
440 pp_string (buffer
, ", ");
441 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
,
443 pp_string (buffer
, ")");
451 case VEC_WIDEN_MULT_HI_EXPR
:
452 case VEC_WIDEN_MULT_LO_EXPR
:
453 case VEC_WIDEN_MULT_EVEN_EXPR
:
454 case VEC_WIDEN_MULT_ODD_EXPR
:
455 case VEC_PACK_TRUNC_EXPR
:
456 case VEC_PACK_SAT_EXPR
:
457 case VEC_PACK_FIX_TRUNC_EXPR
:
458 case VEC_PACK_FLOAT_EXPR
:
459 case VEC_WIDEN_LSHIFT_HI_EXPR
:
460 case VEC_WIDEN_LSHIFT_LO_EXPR
:
461 case VEC_SERIES_EXPR
:
462 for (p
= get_tree_code_name (code
); *p
; p
++)
463 pp_character (buffer
, TOUPPER (*p
));
464 pp_string (buffer
, " <");
465 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
466 pp_string (buffer
, ", ");
467 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
472 if (op_prio (gimple_assign_rhs1 (gs
)) <= op_code_prio (code
))
474 pp_left_paren (buffer
);
475 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
,
477 pp_right_paren (buffer
);
480 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
482 pp_string (buffer
, op_symbol_code (gimple_assign_rhs_code (gs
)));
484 if (op_prio (gimple_assign_rhs2 (gs
)) <= op_code_prio (code
))
486 pp_left_paren (buffer
);
487 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
,
489 pp_right_paren (buffer
);
492 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
496 /* Helper for dump_gimple_assign. Print the ternary RHS of the
497 assignment GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1. */
500 dump_ternary_rhs (pretty_printer
*buffer
, const gassign
*gs
, int spc
,
504 enum tree_code code
= gimple_assign_rhs_code (gs
);
507 case WIDEN_MULT_PLUS_EXPR
:
508 case WIDEN_MULT_MINUS_EXPR
:
509 for (p
= get_tree_code_name (code
); *p
; p
++)
510 pp_character (buffer
, TOUPPER (*p
));
511 pp_string (buffer
, " <");
512 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
513 pp_string (buffer
, ", ");
514 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
515 pp_string (buffer
, ", ");
516 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
521 pp_string (buffer
, "DOT_PROD_EXPR <");
522 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
523 pp_string (buffer
, ", ");
524 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
525 pp_string (buffer
, ", ");
526 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
531 pp_string (buffer
, "SAD_EXPR <");
532 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
533 pp_string (buffer
, ", ");
534 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
535 pp_string (buffer
, ", ");
536 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
541 if (flags
& TDF_GIMPLE
)
542 pp_string (buffer
, "__VEC_PERM (");
544 pp_string (buffer
, "VEC_PERM_EXPR <");
545 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
546 pp_string (buffer
, ", ");
547 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
548 pp_string (buffer
, ", ");
549 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
550 if (flags
& TDF_GIMPLE
)
551 pp_right_paren (buffer
);
556 case REALIGN_LOAD_EXPR
:
557 pp_string (buffer
, "REALIGN_LOAD <");
558 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
559 pp_string (buffer
, ", ");
560 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
561 pp_string (buffer
, ", ");
562 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
567 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
568 pp_string (buffer
, " ? ");
569 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
570 pp_string (buffer
, " : ");
571 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
575 pp_string (buffer
, "VEC_COND_EXPR <");
576 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
577 pp_string (buffer
, ", ");
578 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
579 pp_string (buffer
, ", ");
580 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
584 case BIT_INSERT_EXPR
:
585 if (flags
& TDF_GIMPLE
)
587 pp_string (buffer
, "__BIT_INSERT (");
588 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
,
589 flags
| TDF_SLIM
, false);
590 pp_string (buffer
, ", ");
591 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
,
592 flags
| TDF_SLIM
, false);
593 pp_string (buffer
, ", ");
594 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
,
595 flags
| TDF_SLIM
, false);
596 pp_right_paren (buffer
);
600 pp_string (buffer
, "BIT_INSERT_EXPR <");
601 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
),
603 pp_string (buffer
, ", ");
604 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
),
606 pp_string (buffer
, ", ");
607 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
),
609 if (INTEGRAL_TYPE_P (TREE_TYPE (gimple_assign_rhs2 (gs
))))
611 pp_string (buffer
, " (");
612 pp_decimal_int (buffer
, TYPE_PRECISION
613 (TREE_TYPE (gimple_assign_rhs2 (gs
))));
614 pp_string (buffer
, " bits)");
626 /* Dump the gimple assignment GS. BUFFER, SPC and FLAGS are as in
630 dump_gimple_assign (pretty_printer
*buffer
, const gassign
*gs
, int spc
,
638 switch (gimple_num_ops (gs
))
641 arg3
= gimple_assign_rhs3 (gs
);
644 arg2
= gimple_assign_rhs2 (gs
);
647 arg1
= gimple_assign_rhs1 (gs
);
653 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%s, %T, %T, %T, %T>", gs
,
654 get_tree_code_name (gimple_assign_rhs_code (gs
)),
655 gimple_assign_lhs (gs
), arg1
, arg2
, arg3
);
659 if (!(flags
& TDF_RHS_ONLY
))
661 dump_generic_node (buffer
, gimple_assign_lhs (gs
), spc
, flags
, false);
665 if (gimple_assign_nontemporal_move_p (gs
))
666 pp_string (buffer
, "{nt}");
668 if (gimple_has_volatile_ops (gs
))
669 pp_string (buffer
, "{v}");
674 if (gimple_num_ops (gs
) == 2)
675 dump_unary_rhs (buffer
, gs
, spc
, flags
);
676 else if (gimple_num_ops (gs
) == 3)
677 dump_binary_rhs (buffer
, gs
, spc
, flags
);
678 else if (gimple_num_ops (gs
) == 4)
679 dump_ternary_rhs (buffer
, gs
, spc
, flags
);
682 if (!(flags
& TDF_RHS_ONLY
))
683 pp_semicolon (buffer
);
688 /* Dump the return statement GS. BUFFER, SPC and FLAGS are as in
692 dump_gimple_return (pretty_printer
*buffer
, const greturn
*gs
, int spc
,
697 t
= gimple_return_retval (gs
);
699 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
, t
);
702 pp_string (buffer
, "return");
706 dump_generic_node (buffer
, t
, spc
, flags
, false);
708 pp_semicolon (buffer
);
713 /* Dump the call arguments for a gimple call. BUFFER, FLAGS are as in
717 dump_gimple_call_args (pretty_printer
*buffer
, const gcall
*gs
,
722 /* Pretty print first arg to certain internal fns. */
723 if (gimple_call_internal_p (gs
))
725 const char *const *enums
= NULL
;
728 switch (gimple_call_internal_fn (gs
))
732 static const char *const unique_args
[] = {IFN_UNIQUE_CODES
};
736 limit
= ARRAY_SIZE (unique_args
);
741 static const char *const loop_args
[] = {IFN_GOACC_LOOP_CODES
};
744 limit
= ARRAY_SIZE (loop_args
);
747 case IFN_GOACC_REDUCTION
:
749 static const char *const reduction_args
[]
750 = {IFN_GOACC_REDUCTION_CODES
};
752 enums
= reduction_args
;
753 limit
= ARRAY_SIZE (reduction_args
);
756 case IFN_HWASAN_MARK
:
759 static const char *const asan_mark_args
[] = {IFN_ASAN_MARK_FLAGS
};
761 enums
= asan_mark_args
;
762 limit
= ARRAY_SIZE (asan_mark_args
);
770 tree arg0
= gimple_call_arg (gs
, 0);
773 if (TREE_CODE (arg0
) == INTEGER_CST
774 && tree_fits_shwi_p (arg0
)
775 && (v
= tree_to_shwi (arg0
)) >= 0 && v
< limit
)
778 pp_string (buffer
, enums
[v
]);
783 for (; i
< gimple_call_num_args (gs
); i
++)
786 pp_string (buffer
, ", ");
787 dump_generic_node (buffer
, gimple_call_arg (gs
, i
), 0, flags
, false);
790 if (gimple_call_va_arg_pack_p (gs
))
793 pp_string (buffer
, ", ");
795 pp_string (buffer
, "__builtin_va_arg_pack ()");
799 /* Dump the points-to solution *PT to BUFFER. */
802 pp_points_to_solution (pretty_printer
*buffer
, const pt_solution
*pt
)
806 pp_string (buffer
, "anything ");
810 pp_string (buffer
, "nonlocal ");
812 pp_string (buffer
, "escaped ");
814 pp_string (buffer
, "unit-escaped ");
816 pp_string (buffer
, "null ");
818 && !bitmap_empty_p (pt
->vars
))
822 pp_string (buffer
, "{ ");
823 EXECUTE_IF_SET_IN_BITMAP (pt
->vars
, 0, i
, bi
)
825 pp_string (buffer
, "D.");
826 pp_decimal_int (buffer
, i
);
829 pp_right_brace (buffer
);
830 if (pt
->vars_contains_nonlocal
831 || pt
->vars_contains_escaped
832 || pt
->vars_contains_escaped_heap
833 || pt
->vars_contains_restrict
)
835 const char *comma
= "";
836 pp_string (buffer
, " (");
837 if (pt
->vars_contains_nonlocal
)
839 pp_string (buffer
, "nonlocal");
842 if (pt
->vars_contains_escaped
)
844 pp_string (buffer
, comma
);
845 pp_string (buffer
, "escaped");
848 if (pt
->vars_contains_escaped_heap
)
850 pp_string (buffer
, comma
);
851 pp_string (buffer
, "escaped heap");
854 if (pt
->vars_contains_restrict
)
856 pp_string (buffer
, comma
);
857 pp_string (buffer
, "restrict");
860 if (pt
->vars_contains_interposable
)
862 pp_string (buffer
, comma
);
863 pp_string (buffer
, "interposable");
865 pp_string (buffer
, ")");
871 /* Dump the call statement GS. BUFFER, SPC and FLAGS are as in
875 dump_gimple_call (pretty_printer
*buffer
, const gcall
*gs
, int spc
,
878 tree lhs
= gimple_call_lhs (gs
);
879 tree fn
= gimple_call_fn (gs
);
881 if (flags
& TDF_ALIAS
)
883 const pt_solution
*pt
;
884 pt
= gimple_call_use_set (gs
);
885 if (!pt_solution_empty_p (pt
))
887 pp_string (buffer
, "# USE = ");
888 pp_points_to_solution (buffer
, pt
);
889 newline_and_indent (buffer
, spc
);
891 pt
= gimple_call_clobber_set (gs
);
892 if (!pt_solution_empty_p (pt
))
894 pp_string (buffer
, "# CLB = ");
895 pp_points_to_solution (buffer
, pt
);
896 newline_and_indent (buffer
, spc
);
902 if (gimple_call_internal_p (gs
))
903 dump_gimple_fmt (buffer
, spc
, flags
, "%G <.%s, %T", gs
,
904 internal_fn_name (gimple_call_internal_fn (gs
)), lhs
);
906 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %T", gs
, fn
, lhs
);
907 if (gimple_call_num_args (gs
) > 0)
909 pp_string (buffer
, ", ");
910 dump_gimple_call_args (buffer
, gs
, flags
);
916 if (lhs
&& !(flags
& TDF_RHS_ONLY
))
918 dump_generic_node (buffer
, lhs
, spc
, flags
, false);
919 pp_string (buffer
, " =");
921 if (gimple_has_volatile_ops (gs
))
922 pp_string (buffer
, "{v}");
926 if (gimple_call_internal_p (gs
))
929 pp_string (buffer
, internal_fn_name (gimple_call_internal_fn (gs
)));
932 print_call_name (buffer
, fn
, flags
);
933 pp_string (buffer
, " (");
934 dump_gimple_call_args (buffer
, gs
, flags
);
935 pp_right_paren (buffer
);
936 if (!(flags
& TDF_RHS_ONLY
))
937 pp_semicolon (buffer
);
940 if (gimple_call_chain (gs
))
942 pp_string (buffer
, " [static-chain: ");
943 dump_generic_node (buffer
, gimple_call_chain (gs
), spc
, flags
, false);
944 pp_right_bracket (buffer
);
947 if (gimple_call_return_slot_opt_p (gs
))
948 pp_string (buffer
, " [return slot optimization]");
949 if (gimple_call_tail_p (gs
))
950 pp_string (buffer
, " [tail call]");
951 if (gimple_call_must_tail_p (gs
))
952 pp_string (buffer
, " [must tail call]");
957 /* Dump the arguments of _ITM_beginTransaction sanely. */
958 if (TREE_CODE (fn
) == ADDR_EXPR
)
959 fn
= TREE_OPERAND (fn
, 0);
960 if (TREE_CODE (fn
) == FUNCTION_DECL
&& decl_is_tm_clone (fn
))
961 pp_string (buffer
, " [tm-clone]");
962 if (TREE_CODE (fn
) == FUNCTION_DECL
963 && fndecl_built_in_p (fn
, BUILT_IN_TM_START
)
964 && gimple_call_num_args (gs
) > 0)
966 tree t
= gimple_call_arg (gs
, 0);
967 unsigned HOST_WIDE_INT props
;
968 gcc_assert (TREE_CODE (t
) == INTEGER_CST
);
970 pp_string (buffer
, " [ ");
972 /* Get the transaction code properties. */
973 props
= TREE_INT_CST_LOW (t
);
975 if (props
& PR_INSTRUMENTEDCODE
)
976 pp_string (buffer
, "instrumentedCode ");
977 if (props
& PR_UNINSTRUMENTEDCODE
)
978 pp_string (buffer
, "uninstrumentedCode ");
979 if (props
& PR_HASNOXMMUPDATE
)
980 pp_string (buffer
, "hasNoXMMUpdate ");
981 if (props
& PR_HASNOABORT
)
982 pp_string (buffer
, "hasNoAbort ");
983 if (props
& PR_HASNOIRREVOCABLE
)
984 pp_string (buffer
, "hasNoIrrevocable ");
985 if (props
& PR_DOESGOIRREVOCABLE
)
986 pp_string (buffer
, "doesGoIrrevocable ");
987 if (props
& PR_HASNOSIMPLEREADS
)
988 pp_string (buffer
, "hasNoSimpleReads ");
989 if (props
& PR_AWBARRIERSOMITTED
)
990 pp_string (buffer
, "awBarriersOmitted ");
991 if (props
& PR_RARBARRIERSOMITTED
)
992 pp_string (buffer
, "RaRBarriersOmitted ");
993 if (props
& PR_UNDOLOGCODE
)
994 pp_string (buffer
, "undoLogCode ");
995 if (props
& PR_PREFERUNINSTRUMENTED
)
996 pp_string (buffer
, "preferUninstrumented ");
997 if (props
& PR_EXCEPTIONBLOCK
)
998 pp_string (buffer
, "exceptionBlock ");
999 if (props
& PR_HASELSE
)
1000 pp_string (buffer
, "hasElse ");
1001 if (props
& PR_READONLY
)
1002 pp_string (buffer
, "readOnly ");
1004 pp_right_bracket (buffer
);
1009 /* Dump the switch statement GS. BUFFER, SPC and FLAGS are as in
1010 pp_gimple_stmt_1. */
1013 dump_gimple_switch (pretty_printer
*buffer
, const gswitch
*gs
, int spc
,
1018 GIMPLE_CHECK (gs
, GIMPLE_SWITCH
);
1019 if (flags
& TDF_RAW
)
1020 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, ", gs
,
1021 gimple_switch_index (gs
));
1024 pp_string (buffer
, "switch (");
1025 dump_generic_node (buffer
, gimple_switch_index (gs
), spc
, flags
, true);
1026 if (flags
& TDF_GIMPLE
)
1027 pp_string (buffer
, ") {");
1029 pp_string (buffer
, ") <");
1032 for (i
= 0; i
< gimple_switch_num_labels (gs
); i
++)
1034 tree case_label
= gimple_switch_label (gs
, i
);
1035 gcc_checking_assert (case_label
!= NULL_TREE
);
1036 dump_generic_node (buffer
, case_label
, spc
, flags
, false);
1038 tree label
= CASE_LABEL (case_label
);
1039 dump_generic_node (buffer
, label
, spc
, flags
, false);
1041 if (cfun
&& cfun
->cfg
)
1043 basic_block dest
= label_to_block (cfun
, label
);
1046 edge label_edge
= find_edge (gimple_bb (gs
), dest
);
1047 if (label_edge
&& !(flags
& TDF_GIMPLE
))
1048 dump_edge_probability (buffer
, label_edge
);
1052 if (i
< gimple_switch_num_labels (gs
) - 1)
1054 if (flags
& TDF_GIMPLE
)
1055 pp_string (buffer
, "; ");
1057 pp_string (buffer
, ", ");
1060 if (flags
& TDF_GIMPLE
)
1061 pp_string (buffer
, "; }");
1063 pp_greater (buffer
);
1067 /* Dump the gimple conditional GS. BUFFER, SPC and FLAGS are as in
1068 pp_gimple_stmt_1. */
1071 dump_gimple_cond (pretty_printer
*buffer
, const gcond
*gs
, int spc
,
1074 if (flags
& TDF_RAW
)
1075 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%s, %T, %T, %T, %T>", gs
,
1076 get_tree_code_name (gimple_cond_code (gs
)),
1077 gimple_cond_lhs (gs
), gimple_cond_rhs (gs
),
1078 gimple_cond_true_label (gs
), gimple_cond_false_label (gs
));
1081 if (!(flags
& TDF_RHS_ONLY
))
1082 pp_string (buffer
, "if (");
1083 dump_generic_node (buffer
, gimple_cond_lhs (gs
), spc
, flags
, false);
1085 pp_string (buffer
, op_symbol_code (gimple_cond_code (gs
)));
1087 dump_generic_node (buffer
, gimple_cond_rhs (gs
), spc
, flags
, false);
1088 if (!(flags
& TDF_RHS_ONLY
))
1091 edge e
, true_edge
= NULL
, false_edge
= NULL
;
1092 basic_block bb
= gimple_bb (gs
);
1096 FOR_EACH_EDGE (e
, ei
, bb
->succs
)
1098 if (e
->flags
& EDGE_TRUE_VALUE
)
1100 else if (e
->flags
& EDGE_FALSE_VALUE
)
1105 bool has_edge_info
= true_edge
!= NULL
&& false_edge
!= NULL
;
1107 pp_right_paren (buffer
);
1109 if (gimple_cond_true_label (gs
))
1111 pp_string (buffer
, " goto ");
1112 dump_generic_node (buffer
, gimple_cond_true_label (gs
),
1114 if (has_edge_info
&& !(flags
& TDF_GIMPLE
))
1115 dump_edge_probability (buffer
, true_edge
);
1116 pp_semicolon (buffer
);
1118 if (gimple_cond_false_label (gs
))
1120 pp_string (buffer
, " else goto ");
1121 dump_generic_node (buffer
, gimple_cond_false_label (gs
),
1123 if (has_edge_info
&& !(flags
& TDF_GIMPLE
))
1124 dump_edge_probability (buffer
, false_edge
);
1126 pp_semicolon (buffer
);
1133 /* Dump a GIMPLE_LABEL tuple on the pretty_printer BUFFER, SPC
1134 spaces of indent. FLAGS specifies details to show in the dump (see
1135 TDF_* in dumpfils.h). */
1138 dump_gimple_label (pretty_printer
*buffer
, const glabel
*gs
, int spc
,
1141 tree label
= gimple_label_label (gs
);
1142 if (flags
& TDF_RAW
)
1143 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
, label
);
1146 dump_generic_node (buffer
, label
, spc
, flags
, false);
1149 if (flags
& TDF_GIMPLE
)
1151 if (DECL_NONLOCAL (label
))
1152 pp_string (buffer
, " [non-local]");
1153 if ((flags
& TDF_EH
) && EH_LANDING_PAD_NR (label
))
1154 pp_printf (buffer
, " [LP %d]", EH_LANDING_PAD_NR (label
));
1157 /* Dump a GIMPLE_GOTO tuple on the pretty_printer BUFFER, SPC
1158 spaces of indent. FLAGS specifies details to show in the dump (see
1159 TDF_* in dumpfile.h). */
1162 dump_gimple_goto (pretty_printer
*buffer
, const ggoto
*gs
, int spc
,
1165 tree label
= gimple_goto_dest (gs
);
1166 if (flags
& TDF_RAW
)
1167 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
, label
);
1169 dump_gimple_fmt (buffer
, spc
, flags
, "goto %T;", label
);
1173 /* Dump a GIMPLE_BIND tuple on the pretty_printer BUFFER, SPC
1174 spaces of indent. FLAGS specifies details to show in the dump (see
1175 TDF_* in dumpfile.h). */
1178 dump_gimple_bind (pretty_printer
*buffer
, const gbind
*gs
, int spc
,
1181 if (flags
& TDF_RAW
)
1182 dump_gimple_fmt (buffer
, spc
, flags
, "%G <", gs
);
1184 pp_left_brace (buffer
);
1185 if (!(flags
& TDF_SLIM
))
1189 for (var
= gimple_bind_vars (gs
); var
; var
= DECL_CHAIN (var
))
1191 newline_and_indent (buffer
, 2);
1192 print_declaration (buffer
, var
, spc
, flags
);
1194 if (gimple_bind_vars (gs
))
1195 pp_newline (buffer
);
1197 pp_newline (buffer
);
1198 dump_gimple_seq (buffer
, gimple_bind_body (gs
), spc
+ 2, flags
);
1199 newline_and_indent (buffer
, spc
);
1200 if (flags
& TDF_RAW
)
1201 pp_greater (buffer
);
1203 pp_right_brace (buffer
);
1207 /* Dump a GIMPLE_TRY tuple on the pretty_printer BUFFER, SPC spaces of
1208 indent. FLAGS specifies details to show in the dump (see TDF_* in
1212 dump_gimple_try (pretty_printer
*buffer
, const gtry
*gs
, int spc
,
1215 if (flags
& TDF_RAW
)
1218 if (gimple_try_kind (gs
) == GIMPLE_TRY_CATCH
)
1219 type
= "GIMPLE_TRY_CATCH";
1220 else if (gimple_try_kind (gs
) == GIMPLE_TRY_FINALLY
)
1221 type
= "GIMPLE_TRY_FINALLY";
1223 type
= "UNKNOWN GIMPLE_TRY";
1224 dump_gimple_fmt (buffer
, spc
, flags
,
1225 "%G <%s,%+EVAL <%S>%nCLEANUP <%S>%->", gs
, type
,
1226 gimple_try_eval (gs
), gimple_try_cleanup (gs
));
1230 pp_string (buffer
, "try");
1231 newline_and_indent (buffer
, spc
+ 2);
1232 pp_left_brace (buffer
);
1233 pp_newline (buffer
);
1235 dump_gimple_seq (buffer
, gimple_try_eval (gs
), spc
+ 4, flags
);
1236 newline_and_indent (buffer
, spc
+ 2);
1237 pp_right_brace (buffer
);
1239 gimple_seq seq
= gimple_try_cleanup (gs
);
1241 if (gimple_try_kind (gs
) == GIMPLE_TRY_CATCH
)
1243 newline_and_indent (buffer
, spc
);
1244 pp_string (buffer
, "catch");
1245 newline_and_indent (buffer
, spc
+ 2);
1246 pp_left_brace (buffer
);
1248 else if (gimple_try_kind (gs
) == GIMPLE_TRY_FINALLY
)
1250 newline_and_indent (buffer
, spc
);
1251 pp_string (buffer
, "finally");
1252 newline_and_indent (buffer
, spc
+ 2);
1253 pp_left_brace (buffer
);
1255 if (seq
&& is_a
<geh_else
*> (gimple_seq_first_stmt (seq
))
1256 && gimple_seq_nondebug_singleton_p (seq
))
1258 geh_else
*stmt
= as_a
<geh_else
*> (gimple_seq_first_stmt (seq
));
1259 seq
= gimple_eh_else_n_body (stmt
);
1260 pp_newline (buffer
);
1261 dump_gimple_seq (buffer
, seq
, spc
+ 4, flags
);
1262 newline_and_indent (buffer
, spc
+ 2);
1263 pp_right_brace (buffer
);
1264 seq
= gimple_eh_else_e_body (stmt
);
1265 newline_and_indent (buffer
, spc
);
1266 pp_string (buffer
, "else");
1267 newline_and_indent (buffer
, spc
+ 2);
1268 pp_left_brace (buffer
);
1272 pp_string (buffer
, " <UNKNOWN GIMPLE_TRY> {");
1274 pp_newline (buffer
);
1275 dump_gimple_seq (buffer
, seq
, spc
+ 4, flags
);
1276 newline_and_indent (buffer
, spc
+ 2);
1277 pp_right_brace (buffer
);
1282 /* Dump a GIMPLE_CATCH tuple on the pretty_printer BUFFER, SPC spaces of
1283 indent. FLAGS specifies details to show in the dump (see TDF_* in
1287 dump_gimple_catch (pretty_printer
*buffer
, const gcatch
*gs
, int spc
,
1290 if (flags
& TDF_RAW
)
1291 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %+CATCH <%S>%->", gs
,
1292 gimple_catch_types (gs
), gimple_catch_handler (gs
));
1294 dump_gimple_fmt (buffer
, spc
, flags
, "catch (%T)%+{%S}",
1295 gimple_catch_types (gs
), gimple_catch_handler (gs
));
1299 /* Dump a GIMPLE_EH_FILTER tuple on the pretty_printer BUFFER, SPC spaces of
1300 indent. FLAGS specifies details to show in the dump (see TDF_* in
1304 dump_gimple_eh_filter (pretty_printer
*buffer
, const geh_filter
*gs
, int spc
,
1307 if (flags
& TDF_RAW
)
1308 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %+FAILURE <%S>%->", gs
,
1309 gimple_eh_filter_types (gs
),
1310 gimple_eh_filter_failure (gs
));
1312 dump_gimple_fmt (buffer
, spc
, flags
, "<<<eh_filter (%T)>>>%+{%+%S%-}",
1313 gimple_eh_filter_types (gs
),
1314 gimple_eh_filter_failure (gs
));
1318 /* Dump a GIMPLE_EH_MUST_NOT_THROW tuple. */
1321 dump_gimple_eh_must_not_throw (pretty_printer
*buffer
,
1322 const geh_mnt
*gs
, int spc
, dump_flags_t flags
)
1324 if (flags
& TDF_RAW
)
1325 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
,
1326 gimple_eh_must_not_throw_fndecl (gs
));
1328 dump_gimple_fmt (buffer
, spc
, flags
, "<<<eh_must_not_throw (%T)>>>",
1329 gimple_eh_must_not_throw_fndecl (gs
));
1333 /* Dump a GIMPLE_EH_ELSE tuple on the pretty_printer BUFFER, SPC spaces of
1334 indent. FLAGS specifies details to show in the dump (see TDF_* in
1338 dump_gimple_eh_else (pretty_printer
*buffer
, const geh_else
*gs
, int spc
,
1341 if (flags
& TDF_RAW
)
1342 dump_gimple_fmt (buffer
, spc
, flags
,
1343 "%G <%+N_BODY <%S>%nE_BODY <%S>%->", gs
,
1344 gimple_eh_else_n_body (gs
), gimple_eh_else_e_body (gs
));
1346 dump_gimple_fmt (buffer
, spc
, flags
,
1347 "<<<if_normal_exit>>>%+{%S}%-<<<else_eh_exit>>>%+{%S}",
1348 gimple_eh_else_n_body (gs
), gimple_eh_else_e_body (gs
));
1352 /* Dump a GIMPLE_RESX tuple on the pretty_printer BUFFER, SPC spaces of
1353 indent. FLAGS specifies details to show in the dump (see TDF_* in
1357 dump_gimple_resx (pretty_printer
*buffer
, const gresx
*gs
, int spc
,
1360 if (flags
& TDF_RAW
)
1361 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%d>", gs
,
1362 gimple_resx_region (gs
));
1364 dump_gimple_fmt (buffer
, spc
, flags
, "resx %d", gimple_resx_region (gs
));
1367 /* Dump a GIMPLE_EH_DISPATCH tuple on the pretty_printer BUFFER. */
1370 dump_gimple_eh_dispatch (pretty_printer
*buffer
, const geh_dispatch
*gs
,
1371 int spc
, dump_flags_t flags
)
1373 if (flags
& TDF_RAW
)
1374 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%d>", gs
,
1375 gimple_eh_dispatch_region (gs
));
1377 dump_gimple_fmt (buffer
, spc
, flags
, "eh_dispatch %d",
1378 gimple_eh_dispatch_region (gs
));
1381 /* Dump a GIMPLE_DEBUG tuple on the pretty_printer BUFFER, SPC spaces
1382 of indent. FLAGS specifies details to show in the dump (see TDF_*
1386 dump_gimple_debug (pretty_printer
*buffer
, const gdebug
*gs
, int spc
,
1389 switch (gs
->subcode
)
1391 case GIMPLE_DEBUG_BIND
:
1392 if (flags
& TDF_RAW
)
1393 dump_gimple_fmt (buffer
, spc
, flags
, "%G BIND <%T, %T>", gs
,
1394 gimple_debug_bind_get_var (gs
),
1395 gimple_debug_bind_get_value (gs
));
1397 dump_gimple_fmt (buffer
, spc
, flags
, "# DEBUG %T => %T",
1398 gimple_debug_bind_get_var (gs
),
1399 gimple_debug_bind_get_value (gs
));
1402 case GIMPLE_DEBUG_SOURCE_BIND
:
1403 if (flags
& TDF_RAW
)
1404 dump_gimple_fmt (buffer
, spc
, flags
, "%G SRCBIND <%T, %T>", gs
,
1405 gimple_debug_source_bind_get_var (gs
),
1406 gimple_debug_source_bind_get_value (gs
));
1408 dump_gimple_fmt (buffer
, spc
, flags
, "# DEBUG %T s=> %T",
1409 gimple_debug_source_bind_get_var (gs
),
1410 gimple_debug_source_bind_get_value (gs
));
1413 case GIMPLE_DEBUG_BEGIN_STMT
:
1414 if (flags
& TDF_RAW
)
1415 dump_gimple_fmt (buffer
, spc
, flags
, "%G BEGIN_STMT", gs
);
1417 dump_gimple_fmt (buffer
, spc
, flags
, "# DEBUG BEGIN_STMT");
1420 case GIMPLE_DEBUG_INLINE_ENTRY
:
1421 if (flags
& TDF_RAW
)
1422 dump_gimple_fmt (buffer
, spc
, flags
, "%G INLINE_ENTRY %T", gs
,
1424 ? block_ultimate_origin (gimple_block (gs
))
1427 dump_gimple_fmt (buffer
, spc
, flags
, "# DEBUG INLINE_ENTRY %T",
1429 ? block_ultimate_origin (gimple_block (gs
))
1438 /* Dump a GIMPLE_OMP_FOR tuple on the pretty_printer BUFFER. */
1440 dump_gimple_omp_for (pretty_printer
*buffer
, const gomp_for
*gs
, int spc
,
1445 if (flags
& TDF_RAW
)
1448 switch (gimple_omp_for_kind (gs
))
1450 case GF_OMP_FOR_KIND_FOR
:
1453 case GF_OMP_FOR_KIND_DISTRIBUTE
:
1454 kind
= " distribute";
1456 case GF_OMP_FOR_KIND_TASKLOOP
:
1459 case GF_OMP_FOR_KIND_OACC_LOOP
:
1460 kind
= " oacc_loop";
1462 case GF_OMP_FOR_KIND_SIMD
:
1468 dump_gimple_fmt (buffer
, spc
, flags
, "%G%s <%+BODY <%S>%nCLAUSES <", gs
,
1469 kind
, gimple_omp_body (gs
));
1470 dump_omp_clauses (buffer
, gimple_omp_for_clauses (gs
), spc
, flags
);
1471 dump_gimple_fmt (buffer
, spc
, flags
, " >,");
1472 for (i
= 0; i
< gimple_omp_for_collapse (gs
); i
++)
1473 dump_gimple_fmt (buffer
, spc
, flags
,
1474 "%+%T, %T, %T, %s, %T,%n",
1475 gimple_omp_for_index (gs
, i
),
1476 gimple_omp_for_initial (gs
, i
),
1477 gimple_omp_for_final (gs
, i
),
1478 get_tree_code_name (gimple_omp_for_cond (gs
, i
)),
1479 gimple_omp_for_incr (gs
, i
));
1480 dump_gimple_fmt (buffer
, spc
, flags
, "PRE_BODY <%S>%->",
1481 gimple_omp_for_pre_body (gs
));
1485 switch (gimple_omp_for_kind (gs
))
1487 case GF_OMP_FOR_KIND_FOR
:
1488 pp_string (buffer
, "#pragma omp for");
1490 case GF_OMP_FOR_KIND_DISTRIBUTE
:
1491 pp_string (buffer
, "#pragma omp distribute");
1493 case GF_OMP_FOR_KIND_TASKLOOP
:
1494 pp_string (buffer
, "#pragma omp taskloop");
1496 case GF_OMP_FOR_KIND_OACC_LOOP
:
1497 pp_string (buffer
, "#pragma acc loop");
1499 case GF_OMP_FOR_KIND_SIMD
:
1500 pp_string (buffer
, "#pragma omp simd");
1505 dump_omp_clauses (buffer
, gimple_omp_for_clauses (gs
), spc
, flags
);
1506 for (i
= 0; i
< gimple_omp_for_collapse (gs
); i
++)
1510 newline_and_indent (buffer
, spc
);
1511 pp_string (buffer
, "for (");
1512 dump_generic_node (buffer
, gimple_omp_for_index (gs
, i
), spc
,
1514 pp_string (buffer
, " = ");
1515 tree init
= gimple_omp_for_initial (gs
, i
);
1516 if (TREE_CODE (init
) != TREE_VEC
)
1517 dump_generic_node (buffer
, init
, spc
, flags
, false);
1519 dump_omp_loop_non_rect_expr (buffer
, init
, spc
, flags
);
1520 pp_string (buffer
, "; ");
1522 dump_generic_node (buffer
, gimple_omp_for_index (gs
, i
), spc
,
1525 switch (gimple_omp_for_cond (gs
, i
))
1531 pp_greater (buffer
);
1534 pp_less_equal (buffer
);
1537 pp_greater_equal (buffer
);
1540 pp_string (buffer
, "!=");
1546 tree cond
= gimple_omp_for_final (gs
, i
);
1547 if (TREE_CODE (cond
) != TREE_VEC
)
1548 dump_generic_node (buffer
, cond
, spc
, flags
, false);
1550 dump_omp_loop_non_rect_expr (buffer
, cond
, spc
, flags
);
1551 pp_string (buffer
, "; ");
1553 dump_generic_node (buffer
, gimple_omp_for_index (gs
, i
), spc
,
1555 pp_string (buffer
, " = ");
1556 dump_generic_node (buffer
, gimple_omp_for_incr (gs
, i
), spc
,
1558 pp_right_paren (buffer
);
1561 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1563 newline_and_indent (buffer
, spc
+ 2);
1564 pp_left_brace (buffer
);
1565 pp_newline (buffer
);
1566 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1567 newline_and_indent (buffer
, spc
+ 2);
1568 pp_right_brace (buffer
);
1573 /* Dump a GIMPLE_OMP_CONTINUE tuple on the pretty_printer BUFFER. */
1576 dump_gimple_omp_continue (pretty_printer
*buffer
, const gomp_continue
*gs
,
1577 int spc
, dump_flags_t flags
)
1579 if (flags
& TDF_RAW
)
1581 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %T>", gs
,
1582 gimple_omp_continue_control_def (gs
),
1583 gimple_omp_continue_control_use (gs
));
1587 pp_string (buffer
, "#pragma omp continue (");
1588 dump_generic_node (buffer
, gimple_omp_continue_control_def (gs
),
1592 dump_generic_node (buffer
, gimple_omp_continue_control_use (gs
),
1594 pp_right_paren (buffer
);
1598 /* Dump a GIMPLE_OMP_SINGLE tuple on the pretty_printer BUFFER. */
1601 dump_gimple_omp_single (pretty_printer
*buffer
, const gomp_single
*gs
,
1602 int spc
, dump_flags_t flags
)
1604 if (flags
& TDF_RAW
)
1606 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1607 gimple_omp_body (gs
));
1608 dump_omp_clauses (buffer
, gimple_omp_single_clauses (gs
), spc
, flags
);
1609 dump_gimple_fmt (buffer
, spc
, flags
, " >");
1613 pp_string (buffer
, "#pragma omp single");
1614 dump_omp_clauses (buffer
, gimple_omp_single_clauses (gs
), spc
, flags
);
1615 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1617 newline_and_indent (buffer
, spc
+ 2);
1618 pp_left_brace (buffer
);
1619 pp_newline (buffer
);
1620 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1621 newline_and_indent (buffer
, spc
+ 2);
1622 pp_right_brace (buffer
);
1627 /* Dump a GIMPLE_OMP_TASKGROUP tuple on the pretty_printer BUFFER. */
1630 dump_gimple_omp_taskgroup (pretty_printer
*buffer
, const gimple
*gs
,
1631 int spc
, dump_flags_t flags
)
1633 if (flags
& TDF_RAW
)
1635 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1636 gimple_omp_body (gs
));
1637 dump_omp_clauses (buffer
, gimple_omp_taskgroup_clauses (gs
), spc
, flags
);
1638 dump_gimple_fmt (buffer
, spc
, flags
, " >");
1642 pp_string (buffer
, "#pragma omp taskgroup");
1643 dump_omp_clauses (buffer
, gimple_omp_taskgroup_clauses (gs
), spc
, flags
);
1644 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1646 newline_and_indent (buffer
, spc
+ 2);
1647 pp_left_brace (buffer
);
1648 pp_newline (buffer
);
1649 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1650 newline_and_indent (buffer
, spc
+ 2);
1651 pp_right_brace (buffer
);
1656 /* Dump a GIMPLE_OMP_TARGET tuple on the pretty_printer BUFFER. */
1659 dump_gimple_omp_target (pretty_printer
*buffer
, const gomp_target
*gs
,
1660 int spc
, dump_flags_t flags
)
1663 switch (gimple_omp_target_kind (gs
))
1665 case GF_OMP_TARGET_KIND_REGION
:
1668 case GF_OMP_TARGET_KIND_DATA
:
1671 case GF_OMP_TARGET_KIND_UPDATE
:
1674 case GF_OMP_TARGET_KIND_ENTER_DATA
:
1675 kind
= " enter data";
1677 case GF_OMP_TARGET_KIND_EXIT_DATA
:
1678 kind
= " exit data";
1680 case GF_OMP_TARGET_KIND_OACC_KERNELS
:
1681 kind
= " oacc_kernels";
1683 case GF_OMP_TARGET_KIND_OACC_PARALLEL
:
1684 kind
= " oacc_parallel";
1686 case GF_OMP_TARGET_KIND_OACC_SERIAL
:
1687 kind
= " oacc_serial";
1689 case GF_OMP_TARGET_KIND_OACC_DATA
:
1690 kind
= " oacc_data";
1692 case GF_OMP_TARGET_KIND_OACC_UPDATE
:
1693 kind
= " oacc_update";
1695 case GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA
:
1696 kind
= " oacc_enter_exit_data";
1698 case GF_OMP_TARGET_KIND_OACC_DECLARE
:
1699 kind
= " oacc_declare";
1701 case GF_OMP_TARGET_KIND_OACC_HOST_DATA
:
1702 kind
= " oacc_host_data";
1704 case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED
:
1705 kind
= " oacc_parallel_kernels_parallelized";
1707 case GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE
:
1708 kind
= " oacc_parallel_kernels_gang_single";
1710 case GF_OMP_TARGET_KIND_OACC_DATA_KERNELS
:
1711 kind
= " oacc_data_kernels";
1716 if (flags
& TDF_RAW
)
1718 dump_gimple_fmt (buffer
, spc
, flags
, "%G%s <%+BODY <%S>%nCLAUSES <", gs
,
1719 kind
, gimple_omp_body (gs
));
1720 dump_omp_clauses (buffer
, gimple_omp_target_clauses (gs
), spc
, flags
);
1721 dump_gimple_fmt (buffer
, spc
, flags
, " >, %T, %T%n>",
1722 gimple_omp_target_child_fn (gs
),
1723 gimple_omp_target_data_arg (gs
));
1727 pp_string (buffer
, "#pragma omp target");
1728 pp_string (buffer
, kind
);
1729 dump_omp_clauses (buffer
, gimple_omp_target_clauses (gs
), spc
, flags
);
1730 if (gimple_omp_target_child_fn (gs
))
1732 pp_string (buffer
, " [child fn: ");
1733 dump_generic_node (buffer
, gimple_omp_target_child_fn (gs
),
1735 pp_string (buffer
, " (");
1736 if (gimple_omp_target_data_arg (gs
))
1737 dump_generic_node (buffer
, gimple_omp_target_data_arg (gs
),
1740 pp_string (buffer
, "???");
1741 pp_string (buffer
, ")]");
1743 gimple_seq body
= gimple_omp_body (gs
);
1744 if (body
&& gimple_code (gimple_seq_first_stmt (body
)) != GIMPLE_BIND
)
1746 newline_and_indent (buffer
, spc
+ 2);
1747 pp_left_brace (buffer
);
1748 pp_newline (buffer
);
1749 dump_gimple_seq (buffer
, body
, spc
+ 4, flags
);
1750 newline_and_indent (buffer
, spc
+ 2);
1751 pp_right_brace (buffer
);
1755 pp_newline (buffer
);
1756 dump_gimple_seq (buffer
, body
, spc
+ 2, flags
);
1761 /* Dump a GIMPLE_OMP_TEAMS tuple on the pretty_printer BUFFER. */
1764 dump_gimple_omp_teams (pretty_printer
*buffer
, const gomp_teams
*gs
, int spc
,
1767 if (flags
& TDF_RAW
)
1769 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1770 gimple_omp_body (gs
));
1771 dump_omp_clauses (buffer
, gimple_omp_teams_clauses (gs
), spc
, flags
);
1772 dump_gimple_fmt (buffer
, spc
, flags
, " >");
1776 pp_string (buffer
, "#pragma omp teams");
1777 dump_omp_clauses (buffer
, gimple_omp_teams_clauses (gs
), spc
, flags
);
1778 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1780 newline_and_indent (buffer
, spc
+ 2);
1781 pp_character (buffer
, '{');
1782 pp_newline (buffer
);
1783 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1784 newline_and_indent (buffer
, spc
+ 2);
1785 pp_character (buffer
, '}');
1790 /* Dump a GIMPLE_OMP_SECTIONS tuple on the pretty_printer BUFFER. */
1793 dump_gimple_omp_sections (pretty_printer
*buffer
, const gomp_sections
*gs
,
1794 int spc
, dump_flags_t flags
)
1796 if (flags
& TDF_RAW
)
1798 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1799 gimple_omp_body (gs
));
1800 dump_omp_clauses (buffer
, gimple_omp_sections_clauses (gs
), spc
, flags
);
1801 dump_gimple_fmt (buffer
, spc
, flags
, " >");
1805 pp_string (buffer
, "#pragma omp sections");
1806 if (gimple_omp_sections_control (gs
))
1808 pp_string (buffer
, " <");
1809 dump_generic_node (buffer
, gimple_omp_sections_control (gs
), spc
,
1811 pp_greater (buffer
);
1813 dump_omp_clauses (buffer
, gimple_omp_sections_clauses (gs
), spc
, flags
);
1814 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1816 newline_and_indent (buffer
, spc
+ 2);
1817 pp_left_brace (buffer
);
1818 pp_newline (buffer
);
1819 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1820 newline_and_indent (buffer
, spc
+ 2);
1821 pp_right_brace (buffer
);
1826 /* Dump a GIMPLE_OMP_{MASTER,ORDERED,SECTION} tuple on the
1827 pretty_printer BUFFER. */
1830 dump_gimple_omp_block (pretty_printer
*buffer
, const gimple
*gs
, int spc
,
1833 if (flags
& TDF_RAW
)
1834 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S> >", gs
,
1835 gimple_omp_body (gs
));
1838 switch (gimple_code (gs
))
1840 case GIMPLE_OMP_MASTER
:
1841 pp_string (buffer
, "#pragma omp master");
1843 case GIMPLE_OMP_SECTION
:
1844 pp_string (buffer
, "#pragma omp section");
1849 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1851 newline_and_indent (buffer
, spc
+ 2);
1852 pp_left_brace (buffer
);
1853 pp_newline (buffer
);
1854 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1855 newline_and_indent (buffer
, spc
+ 2);
1856 pp_right_brace (buffer
);
1861 /* Dump a GIMPLE_OMP_CRITICAL tuple on the pretty_printer BUFFER. */
1864 dump_gimple_omp_critical (pretty_printer
*buffer
, const gomp_critical
*gs
,
1865 int spc
, dump_flags_t flags
)
1867 if (flags
& TDF_RAW
)
1868 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S> >", gs
,
1869 gimple_omp_body (gs
));
1872 pp_string (buffer
, "#pragma omp critical");
1873 if (gimple_omp_critical_name (gs
))
1875 pp_string (buffer
, " (");
1876 dump_generic_node (buffer
, gimple_omp_critical_name (gs
), spc
,
1878 pp_right_paren (buffer
);
1880 dump_omp_clauses (buffer
, gimple_omp_critical_clauses (gs
), spc
, flags
);
1881 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1883 newline_and_indent (buffer
, spc
+ 2);
1884 pp_left_brace (buffer
);
1885 pp_newline (buffer
);
1886 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1887 newline_and_indent (buffer
, spc
+ 2);
1888 pp_right_brace (buffer
);
1893 /* Dump a GIMPLE_OMP_ORDERED tuple on the pretty_printer BUFFER. */
1896 dump_gimple_omp_ordered (pretty_printer
*buffer
, const gomp_ordered
*gs
,
1897 int spc
, dump_flags_t flags
)
1899 if (flags
& TDF_RAW
)
1900 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S> >", gs
,
1901 gimple_omp_body (gs
));
1904 pp_string (buffer
, "#pragma omp ordered");
1905 dump_omp_clauses (buffer
, gimple_omp_ordered_clauses (gs
), spc
, flags
);
1906 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1908 newline_and_indent (buffer
, spc
+ 2);
1909 pp_left_brace (buffer
);
1910 pp_newline (buffer
);
1911 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1912 newline_and_indent (buffer
, spc
+ 2);
1913 pp_right_brace (buffer
);
1918 /* Dump a GIMPLE_OMP_SCAN tuple on the pretty_printer BUFFER. */
1921 dump_gimple_omp_scan (pretty_printer
*buffer
, const gomp_scan
*gs
,
1922 int spc
, dump_flags_t flags
)
1924 if (flags
& TDF_RAW
)
1925 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S> >", gs
,
1926 gimple_omp_body (gs
));
1929 if (gimple_omp_scan_clauses (gs
))
1931 pp_string (buffer
, "#pragma omp scan");
1932 dump_omp_clauses (buffer
, gimple_omp_scan_clauses (gs
), spc
, flags
);
1934 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1936 newline_and_indent (buffer
, spc
+ 2);
1937 pp_left_brace (buffer
);
1938 pp_newline (buffer
);
1939 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1940 newline_and_indent (buffer
, spc
+ 2);
1941 pp_right_brace (buffer
);
1946 /* Dump a GIMPLE_OMP_RETURN tuple on the pretty_printer BUFFER. */
1949 dump_gimple_omp_return (pretty_printer
*buffer
, const gimple
*gs
, int spc
,
1952 if (flags
& TDF_RAW
)
1954 dump_gimple_fmt (buffer
, spc
, flags
, "%G <nowait=%d", gs
,
1955 (int) gimple_omp_return_nowait_p (gs
));
1956 if (gimple_omp_return_lhs (gs
))
1957 dump_gimple_fmt (buffer
, spc
, flags
, ", lhs=%T>",
1958 gimple_omp_return_lhs (gs
));
1960 dump_gimple_fmt (buffer
, spc
, flags
, ">");
1964 pp_string (buffer
, "#pragma omp return");
1965 if (gimple_omp_return_nowait_p (gs
))
1966 pp_string (buffer
, "(nowait)");
1967 if (gimple_omp_return_lhs (gs
))
1969 pp_string (buffer
, " (set ");
1970 dump_generic_node (buffer
, gimple_omp_return_lhs (gs
),
1972 pp_character (buffer
, ')');
1977 /* Dump a GIMPLE_TRANSACTION tuple on the pretty_printer BUFFER. */
1980 dump_gimple_transaction (pretty_printer
*buffer
, const gtransaction
*gs
,
1981 int spc
, dump_flags_t flags
)
1983 unsigned subcode
= gimple_transaction_subcode (gs
);
1985 if (flags
& TDF_RAW
)
1987 dump_gimple_fmt (buffer
, spc
, flags
,
1988 "%G [SUBCODE=%x,NORM=%T,UNINST=%T,OVER=%T] "
1990 gs
, subcode
, gimple_transaction_label_norm (gs
),
1991 gimple_transaction_label_uninst (gs
),
1992 gimple_transaction_label_over (gs
),
1993 gimple_transaction_body (gs
));
1997 if (subcode
& GTMA_IS_OUTER
)
1998 pp_string (buffer
, "__transaction_atomic [[outer]]");
1999 else if (subcode
& GTMA_IS_RELAXED
)
2000 pp_string (buffer
, "__transaction_relaxed");
2002 pp_string (buffer
, "__transaction_atomic");
2003 subcode
&= ~GTMA_DECLARATION_MASK
;
2005 if (gimple_transaction_body (gs
))
2007 newline_and_indent (buffer
, spc
+ 2);
2008 pp_left_brace (buffer
);
2009 pp_newline (buffer
);
2010 dump_gimple_seq (buffer
, gimple_transaction_body (gs
),
2012 newline_and_indent (buffer
, spc
+ 2);
2013 pp_right_brace (buffer
);
2017 pp_string (buffer
, " //");
2018 if (gimple_transaction_label_norm (gs
))
2020 pp_string (buffer
, " NORM=");
2021 dump_generic_node (buffer
, gimple_transaction_label_norm (gs
),
2024 if (gimple_transaction_label_uninst (gs
))
2026 pp_string (buffer
, " UNINST=");
2027 dump_generic_node (buffer
, gimple_transaction_label_uninst (gs
),
2030 if (gimple_transaction_label_over (gs
))
2032 pp_string (buffer
, " OVER=");
2033 dump_generic_node (buffer
, gimple_transaction_label_over (gs
),
2038 pp_string (buffer
, " SUBCODE=[ ");
2039 if (subcode
& GTMA_HAVE_ABORT
)
2041 pp_string (buffer
, "GTMA_HAVE_ABORT ");
2042 subcode
&= ~GTMA_HAVE_ABORT
;
2044 if (subcode
& GTMA_HAVE_LOAD
)
2046 pp_string (buffer
, "GTMA_HAVE_LOAD ");
2047 subcode
&= ~GTMA_HAVE_LOAD
;
2049 if (subcode
& GTMA_HAVE_STORE
)
2051 pp_string (buffer
, "GTMA_HAVE_STORE ");
2052 subcode
&= ~GTMA_HAVE_STORE
;
2054 if (subcode
& GTMA_MAY_ENTER_IRREVOCABLE
)
2056 pp_string (buffer
, "GTMA_MAY_ENTER_IRREVOCABLE ");
2057 subcode
&= ~GTMA_MAY_ENTER_IRREVOCABLE
;
2059 if (subcode
& GTMA_DOES_GO_IRREVOCABLE
)
2061 pp_string (buffer
, "GTMA_DOES_GO_IRREVOCABLE ");
2062 subcode
&= ~GTMA_DOES_GO_IRREVOCABLE
;
2064 if (subcode
& GTMA_HAS_NO_INSTRUMENTATION
)
2066 pp_string (buffer
, "GTMA_HAS_NO_INSTRUMENTATION ");
2067 subcode
&= ~GTMA_HAS_NO_INSTRUMENTATION
;
2070 pp_printf (buffer
, "0x%x ", subcode
);
2071 pp_right_bracket (buffer
);
2077 /* Dump a GIMPLE_ASM tuple on the pretty_printer BUFFER, SPC spaces of
2078 indent. FLAGS specifies details to show in the dump (see TDF_* in
2082 dump_gimple_asm (pretty_printer
*buffer
, const gasm
*gs
, int spc
,
2085 unsigned int i
, n
, f
, fields
;
2087 if (flags
& TDF_RAW
)
2089 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+STRING <%n%s%n>", gs
,
2090 gimple_asm_string (gs
));
2092 n
= gimple_asm_noutputs (gs
);
2095 newline_and_indent (buffer
, spc
+ 2);
2096 pp_string (buffer
, "OUTPUT: ");
2097 for (i
= 0; i
< n
; i
++)
2099 dump_generic_node (buffer
, gimple_asm_output_op (gs
, i
),
2102 pp_string (buffer
, ", ");
2106 n
= gimple_asm_ninputs (gs
);
2109 newline_and_indent (buffer
, spc
+ 2);
2110 pp_string (buffer
, "INPUT: ");
2111 for (i
= 0; i
< n
; i
++)
2113 dump_generic_node (buffer
, gimple_asm_input_op (gs
, i
),
2116 pp_string (buffer
, ", ");
2120 n
= gimple_asm_nclobbers (gs
);
2123 newline_and_indent (buffer
, spc
+ 2);
2124 pp_string (buffer
, "CLOBBER: ");
2125 for (i
= 0; i
< n
; i
++)
2127 dump_generic_node (buffer
, gimple_asm_clobber_op (gs
, i
),
2130 pp_string (buffer
, ", ");
2134 n
= gimple_asm_nlabels (gs
);
2137 newline_and_indent (buffer
, spc
+ 2);
2138 pp_string (buffer
, "LABEL: ");
2139 for (i
= 0; i
< n
; i
++)
2141 dump_generic_node (buffer
, gimple_asm_label_op (gs
, i
),
2144 pp_string (buffer
, ", ");
2148 newline_and_indent (buffer
, spc
);
2149 pp_greater (buffer
);
2153 pp_string (buffer
, "__asm__");
2154 if (gimple_asm_volatile_p (gs
))
2155 pp_string (buffer
, " __volatile__");
2156 if (gimple_asm_inline_p (gs
))
2157 pp_string (buffer
, " __inline__");
2158 if (gimple_asm_nlabels (gs
))
2159 pp_string (buffer
, " goto");
2160 pp_string (buffer
, "(\"");
2161 pp_string (buffer
, gimple_asm_string (gs
));
2162 pp_string (buffer
, "\"");
2164 if (gimple_asm_nlabels (gs
))
2166 else if (gimple_asm_nclobbers (gs
))
2168 else if (gimple_asm_ninputs (gs
))
2170 else if (gimple_asm_noutputs (gs
))
2175 for (f
= 0; f
< fields
; ++f
)
2177 pp_string (buffer
, " : ");
2182 n
= gimple_asm_noutputs (gs
);
2183 for (i
= 0; i
< n
; i
++)
2185 dump_generic_node (buffer
, gimple_asm_output_op (gs
, i
),
2188 pp_string (buffer
, ", ");
2193 n
= gimple_asm_ninputs (gs
);
2194 for (i
= 0; i
< n
; i
++)
2196 dump_generic_node (buffer
, gimple_asm_input_op (gs
, i
),
2199 pp_string (buffer
, ", ");
2204 n
= gimple_asm_nclobbers (gs
);
2205 for (i
= 0; i
< n
; i
++)
2207 dump_generic_node (buffer
, gimple_asm_clobber_op (gs
, i
),
2210 pp_string (buffer
, ", ");
2215 n
= gimple_asm_nlabels (gs
);
2216 for (i
= 0; i
< n
; i
++)
2218 dump_generic_node (buffer
, gimple_asm_label_op (gs
, i
),
2221 pp_string (buffer
, ", ");
2230 pp_string (buffer
, ");");
2234 /* Dump ptr_info and range_info for NODE on pretty_printer BUFFER with
2235 SPC spaces of indent. */
2238 dump_ssaname_info (pretty_printer
*buffer
, tree node
, int spc
)
2240 if (TREE_CODE (node
) != SSA_NAME
)
2243 if (POINTER_TYPE_P (TREE_TYPE (node
))
2244 && SSA_NAME_PTR_INFO (node
))
2246 unsigned int align
, misalign
;
2247 struct ptr_info_def
*pi
= SSA_NAME_PTR_INFO (node
);
2248 pp_string (buffer
, "# PT = ");
2249 pp_points_to_solution (buffer
, &pi
->pt
);
2250 newline_and_indent (buffer
, spc
);
2251 if (get_ptr_info_alignment (pi
, &align
, &misalign
))
2253 pp_printf (buffer
, "# ALIGN = %u, MISALIGN = %u", align
, misalign
);
2254 newline_and_indent (buffer
, spc
);
2258 if (!POINTER_TYPE_P (TREE_TYPE (node
))
2259 && SSA_NAME_RANGE_INFO (node
))
2261 wide_int min
, max
, nonzero_bits
;
2262 value_range_kind range_type
= get_range_info (node
, &min
, &max
);
2264 if (range_type
== VR_VARYING
)
2265 pp_printf (buffer
, "# RANGE VR_VARYING");
2266 else if (range_type
== VR_RANGE
|| range_type
== VR_ANTI_RANGE
)
2268 pp_printf (buffer
, "# RANGE ");
2269 pp_printf (buffer
, "%s[", range_type
== VR_RANGE
? "" : "~");
2270 pp_wide_int (buffer
, min
, TYPE_SIGN (TREE_TYPE (node
)));
2271 pp_printf (buffer
, ", ");
2272 pp_wide_int (buffer
, max
, TYPE_SIGN (TREE_TYPE (node
)));
2273 pp_printf (buffer
, "]");
2275 nonzero_bits
= get_nonzero_bits (node
);
2276 if (nonzero_bits
!= -1)
2278 pp_string (buffer
, " NONZERO ");
2279 pp_wide_int (buffer
, nonzero_bits
, UNSIGNED
);
2281 newline_and_indent (buffer
, spc
);
2285 /* As dump_ssaname_info, but dump to FILE. */
2288 dump_ssaname_info_to_file (FILE *file
, tree node
, int spc
)
2290 pretty_printer buffer
;
2291 pp_needs_newline (&buffer
) = true;
2292 buffer
.buffer
->stream
= file
;
2293 dump_ssaname_info (&buffer
, node
, spc
);
2297 /* Dump a PHI node PHI. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.
2298 The caller is responsible for calling pp_flush on BUFFER to finalize
2299 pretty printer. If COMMENT is true, print this after #. */
2302 dump_gimple_phi (pretty_printer
*buffer
, const gphi
*phi
, int spc
, bool comment
,
2306 tree lhs
= gimple_phi_result (phi
);
2308 if (flags
& TDF_ALIAS
)
2309 dump_ssaname_info (buffer
, lhs
, spc
);
2312 pp_string (buffer
, "# ");
2314 if (flags
& TDF_RAW
)
2315 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, ", phi
,
2316 gimple_phi_result (phi
));
2319 dump_generic_node (buffer
, lhs
, spc
, flags
, false);
2320 if (flags
& TDF_GIMPLE
)
2321 pp_string (buffer
, " = __PHI (");
2323 pp_string (buffer
, " = PHI <");
2325 for (i
= 0; i
< gimple_phi_num_args (phi
); i
++)
2327 if ((flags
& TDF_LINENO
) && gimple_phi_arg_has_location (phi
, i
))
2328 dump_location (buffer
, gimple_phi_arg_location (phi
, i
));
2329 basic_block src
= gimple_phi_arg_edge (phi
, i
)->src
;
2330 if (flags
& TDF_GIMPLE
)
2332 pp_string (buffer
, "__BB");
2333 pp_decimal_int (buffer
, src
->index
);
2334 pp_string (buffer
, ": ");
2336 dump_generic_node (buffer
, gimple_phi_arg_def (phi
, i
), spc
, flags
,
2338 if (! (flags
& TDF_GIMPLE
))
2340 pp_left_paren (buffer
);
2341 pp_decimal_int (buffer
, src
->index
);
2342 pp_right_paren (buffer
);
2344 if (i
< gimple_phi_num_args (phi
) - 1)
2345 pp_string (buffer
, ", ");
2347 if (flags
& TDF_GIMPLE
)
2348 pp_string (buffer
, ");");
2350 pp_greater (buffer
);
2354 /* Dump a GIMPLE_OMP_PARALLEL tuple on the pretty_printer BUFFER, SPC spaces
2355 of indent. FLAGS specifies details to show in the dump (see TDF_* in
2359 dump_gimple_omp_parallel (pretty_printer
*buffer
, const gomp_parallel
*gs
,
2360 int spc
, dump_flags_t flags
)
2362 if (flags
& TDF_RAW
)
2364 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
2365 gimple_omp_body (gs
));
2366 dump_omp_clauses (buffer
, gimple_omp_parallel_clauses (gs
), spc
, flags
);
2367 dump_gimple_fmt (buffer
, spc
, flags
, " >, %T, %T%n>",
2368 gimple_omp_parallel_child_fn (gs
),
2369 gimple_omp_parallel_data_arg (gs
));
2374 pp_string (buffer
, "#pragma omp parallel");
2375 dump_omp_clauses (buffer
, gimple_omp_parallel_clauses (gs
), spc
, flags
);
2376 if (gimple_omp_parallel_child_fn (gs
))
2378 pp_string (buffer
, " [child fn: ");
2379 dump_generic_node (buffer
, gimple_omp_parallel_child_fn (gs
),
2381 pp_string (buffer
, " (");
2382 if (gimple_omp_parallel_data_arg (gs
))
2383 dump_generic_node (buffer
, gimple_omp_parallel_data_arg (gs
),
2386 pp_string (buffer
, "???");
2387 pp_string (buffer
, ")]");
2389 body
= gimple_omp_body (gs
);
2390 if (body
&& gimple_code (gimple_seq_first_stmt (body
)) != GIMPLE_BIND
)
2392 newline_and_indent (buffer
, spc
+ 2);
2393 pp_left_brace (buffer
);
2394 pp_newline (buffer
);
2395 dump_gimple_seq (buffer
, body
, spc
+ 4, flags
);
2396 newline_and_indent (buffer
, spc
+ 2);
2397 pp_right_brace (buffer
);
2401 pp_newline (buffer
);
2402 dump_gimple_seq (buffer
, body
, spc
+ 2, flags
);
2408 /* Dump a GIMPLE_OMP_TASK tuple on the pretty_printer BUFFER, SPC spaces
2409 of indent. FLAGS specifies details to show in the dump (see TDF_* in
2413 dump_gimple_omp_task (pretty_printer
*buffer
, const gomp_task
*gs
, int spc
,
2416 if (flags
& TDF_RAW
)
2418 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
2419 gimple_omp_body (gs
));
2420 dump_omp_clauses (buffer
, gimple_omp_task_clauses (gs
), spc
, flags
);
2421 dump_gimple_fmt (buffer
, spc
, flags
, " >, %T, %T, %T, %T, %T%n>",
2422 gimple_omp_task_child_fn (gs
),
2423 gimple_omp_task_data_arg (gs
),
2424 gimple_omp_task_copy_fn (gs
),
2425 gimple_omp_task_arg_size (gs
),
2426 gimple_omp_task_arg_size (gs
));
2431 if (gimple_omp_task_taskloop_p (gs
))
2432 pp_string (buffer
, "#pragma omp taskloop");
2433 else if (gimple_omp_task_taskwait_p (gs
))
2434 pp_string (buffer
, "#pragma omp taskwait");
2436 pp_string (buffer
, "#pragma omp task");
2437 dump_omp_clauses (buffer
, gimple_omp_task_clauses (gs
), spc
, flags
);
2438 if (gimple_omp_task_child_fn (gs
))
2440 pp_string (buffer
, " [child fn: ");
2441 dump_generic_node (buffer
, gimple_omp_task_child_fn (gs
),
2443 pp_string (buffer
, " (");
2444 if (gimple_omp_task_data_arg (gs
))
2445 dump_generic_node (buffer
, gimple_omp_task_data_arg (gs
),
2448 pp_string (buffer
, "???");
2449 pp_string (buffer
, ")]");
2451 body
= gimple_omp_body (gs
);
2452 if (body
&& gimple_code (gimple_seq_first_stmt (body
)) != GIMPLE_BIND
)
2454 newline_and_indent (buffer
, spc
+ 2);
2455 pp_left_brace (buffer
);
2456 pp_newline (buffer
);
2457 dump_gimple_seq (buffer
, body
, spc
+ 4, flags
);
2458 newline_and_indent (buffer
, spc
+ 2);
2459 pp_right_brace (buffer
);
2463 pp_newline (buffer
);
2464 dump_gimple_seq (buffer
, body
, spc
+ 2, flags
);
2470 /* Dump a GIMPLE_OMP_ATOMIC_LOAD tuple on the pretty_printer BUFFER, SPC
2471 spaces of indent. FLAGS specifies details to show in the dump (see TDF_*
2475 dump_gimple_omp_atomic_load (pretty_printer
*buffer
, const gomp_atomic_load
*gs
,
2476 int spc
, dump_flags_t flags
)
2478 if (flags
& TDF_RAW
)
2480 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %T>", gs
,
2481 gimple_omp_atomic_load_lhs (gs
),
2482 gimple_omp_atomic_load_rhs (gs
));
2486 pp_string (buffer
, "#pragma omp atomic_load");
2487 dump_omp_atomic_memory_order (buffer
,
2488 gimple_omp_atomic_memory_order (gs
));
2489 if (gimple_omp_atomic_need_value_p (gs
))
2490 pp_string (buffer
, " [needed]");
2491 newline_and_indent (buffer
, spc
+ 2);
2492 dump_generic_node (buffer
, gimple_omp_atomic_load_lhs (gs
),
2498 dump_generic_node (buffer
, gimple_omp_atomic_load_rhs (gs
),
2503 /* Dump a GIMPLE_OMP_ATOMIC_STORE tuple on the pretty_printer BUFFER, SPC
2504 spaces of indent. FLAGS specifies details to show in the dump (see TDF_*
2508 dump_gimple_omp_atomic_store (pretty_printer
*buffer
,
2509 const gomp_atomic_store
*gs
, int spc
,
2512 if (flags
& TDF_RAW
)
2514 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
,
2515 gimple_omp_atomic_store_val (gs
));
2519 pp_string (buffer
, "#pragma omp atomic_store");
2520 dump_omp_atomic_memory_order (buffer
,
2521 gimple_omp_atomic_memory_order (gs
));
2523 if (gimple_omp_atomic_need_value_p (gs
))
2524 pp_string (buffer
, "[needed] ");
2525 pp_left_paren (buffer
);
2526 dump_generic_node (buffer
, gimple_omp_atomic_store_val (gs
),
2528 pp_right_paren (buffer
);
2533 /* Dump all the memory operands for statement GS. BUFFER, SPC and
2534 FLAGS are as in pp_gimple_stmt_1. */
2537 dump_gimple_mem_ops (pretty_printer
*buffer
, const gimple
*gs
, int spc
,
2540 tree vdef
= gimple_vdef (gs
);
2541 tree vuse
= gimple_vuse (gs
);
2543 if (vdef
!= NULL_TREE
)
2545 pp_string (buffer
, "# ");
2546 dump_generic_node (buffer
, vdef
, spc
+ 2, flags
, false);
2547 pp_string (buffer
, " = VDEF <");
2548 dump_generic_node (buffer
, vuse
, spc
+ 2, flags
, false);
2549 pp_greater (buffer
);
2550 newline_and_indent (buffer
, spc
);
2552 else if (vuse
!= NULL_TREE
)
2554 pp_string (buffer
, "# VUSE <");
2555 dump_generic_node (buffer
, vuse
, spc
+ 2, flags
, false);
2556 pp_greater (buffer
);
2557 newline_and_indent (buffer
, spc
);
2562 /* Print the gimple statement GS on the pretty printer BUFFER, SPC
2563 spaces of indent. FLAGS specifies details to show in the dump (see
2564 TDF_* in dumpfile.h). The caller is responsible for calling
2565 pp_flush on BUFFER to finalize the pretty printer. */
2568 pp_gimple_stmt_1 (pretty_printer
*buffer
, const gimple
*gs
, int spc
,
2574 if (flags
& TDF_STMTADDR
)
2575 pp_printf (buffer
, "<&%p> ", (const void *) gs
);
2577 if ((flags
& TDF_LINENO
) && gimple_has_location (gs
))
2578 dump_location (buffer
, gimple_location (gs
));
2582 int lp_nr
= lookup_stmt_eh_lp (gs
);
2584 pp_printf (buffer
, "[LP %d] ", lp_nr
);
2586 pp_printf (buffer
, "[MNT %d] ", -lp_nr
);
2589 if ((flags
& (TDF_VOPS
|TDF_MEMSYMS
))
2590 && gimple_has_mem_ops (gs
))
2591 dump_gimple_mem_ops (buffer
, gs
, spc
, flags
);
2593 if (gimple_has_lhs (gs
)
2594 && (flags
& TDF_ALIAS
))
2595 dump_ssaname_info (buffer
, gimple_get_lhs (gs
), spc
);
2597 switch (gimple_code (gs
))
2600 dump_gimple_asm (buffer
, as_a
<const gasm
*> (gs
), spc
, flags
);
2604 dump_gimple_assign (buffer
, as_a
<const gassign
*> (gs
), spc
, flags
);
2608 dump_gimple_bind (buffer
, as_a
<const gbind
*> (gs
), spc
, flags
);
2612 dump_gimple_call (buffer
, as_a
<const gcall
*> (gs
), spc
, flags
);
2616 dump_gimple_cond (buffer
, as_a
<const gcond
*> (gs
), spc
, flags
);
2620 dump_gimple_label (buffer
, as_a
<const glabel
*> (gs
), spc
, flags
);
2624 dump_gimple_goto (buffer
, as_a
<const ggoto
*> (gs
), spc
, flags
);
2628 pp_string (buffer
, "GIMPLE_NOP");
2632 dump_gimple_return (buffer
, as_a
<const greturn
*> (gs
), spc
, flags
);
2636 dump_gimple_switch (buffer
, as_a
<const gswitch
*> (gs
), spc
, flags
);
2640 dump_gimple_try (buffer
, as_a
<const gtry
*> (gs
), spc
, flags
);
2644 dump_gimple_phi (buffer
, as_a
<const gphi
*> (gs
), spc
, false, flags
);
2647 case GIMPLE_OMP_PARALLEL
:
2648 dump_gimple_omp_parallel (buffer
, as_a
<const gomp_parallel
*> (gs
), spc
,
2652 case GIMPLE_OMP_TASK
:
2653 dump_gimple_omp_task (buffer
, as_a
<const gomp_task
*> (gs
), spc
, flags
);
2656 case GIMPLE_OMP_ATOMIC_LOAD
:
2657 dump_gimple_omp_atomic_load (buffer
, as_a
<const gomp_atomic_load
*> (gs
),
2661 case GIMPLE_OMP_ATOMIC_STORE
:
2662 dump_gimple_omp_atomic_store (buffer
,
2663 as_a
<const gomp_atomic_store
*> (gs
),
2667 case GIMPLE_OMP_FOR
:
2668 dump_gimple_omp_for (buffer
, as_a
<const gomp_for
*> (gs
), spc
, flags
);
2671 case GIMPLE_OMP_CONTINUE
:
2672 dump_gimple_omp_continue (buffer
, as_a
<const gomp_continue
*> (gs
), spc
,
2676 case GIMPLE_OMP_SINGLE
:
2677 dump_gimple_omp_single (buffer
, as_a
<const gomp_single
*> (gs
), spc
,
2681 case GIMPLE_OMP_TARGET
:
2682 dump_gimple_omp_target (buffer
, as_a
<const gomp_target
*> (gs
), spc
,
2686 case GIMPLE_OMP_TEAMS
:
2687 dump_gimple_omp_teams (buffer
, as_a
<const gomp_teams
*> (gs
), spc
,
2691 case GIMPLE_OMP_RETURN
:
2692 dump_gimple_omp_return (buffer
, gs
, spc
, flags
);
2695 case GIMPLE_OMP_SECTIONS
:
2696 dump_gimple_omp_sections (buffer
, as_a
<const gomp_sections
*> (gs
),
2700 case GIMPLE_OMP_SECTIONS_SWITCH
:
2701 pp_string (buffer
, "GIMPLE_SECTIONS_SWITCH");
2704 case GIMPLE_OMP_TASKGROUP
:
2705 dump_gimple_omp_taskgroup (buffer
, gs
, spc
, flags
);
2708 case GIMPLE_OMP_MASTER
:
2709 case GIMPLE_OMP_SECTION
:
2710 dump_gimple_omp_block (buffer
, gs
, spc
, flags
);
2713 case GIMPLE_OMP_ORDERED
:
2714 dump_gimple_omp_ordered (buffer
, as_a
<const gomp_ordered
*> (gs
), spc
,
2718 case GIMPLE_OMP_SCAN
:
2719 dump_gimple_omp_scan (buffer
, as_a
<const gomp_scan
*> (gs
), spc
,
2723 case GIMPLE_OMP_CRITICAL
:
2724 dump_gimple_omp_critical (buffer
, as_a
<const gomp_critical
*> (gs
), spc
,
2729 dump_gimple_catch (buffer
, as_a
<const gcatch
*> (gs
), spc
, flags
);
2732 case GIMPLE_EH_FILTER
:
2733 dump_gimple_eh_filter (buffer
, as_a
<const geh_filter
*> (gs
), spc
,
2737 case GIMPLE_EH_MUST_NOT_THROW
:
2738 dump_gimple_eh_must_not_throw (buffer
,
2739 as_a
<const geh_mnt
*> (gs
),
2743 case GIMPLE_EH_ELSE
:
2744 dump_gimple_eh_else (buffer
, as_a
<const geh_else
*> (gs
), spc
, flags
);
2748 dump_gimple_resx (buffer
, as_a
<const gresx
*> (gs
), spc
, flags
);
2751 case GIMPLE_EH_DISPATCH
:
2752 dump_gimple_eh_dispatch (buffer
, as_a
<const geh_dispatch
*> (gs
), spc
,
2757 dump_gimple_debug (buffer
, as_a
<const gdebug
*> (gs
), spc
, flags
);
2760 case GIMPLE_PREDICT
:
2761 pp_string (buffer
, "// predicted ");
2762 if (gimple_predict_outcome (gs
))
2763 pp_string (buffer
, "likely by ");
2765 pp_string (buffer
, "unlikely by ");
2766 pp_string (buffer
, predictor_name (gimple_predict_predictor (gs
)));
2767 pp_string (buffer
, " predictor.");
2770 case GIMPLE_TRANSACTION
:
2771 dump_gimple_transaction (buffer
, as_a
<const gtransaction
*> (gs
), spc
,
2781 /* Dumps header of basic block BB to OUTF indented by INDENT
2782 spaces and details described by flags. */
2785 dump_gimple_bb_header (FILE *outf
, basic_block bb
, int indent
,
2788 if (flags
& TDF_BLOCKS
)
2790 if (flags
& TDF_LINENO
)
2792 gimple_stmt_iterator gsi
;
2794 fputs (";; ", outf
);
2796 for (gsi
= gsi_start_bb (bb
); !gsi_end_p (gsi
); gsi_next (&gsi
))
2797 if (!is_gimple_debug (gsi_stmt (gsi
))
2798 && get_lineno (gsi_stmt (gsi
)) != UNKNOWN_LOCATION
)
2800 fprintf (outf
, "%*sstarting at line %d",
2801 indent
, "", get_lineno (gsi_stmt (gsi
)));
2804 if (bb
->discriminator
)
2805 fprintf (outf
, ", discriminator %i", bb
->discriminator
);
2811 if (flags
& TDF_GIMPLE
)
2813 fprintf (outf
, "%*s__BB(%d", indent
, "", bb
->index
);
2814 if (bb
->loop_father
->header
== bb
)
2815 fprintf (outf
, ",loop_header(%d)", bb
->loop_father
->num
);
2816 if (bb
->count
.initialized_p ())
2817 fprintf (outf
, ",%s(%d)",
2818 profile_quality_as_string (bb
->count
.quality ()),
2819 bb
->count
.value ());
2820 fprintf (outf
, "):\n");
2823 fprintf (outf
, "%*s<bb %d> %s:\n",
2824 indent
, "", bb
->index
, dump_profile (bb
->count
));
2829 /* Dumps end of basic block BB to buffer BUFFER indented by INDENT
2833 dump_gimple_bb_footer (FILE *outf ATTRIBUTE_UNUSED
,
2834 basic_block bb ATTRIBUTE_UNUSED
,
2835 int indent ATTRIBUTE_UNUSED
,
2836 dump_flags_t flags ATTRIBUTE_UNUSED
)
2838 /* There is currently no GIMPLE-specific basic block info to dump. */
2843 /* Dump PHI nodes of basic block BB to BUFFER with details described
2844 by FLAGS and indented by INDENT spaces. */
2847 dump_phi_nodes (pretty_printer
*buffer
, basic_block bb
, int indent
,
2852 for (i
= gsi_start_phis (bb
); !gsi_end_p (i
); gsi_next (&i
))
2854 gphi
*phi
= i
.phi ();
2855 if (!virtual_operand_p (gimple_phi_result (phi
)) || (flags
& TDF_VOPS
))
2858 dump_gimple_phi (buffer
, phi
, indent
,
2859 (flags
& TDF_GIMPLE
) ? false : true, flags
);
2860 pp_newline (buffer
);
2866 /* Dump jump to basic block BB that is represented implicitly in the cfg
2870 pp_cfg_jump (pretty_printer
*buffer
, edge e
, dump_flags_t flags
)
2872 if (flags
& TDF_GIMPLE
)
2874 pp_string (buffer
, "goto __BB");
2875 pp_decimal_int (buffer
, e
->dest
->index
);
2876 if (e
->probability
.initialized_p ())
2878 pp_string (buffer
, "(");
2880 profile_quality_as_string (e
->probability
.quality ()));
2881 pp_string (buffer
, "(");
2882 pp_decimal_int (buffer
, e
->probability
.value ());
2883 pp_string (buffer
, "))");
2885 pp_semicolon (buffer
);
2889 pp_string (buffer
, "goto <bb ");
2890 pp_decimal_int (buffer
, e
->dest
->index
);
2891 pp_greater (buffer
);
2892 pp_semicolon (buffer
);
2894 dump_edge_probability (buffer
, e
);
2899 /* Dump edges represented implicitly in basic block BB to BUFFER, indented
2900 by INDENT spaces, with details given by FLAGS. */
2903 dump_implicit_edges (pretty_printer
*buffer
, basic_block bb
, int indent
,
2909 stmt
= last_stmt (bb
);
2911 if (stmt
&& gimple_code (stmt
) == GIMPLE_COND
)
2913 edge true_edge
, false_edge
;
2915 /* When we are emitting the code or changing CFG, it is possible that
2916 the edges are not yet created. When we are using debug_bb in such
2917 a situation, we do not want it to crash. */
2918 if (EDGE_COUNT (bb
->succs
) != 2)
2920 extract_true_false_edges_from_block (bb
, &true_edge
, &false_edge
);
2922 INDENT (indent
+ 2);
2923 pp_cfg_jump (buffer
, true_edge
, flags
);
2924 newline_and_indent (buffer
, indent
);
2925 pp_string (buffer
, "else");
2926 newline_and_indent (buffer
, indent
+ 2);
2927 pp_cfg_jump (buffer
, false_edge
, flags
);
2928 pp_newline (buffer
);
2932 /* If there is a fallthru edge, we may need to add an artificial
2933 goto to the dump. */
2934 e
= find_fallthru_edge (bb
->succs
);
2936 if (e
&& (e
->dest
!= bb
->next_bb
|| (flags
& TDF_GIMPLE
)))
2940 if ((flags
& TDF_LINENO
)
2941 && e
->goto_locus
!= UNKNOWN_LOCATION
)
2942 dump_location (buffer
, e
->goto_locus
);
2944 pp_cfg_jump (buffer
, e
, flags
);
2945 pp_newline (buffer
);
2950 /* Dumps basic block BB to buffer BUFFER with details described by FLAGS and
2951 indented by INDENT spaces. */
2954 gimple_dump_bb_buff (pretty_printer
*buffer
, basic_block bb
, int indent
,
2957 gimple_stmt_iterator gsi
;
2959 int label_indent
= indent
- 2;
2961 if (label_indent
< 0)
2964 dump_phi_nodes (buffer
, bb
, indent
, flags
);
2966 for (gsi
= gsi_start_bb (bb
); !gsi_end_p (gsi
); gsi_next (&gsi
))
2970 stmt
= gsi_stmt (gsi
);
2972 curr_indent
= gimple_code (stmt
) == GIMPLE_LABEL
? label_indent
: indent
;
2974 INDENT (curr_indent
);
2975 pp_gimple_stmt_1 (buffer
, stmt
, curr_indent
, flags
);
2976 pp_newline_and_flush (buffer
);
2977 gcc_checking_assert (DECL_STRUCT_FUNCTION (current_function_decl
));
2978 dump_histograms_for_stmt (DECL_STRUCT_FUNCTION (current_function_decl
),
2979 pp_buffer (buffer
)->stream
, stmt
);
2982 dump_implicit_edges (buffer
, bb
, indent
, flags
);
2987 /* Dumps basic block BB to FILE with details described by FLAGS and
2988 indented by INDENT spaces. */
2991 gimple_dump_bb (FILE *file
, basic_block bb
, int indent
, dump_flags_t flags
)
2993 dump_gimple_bb_header (file
, bb
, indent
, flags
);
2994 if (bb
->index
>= NUM_FIXED_BLOCKS
)
2996 pretty_printer buffer
;
2997 pp_needs_newline (&buffer
) = true;
2998 buffer
.buffer
->stream
= file
;
2999 gimple_dump_bb_buff (&buffer
, bb
, indent
, flags
);
3001 dump_gimple_bb_footer (file
, bb
, indent
, flags
);
3004 /* Dumps basic block BB to pretty-printer PP with default dump flags and
3005 no indentation, for use as a label of a DOT graph record-node.
3006 ??? Should just use gimple_dump_bb_buff here, except that value profiling
3007 histogram dumping doesn't know about pretty-printers. */
3010 gimple_dump_bb_for_graph (pretty_printer
*pp
, basic_block bb
)
3012 pp_printf (pp
, "<bb %d>:\n", bb
->index
);
3013 pp_write_text_as_dot_label_to_stream (pp
, /*for_record=*/true);
3015 for (gphi_iterator gsi
= gsi_start_phis (bb
); !gsi_end_p (gsi
);
3018 gphi
*phi
= gsi
.phi ();
3019 if (!virtual_operand_p (gimple_phi_result (phi
))
3020 || (dump_flags
& TDF_VOPS
))
3023 pp_write_text_to_stream (pp
);
3024 pp_string (pp
, "# ");
3025 pp_gimple_stmt_1 (pp
, phi
, 0, dump_flags
);
3027 pp_write_text_as_dot_label_to_stream (pp
, /*for_record=*/true);
3031 for (gimple_stmt_iterator gsi
= gsi_start_bb (bb
); !gsi_end_p (gsi
);
3034 gimple
*stmt
= gsi_stmt (gsi
);
3036 pp_write_text_to_stream (pp
);
3037 pp_gimple_stmt_1 (pp
, stmt
, 0, dump_flags
);
3039 pp_write_text_as_dot_label_to_stream (pp
, /*for_record=*/true);
3041 dump_implicit_edges (pp
, bb
, 0, dump_flags
);
3042 pp_write_text_as_dot_label_to_stream (pp
, /*for_record=*/true);
3046 /* Handle the %G format for TEXT. Same as %K in handle_K_format in
3047 tree-pretty-print.c but with a Gimple statement as an argument. */
3050 percent_G_format (text_info
*text
)
3052 gimple
*stmt
= va_arg (*text
->args_ptr
, gimple
*);
3054 /* Fall back on the rich location if the statement doesn't have one. */
3055 location_t loc
= gimple_location (stmt
);
3056 if (loc
== UNKNOWN_LOCATION
)
3057 loc
= text
->m_richloc
->get_loc ();
3058 tree block
= gimple_block (stmt
);
3059 percent_K_format (text
, loc
, block
);
3063 # pragma GCC diagnostic pop