1 /* Pretty formatting of GIMPLE statements and expressions.
2 Copyright (C) 2001-2013 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"
27 #include "diagnostic.h"
28 #include "gimple-pretty-print.h"
31 #include "dumpfile.h" /* for dump_flags */
33 #include "value-prof.h"
34 #include "trans-mem.h"
36 #define INDENT(SPACE) \
37 do { int i; for (i = 0; i < SPACE; i++) pp_space (buffer); } while (0)
39 #define GIMPLE_NIY do_niy (buffer,gs)
41 /* Try to print on BUFFER a default message for the unrecognized
42 gimple statement GS. */
45 do_niy (pretty_printer
*buffer
, gimple gs
)
47 pp_printf (buffer
, "<<< Unknown GIMPLE statement: %s >>>\n",
48 gimple_code_name
[(int) gimple_code (gs
)]);
52 /* Emit a newline and SPC indentation spaces to BUFFER. */
55 newline_and_indent (pretty_printer
*buffer
, int spc
)
62 /* Print the GIMPLE statement GS on stderr. */
65 debug_gimple_stmt (gimple gs
)
67 print_gimple_stmt (stderr
, gs
, 0, TDF_VOPS
|TDF_MEMSYMS
);
71 /* Print GIMPLE statement G to FILE using SPC indentation spaces and
72 FLAGS as in pp_gimple_stmt_1. */
75 print_gimple_stmt (FILE *file
, gimple g
, int spc
, int flags
)
77 pretty_printer buffer
;
78 pp_needs_newline (&buffer
) = true;
79 buffer
.buffer
->stream
= file
;
80 pp_gimple_stmt_1 (&buffer
, g
, spc
, flags
);
81 pp_newline_and_flush (&buffer
);
85 debug (gimple_statement_d
&ref
)
87 print_gimple_stmt (stderr
, &ref
, 0, 0);
91 debug (gimple_statement_d
*ptr
)
96 fprintf (stderr
, "<nil>\n");
100 /* Print GIMPLE statement G to FILE using SPC indentation spaces and
101 FLAGS as in pp_gimple_stmt_1. Print only the right-hand side
105 print_gimple_expr (FILE *file
, gimple g
, int spc
, int flags
)
107 flags
|= TDF_RHS_ONLY
;
108 pretty_printer buffer
;
109 pp_needs_newline (&buffer
) = true;
110 buffer
.buffer
->stream
= file
;
111 pp_gimple_stmt_1 (&buffer
, g
, spc
, flags
);
116 /* Print the GIMPLE sequence SEQ on BUFFER using SPC indentation
117 spaces and FLAGS as in pp_gimple_stmt_1.
118 The caller is responsible for calling pp_flush on BUFFER to finalize
119 the pretty printer. */
122 dump_gimple_seq (pretty_printer
*buffer
, gimple_seq seq
, int spc
, int flags
)
124 gimple_stmt_iterator i
;
126 for (i
= gsi_start (seq
); !gsi_end_p (i
); gsi_next (&i
))
128 gimple gs
= gsi_stmt (i
);
130 pp_gimple_stmt_1 (buffer
, gs
, spc
, flags
);
131 if (!gsi_one_before_end_p (i
))
137 /* Print GIMPLE sequence SEQ to FILE using SPC indentation spaces and
138 FLAGS as in pp_gimple_stmt_1. */
141 print_gimple_seq (FILE *file
, gimple_seq seq
, int spc
, int flags
)
143 pretty_printer buffer
;
144 pp_needs_newline (&buffer
) = true;
145 buffer
.buffer
->stream
= file
;
146 dump_gimple_seq (&buffer
, seq
, spc
, flags
);
147 pp_newline_and_flush (&buffer
);
151 /* Print the GIMPLE sequence SEQ on stderr. */
154 debug_gimple_seq (gimple_seq seq
)
156 print_gimple_seq (stderr
, seq
, 0, TDF_VOPS
|TDF_MEMSYMS
);
160 /* A simple helper to pretty-print some of the gimple tuples in the printf
161 style. The format modifiers are preceded by '%' and are:
162 'G' - outputs a string corresponding to the code of the given gimple,
163 'S' - outputs a gimple_seq with indent of spc + 2,
164 'T' - outputs the tree t,
165 'd' - outputs an int as a decimal,
166 's' - outputs a string,
167 'n' - outputs a newline,
168 'x' - outputs an int as hexadecimal,
169 '+' - increases indent by 2 then outputs a newline,
170 '-' - decreases indent by 2 then outputs a newline. */
173 dump_gimple_fmt (pretty_printer
*buffer
, int spc
, int flags
,
174 const char *fmt
, ...)
180 va_start (args
, fmt
);
181 for (c
= fmt
; *c
; c
++)
191 g
= va_arg (args
, gimple
);
192 tmp
= gimple_code_name
[gimple_code (g
)];
193 pp_string (buffer
, tmp
);
197 seq
= va_arg (args
, gimple_seq
);
199 dump_gimple_seq (buffer
, seq
, spc
+ 2, flags
);
200 newline_and_indent (buffer
, spc
);
204 t
= va_arg (args
, tree
);
206 pp_string (buffer
, "NULL");
208 dump_generic_node (buffer
, t
, spc
, flags
, false);
212 pp_decimal_int (buffer
, va_arg (args
, int));
216 pp_string (buffer
, va_arg (args
, char *));
220 newline_and_indent (buffer
, spc
);
224 pp_scalar (buffer
, "%x", va_arg (args
, int));
229 newline_and_indent (buffer
, spc
);
234 newline_and_indent (buffer
, spc
);
242 pp_character (buffer
, *c
);
248 /* Helper for dump_gimple_assign. Print the unary RHS of the
249 assignment GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1. */
252 dump_unary_rhs (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
254 enum tree_code rhs_code
= gimple_assign_rhs_code (gs
);
255 tree lhs
= gimple_assign_lhs (gs
);
256 tree rhs
= gimple_assign_rhs1 (gs
);
260 case VIEW_CONVERT_EXPR
:
262 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
265 case FIXED_CONVERT_EXPR
:
266 case ADDR_SPACE_CONVERT_EXPR
:
270 pp_left_paren (buffer
);
271 dump_generic_node (buffer
, TREE_TYPE (lhs
), spc
, flags
, false);
272 pp_string (buffer
, ") ");
273 if (op_prio (rhs
) < op_code_prio (rhs_code
))
275 pp_left_paren (buffer
);
276 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
277 pp_right_paren (buffer
);
280 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
284 pp_string (buffer
, "((");
285 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
286 pp_string (buffer
, "))");
290 pp_string (buffer
, "ABS_EXPR <");
291 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
296 if (TREE_CODE_CLASS (rhs_code
) == tcc_declaration
297 || TREE_CODE_CLASS (rhs_code
) == tcc_constant
298 || TREE_CODE_CLASS (rhs_code
) == tcc_reference
299 || rhs_code
== SSA_NAME
300 || rhs_code
== ADDR_EXPR
301 || rhs_code
== CONSTRUCTOR
)
303 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
306 else if (rhs_code
== BIT_NOT_EXPR
)
307 pp_complement (buffer
);
308 else if (rhs_code
== TRUTH_NOT_EXPR
)
309 pp_exclamation (buffer
);
310 else if (rhs_code
== NEGATE_EXPR
)
314 pp_left_bracket (buffer
);
315 pp_string (buffer
, tree_code_name
[rhs_code
]);
316 pp_string (buffer
, "] ");
319 if (op_prio (rhs
) < op_code_prio (rhs_code
))
321 pp_left_paren (buffer
);
322 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
323 pp_right_paren (buffer
);
326 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
332 /* Helper for dump_gimple_assign. Print the binary RHS of the
333 assignment GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1. */
336 dump_binary_rhs (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
339 enum tree_code code
= gimple_assign_rhs_code (gs
);
345 case VEC_WIDEN_MULT_HI_EXPR
:
346 case VEC_WIDEN_MULT_LO_EXPR
:
347 case VEC_WIDEN_MULT_EVEN_EXPR
:
348 case VEC_WIDEN_MULT_ODD_EXPR
:
349 case VEC_PACK_TRUNC_EXPR
:
350 case VEC_PACK_SAT_EXPR
:
351 case VEC_PACK_FIX_TRUNC_EXPR
:
352 case VEC_WIDEN_LSHIFT_HI_EXPR
:
353 case VEC_WIDEN_LSHIFT_LO_EXPR
:
354 for (p
= tree_code_name
[(int) code
]; *p
; p
++)
355 pp_character (buffer
, TOUPPER (*p
));
356 pp_string (buffer
, " <");
357 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
358 pp_string (buffer
, ", ");
359 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
364 if (op_prio (gimple_assign_rhs1 (gs
)) <= op_code_prio (code
))
366 pp_left_paren (buffer
);
367 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
,
369 pp_right_paren (buffer
);
372 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
374 pp_string (buffer
, op_symbol_code (gimple_assign_rhs_code (gs
)));
376 if (op_prio (gimple_assign_rhs2 (gs
)) <= op_code_prio (code
))
378 pp_left_paren (buffer
);
379 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
,
381 pp_right_paren (buffer
);
384 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
388 /* Helper for dump_gimple_assign. Print the ternary RHS of the
389 assignment GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1. */
392 dump_ternary_rhs (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
395 enum tree_code code
= gimple_assign_rhs_code (gs
);
398 case WIDEN_MULT_PLUS_EXPR
:
399 case WIDEN_MULT_MINUS_EXPR
:
400 for (p
= tree_code_name
[(int) code
]; *p
; p
++)
401 pp_character (buffer
, TOUPPER (*p
));
402 pp_string (buffer
, " <");
403 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
404 pp_string (buffer
, ", ");
405 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
406 pp_string (buffer
, ", ");
407 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
412 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
413 pp_string (buffer
, " * ");
414 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
415 pp_string (buffer
, " + ");
416 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
420 pp_string (buffer
, "DOT_PROD_EXPR <");
421 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
422 pp_string (buffer
, ", ");
423 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
424 pp_string (buffer
, ", ");
425 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
430 pp_string (buffer
, "VEC_PERM_EXPR <");
431 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
432 pp_string (buffer
, ", ");
433 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
434 pp_string (buffer
, ", ");
435 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
439 case REALIGN_LOAD_EXPR
:
440 pp_string (buffer
, "REALIGN_LOAD <");
441 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
442 pp_string (buffer
, ", ");
443 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
444 pp_string (buffer
, ", ");
445 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
450 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
451 pp_string (buffer
, " ? ");
452 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
453 pp_string (buffer
, " : ");
454 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
458 pp_string (buffer
, "VEC_COND_EXPR <");
459 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
460 pp_string (buffer
, ", ");
461 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
462 pp_string (buffer
, ", ");
463 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
473 /* Dump the gimple assignment GS. BUFFER, SPC and FLAGS are as in
477 dump_gimple_assign (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
484 switch (gimple_num_ops (gs
))
487 arg3
= gimple_assign_rhs3 (gs
);
489 arg2
= gimple_assign_rhs2 (gs
);
491 arg1
= gimple_assign_rhs1 (gs
);
497 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%s, %T, %T, %T, %T>", gs
,
498 tree_code_name
[gimple_assign_rhs_code (gs
)],
499 gimple_assign_lhs (gs
), arg1
, arg2
, arg3
);
503 if (!(flags
& TDF_RHS_ONLY
))
505 dump_generic_node (buffer
, gimple_assign_lhs (gs
), spc
, flags
, false);
509 if (gimple_assign_nontemporal_move_p (gs
))
510 pp_string (buffer
, "{nt}");
512 if (gimple_has_volatile_ops (gs
))
513 pp_string (buffer
, "{v}");
518 if (gimple_num_ops (gs
) == 2)
519 dump_unary_rhs (buffer
, gs
, spc
, flags
);
520 else if (gimple_num_ops (gs
) == 3)
521 dump_binary_rhs (buffer
, gs
, spc
, flags
);
522 else if (gimple_num_ops (gs
) == 4)
523 dump_ternary_rhs (buffer
, gs
, spc
, flags
);
526 if (!(flags
& TDF_RHS_ONLY
))
527 pp_semicolon(buffer
);
532 /* Dump the return statement GS. BUFFER, SPC and FLAGS are as in
536 dump_gimple_return (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
540 t
= gimple_return_retval (gs
);
542 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
, t
);
545 pp_string (buffer
, "return");
549 dump_generic_node (buffer
, t
, spc
, flags
, false);
551 pp_semicolon (buffer
);
556 /* Dump the call arguments for a gimple call. BUFFER, FLAGS are as in
560 dump_gimple_call_args (pretty_printer
*buffer
, gimple gs
, int flags
)
564 for (i
= 0; i
< gimple_call_num_args (gs
); i
++)
566 dump_generic_node (buffer
, gimple_call_arg (gs
, i
), 0, flags
, false);
567 if (i
< gimple_call_num_args (gs
) - 1)
568 pp_string (buffer
, ", ");
571 if (gimple_call_va_arg_pack_p (gs
))
573 if (gimple_call_num_args (gs
) > 0)
579 pp_string (buffer
, "__builtin_va_arg_pack ()");
583 /* Dump the points-to solution *PT to BUFFER. */
586 pp_points_to_solution (pretty_printer
*buffer
, struct pt_solution
*pt
)
590 pp_string (buffer
, "anything ");
594 pp_string (buffer
, "nonlocal ");
596 pp_string (buffer
, "escaped ");
598 pp_string (buffer
, "unit-escaped ");
600 pp_string (buffer
, "null ");
602 && !bitmap_empty_p (pt
->vars
))
606 pp_string (buffer
, "{ ");
607 EXECUTE_IF_SET_IN_BITMAP (pt
->vars
, 0, i
, bi
)
609 pp_string (buffer
, "D.");
610 pp_decimal_int (buffer
, i
);
613 pp_right_brace (buffer
);
614 if (pt
->vars_contains_global
)
615 pp_string (buffer
, " (glob)");
619 /* Dump the call statement GS. BUFFER, SPC and FLAGS are as in
623 dump_gimple_call (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
625 tree lhs
= gimple_call_lhs (gs
);
626 tree fn
= gimple_call_fn (gs
);
628 if (flags
& TDF_ALIAS
)
630 struct pt_solution
*pt
;
631 pt
= gimple_call_use_set (gs
);
632 if (!pt_solution_empty_p (pt
))
634 pp_string (buffer
, "# USE = ");
635 pp_points_to_solution (buffer
, pt
);
636 newline_and_indent (buffer
, spc
);
638 pt
= gimple_call_clobber_set (gs
);
639 if (!pt_solution_empty_p (pt
))
641 pp_string (buffer
, "# CLB = ");
642 pp_points_to_solution (buffer
, pt
);
643 newline_and_indent (buffer
, spc
);
649 if (gimple_call_internal_p (gs
))
650 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%s, %T", gs
,
651 internal_fn_name (gimple_call_internal_fn (gs
)), lhs
);
653 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %T", gs
, fn
, lhs
);
654 if (gimple_call_num_args (gs
) > 0)
656 pp_string (buffer
, ", ");
657 dump_gimple_call_args (buffer
, gs
, flags
);
663 if (lhs
&& !(flags
& TDF_RHS_ONLY
))
665 dump_generic_node (buffer
, lhs
, spc
, flags
, false);
666 pp_string (buffer
, " =");
668 if (gimple_has_volatile_ops (gs
))
669 pp_string (buffer
, "{v}");
673 if (gimple_call_internal_p (gs
))
674 pp_string (buffer
, internal_fn_name (gimple_call_internal_fn (gs
)));
676 print_call_name (buffer
, fn
, flags
);
677 pp_string (buffer
, " (");
678 dump_gimple_call_args (buffer
, gs
, flags
);
679 pp_right_paren (buffer
);
680 if (!(flags
& TDF_RHS_ONLY
))
681 pp_semicolon (buffer
);
684 if (gimple_call_chain (gs
))
686 pp_string (buffer
, " [static-chain: ");
687 dump_generic_node (buffer
, gimple_call_chain (gs
), spc
, flags
, false);
688 pp_right_bracket (buffer
);
691 if (gimple_call_return_slot_opt_p (gs
))
692 pp_string (buffer
, " [return slot optimization]");
693 if (gimple_call_tail_p (gs
))
694 pp_string (buffer
, " [tail call]");
699 /* Dump the arguments of _ITM_beginTransaction sanely. */
700 if (TREE_CODE (fn
) == ADDR_EXPR
)
701 fn
= TREE_OPERAND (fn
, 0);
702 if (TREE_CODE (fn
) == FUNCTION_DECL
&& decl_is_tm_clone (fn
))
703 pp_string (buffer
, " [tm-clone]");
704 if (TREE_CODE (fn
) == FUNCTION_DECL
705 && DECL_BUILT_IN_CLASS (fn
) == BUILT_IN_NORMAL
706 && DECL_FUNCTION_CODE (fn
) == BUILT_IN_TM_START
707 && gimple_call_num_args (gs
) > 0)
709 tree t
= gimple_call_arg (gs
, 0);
710 unsigned HOST_WIDE_INT props
;
711 gcc_assert (TREE_CODE (t
) == INTEGER_CST
);
713 pp_string (buffer
, " [ ");
715 /* Get the transaction code properties. */
716 props
= TREE_INT_CST_LOW (t
);
718 if (props
& PR_INSTRUMENTEDCODE
)
719 pp_string (buffer
, "instrumentedCode ");
720 if (props
& PR_UNINSTRUMENTEDCODE
)
721 pp_string (buffer
, "uninstrumentedCode ");
722 if (props
& PR_HASNOXMMUPDATE
)
723 pp_string (buffer
, "hasNoXMMUpdate ");
724 if (props
& PR_HASNOABORT
)
725 pp_string (buffer
, "hasNoAbort ");
726 if (props
& PR_HASNOIRREVOCABLE
)
727 pp_string (buffer
, "hasNoIrrevocable ");
728 if (props
& PR_DOESGOIRREVOCABLE
)
729 pp_string (buffer
, "doesGoIrrevocable ");
730 if (props
& PR_HASNOSIMPLEREADS
)
731 pp_string (buffer
, "hasNoSimpleReads ");
732 if (props
& PR_AWBARRIERSOMITTED
)
733 pp_string (buffer
, "awBarriersOmitted ");
734 if (props
& PR_RARBARRIERSOMITTED
)
735 pp_string (buffer
, "RaRBarriersOmitted ");
736 if (props
& PR_UNDOLOGCODE
)
737 pp_string (buffer
, "undoLogCode ");
738 if (props
& PR_PREFERUNINSTRUMENTED
)
739 pp_string (buffer
, "preferUninstrumented ");
740 if (props
& PR_EXCEPTIONBLOCK
)
741 pp_string (buffer
, "exceptionBlock ");
742 if (props
& PR_HASELSE
)
743 pp_string (buffer
, "hasElse ");
744 if (props
& PR_READONLY
)
745 pp_string (buffer
, "readOnly ");
747 pp_right_bracket (buffer
);
752 /* Dump the switch statement GS. BUFFER, SPC and FLAGS are as in
756 dump_gimple_switch (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
760 GIMPLE_CHECK (gs
, GIMPLE_SWITCH
);
762 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, ", gs
,
763 gimple_switch_index (gs
));
766 pp_string (buffer
, "switch (");
767 dump_generic_node (buffer
, gimple_switch_index (gs
), spc
, flags
, true);
768 pp_string (buffer
, ") <");
771 for (i
= 0; i
< gimple_switch_num_labels (gs
); i
++)
773 tree case_label
= gimple_switch_label (gs
, i
);
774 gcc_checking_assert (case_label
!= NULL_TREE
);
775 dump_generic_node (buffer
, case_label
, spc
, flags
, false);
777 dump_generic_node (buffer
, CASE_LABEL (case_label
), spc
, flags
, false);
778 if (i
< gimple_switch_num_labels (gs
) - 1)
779 pp_string (buffer
, ", ");
785 /* Dump the gimple conditional GS. BUFFER, SPC and FLAGS are as in
789 dump_gimple_cond (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
792 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%s, %T, %T, %T, %T>", gs
,
793 tree_code_name
[gimple_cond_code (gs
)],
794 gimple_cond_lhs (gs
), gimple_cond_rhs (gs
),
795 gimple_cond_true_label (gs
), gimple_cond_false_label (gs
));
798 if (!(flags
& TDF_RHS_ONLY
))
799 pp_string (buffer
, "if (");
800 dump_generic_node (buffer
, gimple_cond_lhs (gs
), spc
, flags
, false);
802 pp_string (buffer
, op_symbol_code (gimple_cond_code (gs
)));
804 dump_generic_node (buffer
, gimple_cond_rhs (gs
), spc
, flags
, false);
805 if (!(flags
& TDF_RHS_ONLY
))
807 pp_right_paren (buffer
);
809 if (gimple_cond_true_label (gs
))
811 pp_string (buffer
, " goto ");
812 dump_generic_node (buffer
, gimple_cond_true_label (gs
),
814 pp_semicolon (buffer
);
816 if (gimple_cond_false_label (gs
))
818 pp_string (buffer
, " else goto ");
819 dump_generic_node (buffer
, gimple_cond_false_label (gs
),
821 pp_semicolon (buffer
);
828 /* Dump a GIMPLE_LABEL tuple on the pretty_printer BUFFER, SPC
829 spaces of indent. FLAGS specifies details to show in the dump (see
830 TDF_* in dumpfils.h). */
833 dump_gimple_label (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
835 tree label
= gimple_label_label (gs
);
837 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
, label
);
840 dump_generic_node (buffer
, label
, spc
, flags
, false);
843 if (DECL_NONLOCAL (label
))
844 pp_string (buffer
, " [non-local]");
845 if ((flags
& TDF_EH
) && EH_LANDING_PAD_NR (label
))
846 pp_printf (buffer
, " [LP %d]", EH_LANDING_PAD_NR (label
));
849 /* Dump a GIMPLE_GOTO tuple on the pretty_printer BUFFER, SPC
850 spaces of indent. FLAGS specifies details to show in the dump (see
851 TDF_* in dumpfile.h). */
854 dump_gimple_goto (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
856 tree label
= gimple_goto_dest (gs
);
858 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
, label
);
860 dump_gimple_fmt (buffer
, spc
, flags
, "goto %T;", label
);
864 /* Dump a GIMPLE_BIND tuple on the pretty_printer BUFFER, SPC
865 spaces of indent. FLAGS specifies details to show in the dump (see
866 TDF_* in dumpfile.h). */
869 dump_gimple_bind (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
872 dump_gimple_fmt (buffer
, spc
, flags
, "%G <", gs
);
874 pp_left_brace (buffer
);
875 if (!(flags
& TDF_SLIM
))
879 for (var
= gimple_bind_vars (gs
); var
; var
= DECL_CHAIN (var
))
881 newline_and_indent (buffer
, 2);
882 print_declaration (buffer
, var
, spc
, flags
);
884 if (gimple_bind_vars (gs
))
888 dump_gimple_seq (buffer
, gimple_bind_body (gs
), spc
+ 2, flags
);
889 newline_and_indent (buffer
, spc
);
893 pp_right_brace (buffer
);
897 /* Dump a GIMPLE_TRY tuple on the pretty_printer BUFFER, SPC spaces of
898 indent. FLAGS specifies details to show in the dump (see TDF_* in
902 dump_gimple_try (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
907 if (gimple_try_kind (gs
) == GIMPLE_TRY_CATCH
)
908 type
= "GIMPLE_TRY_CATCH";
909 else if (gimple_try_kind (gs
) == GIMPLE_TRY_FINALLY
)
910 type
= "GIMPLE_TRY_FINALLY";
912 type
= "UNKNOWN GIMPLE_TRY";
913 dump_gimple_fmt (buffer
, spc
, flags
,
914 "%G <%s,%+EVAL <%S>%nCLEANUP <%S>%->", gs
, type
,
915 gimple_try_eval (gs
), gimple_try_cleanup (gs
));
919 pp_string (buffer
, "try");
920 newline_and_indent (buffer
, spc
+ 2);
921 pp_left_brace (buffer
);
924 dump_gimple_seq (buffer
, gimple_try_eval (gs
), spc
+ 4, flags
);
925 newline_and_indent (buffer
, spc
+ 2);
926 pp_right_brace (buffer
);
928 if (gimple_try_kind (gs
) == GIMPLE_TRY_CATCH
)
930 newline_and_indent (buffer
, spc
);
931 pp_string (buffer
, "catch");
932 newline_and_indent (buffer
, spc
+ 2);
933 pp_left_brace (buffer
);
935 else if (gimple_try_kind (gs
) == GIMPLE_TRY_FINALLY
)
937 newline_and_indent (buffer
, spc
);
938 pp_string (buffer
, "finally");
939 newline_and_indent (buffer
, spc
+ 2);
940 pp_left_brace (buffer
);
943 pp_string (buffer
, " <UNKNOWN GIMPLE_TRY> {");
946 dump_gimple_seq (buffer
, gimple_try_cleanup (gs
), spc
+ 4, flags
);
947 newline_and_indent (buffer
, spc
+ 2);
948 pp_right_brace (buffer
);
953 /* Dump a GIMPLE_CATCH tuple on the pretty_printer BUFFER, SPC spaces of
954 indent. FLAGS specifies details to show in the dump (see TDF_* in
958 dump_gimple_catch (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
961 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %+CATCH <%S>%->", gs
,
962 gimple_catch_types (gs
), gimple_catch_handler (gs
));
964 dump_gimple_fmt (buffer
, spc
, flags
, "catch (%T)%+{%S}",
965 gimple_catch_types (gs
), gimple_catch_handler (gs
));
969 /* Dump a GIMPLE_EH_FILTER tuple on the pretty_printer BUFFER, SPC spaces of
970 indent. FLAGS specifies details to show in the dump (see TDF_* in
974 dump_gimple_eh_filter (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
977 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %+FAILURE <%S>%->", gs
,
978 gimple_eh_filter_types (gs
),
979 gimple_eh_filter_failure (gs
));
981 dump_gimple_fmt (buffer
, spc
, flags
, "<<<eh_filter (%T)>>>%+{%+%S%-}",
982 gimple_eh_filter_types (gs
),
983 gimple_eh_filter_failure (gs
));
987 /* Dump a GIMPLE_EH_MUST_NOT_THROW tuple. */
990 dump_gimple_eh_must_not_throw (pretty_printer
*buffer
, gimple gs
,
994 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
,
995 gimple_eh_must_not_throw_fndecl (gs
));
997 dump_gimple_fmt (buffer
, spc
, flags
, "<<<eh_must_not_throw (%T)>>>",
998 gimple_eh_must_not_throw_fndecl (gs
));
1002 /* Dump a GIMPLE_EH_ELSE tuple on the pretty_printer BUFFER, SPC spaces of
1003 indent. FLAGS specifies details to show in the dump (see TDF_* in
1007 dump_gimple_eh_else (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1009 if (flags
& TDF_RAW
)
1010 dump_gimple_fmt (buffer
, spc
, flags
,
1011 "%G <%+N_BODY <%S>%nE_BODY <%S>%->", gs
,
1012 gimple_eh_else_n_body (gs
), gimple_eh_else_e_body (gs
));
1014 dump_gimple_fmt (buffer
, spc
, flags
,
1015 "<<<if_normal_exit>>>%+{%S}%-<<<else_eh_exit>>>%+{%S}",
1016 gimple_eh_else_n_body (gs
), gimple_eh_else_e_body (gs
));
1020 /* Dump a GIMPLE_RESX tuple on the pretty_printer BUFFER, SPC spaces of
1021 indent. FLAGS specifies details to show in the dump (see TDF_* in
1025 dump_gimple_resx (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1027 if (flags
& TDF_RAW
)
1028 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%d>", gs
,
1029 gimple_resx_region (gs
));
1031 dump_gimple_fmt (buffer
, spc
, flags
, "resx %d", gimple_resx_region (gs
));
1034 /* Dump a GIMPLE_EH_DISPATCH tuple on the pretty_printer BUFFER. */
1037 dump_gimple_eh_dispatch (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1039 if (flags
& TDF_RAW
)
1040 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%d>", gs
,
1041 gimple_eh_dispatch_region (gs
));
1043 dump_gimple_fmt (buffer
, spc
, flags
, "eh_dispatch %d",
1044 gimple_eh_dispatch_region (gs
));
1047 /* Dump a GIMPLE_DEBUG tuple on the pretty_printer BUFFER, SPC spaces
1048 of indent. FLAGS specifies details to show in the dump (see TDF_*
1052 dump_gimple_debug (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1054 switch (gs
->gsbase
.subcode
)
1056 case GIMPLE_DEBUG_BIND
:
1057 if (flags
& TDF_RAW
)
1058 dump_gimple_fmt (buffer
, spc
, flags
, "%G BIND <%T, %T>", gs
,
1059 gimple_debug_bind_get_var (gs
),
1060 gimple_debug_bind_get_value (gs
));
1062 dump_gimple_fmt (buffer
, spc
, flags
, "# DEBUG %T => %T",
1063 gimple_debug_bind_get_var (gs
),
1064 gimple_debug_bind_get_value (gs
));
1067 case GIMPLE_DEBUG_SOURCE_BIND
:
1068 if (flags
& TDF_RAW
)
1069 dump_gimple_fmt (buffer
, spc
, flags
, "%G SRCBIND <%T, %T>", gs
,
1070 gimple_debug_source_bind_get_var (gs
),
1071 gimple_debug_source_bind_get_value (gs
));
1073 dump_gimple_fmt (buffer
, spc
, flags
, "# DEBUG %T s=> %T",
1074 gimple_debug_source_bind_get_var (gs
),
1075 gimple_debug_source_bind_get_value (gs
));
1083 /* Dump a GIMPLE_OMP_FOR tuple on the pretty_printer BUFFER. */
1085 dump_gimple_omp_for (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1089 if (flags
& TDF_RAW
)
1092 switch (gimple_omp_for_kind (gs
))
1094 case GF_OMP_FOR_KIND_FOR
:
1097 case GF_OMP_FOR_KIND_SIMD
:
1103 dump_gimple_fmt (buffer
, spc
, flags
, "%G%s <%+BODY <%S>%nCLAUSES <", gs
,
1104 kind
, gimple_omp_body (gs
));
1105 dump_omp_clauses (buffer
, gimple_omp_for_clauses (gs
), spc
, flags
);
1106 dump_gimple_fmt (buffer
, spc
, flags
, " >,");
1107 for (i
= 0; i
< gimple_omp_for_collapse (gs
); i
++)
1108 dump_gimple_fmt (buffer
, spc
, flags
,
1109 "%+%T, %T, %T, %s, %T,%n",
1110 gimple_omp_for_index (gs
, i
),
1111 gimple_omp_for_initial (gs
, i
),
1112 gimple_omp_for_final (gs
, i
),
1113 tree_code_name
[gimple_omp_for_cond (gs
, i
)],
1114 gimple_omp_for_incr (gs
, i
));
1115 dump_gimple_fmt (buffer
, spc
, flags
, "PRE_BODY <%S>%->",
1116 gimple_omp_for_pre_body (gs
));
1120 switch (gimple_omp_for_kind (gs
))
1122 case GF_OMP_FOR_KIND_FOR
:
1123 pp_string (buffer
, "#pragma omp for");
1125 case GF_OMP_FOR_KIND_SIMD
:
1126 pp_string (buffer
, "#pragma omp simd");
1131 dump_omp_clauses (buffer
, gimple_omp_for_clauses (gs
), spc
, flags
);
1132 for (i
= 0; i
< gimple_omp_for_collapse (gs
); i
++)
1136 newline_and_indent (buffer
, spc
);
1137 pp_string (buffer
, "for (");
1138 dump_generic_node (buffer
, gimple_omp_for_index (gs
, i
), spc
,
1140 pp_string (buffer
, " = ");
1141 dump_generic_node (buffer
, gimple_omp_for_initial (gs
, i
), spc
,
1143 pp_string (buffer
, "; ");
1145 dump_generic_node (buffer
, gimple_omp_for_index (gs
, i
), spc
,
1148 switch (gimple_omp_for_cond (gs
, i
))
1154 pp_greater (buffer
);
1157 pp_less_equal (buffer
);
1160 pp_greater_equal (buffer
);
1166 dump_generic_node (buffer
, gimple_omp_for_final (gs
, i
), spc
,
1168 pp_string (buffer
, "; ");
1170 dump_generic_node (buffer
, gimple_omp_for_index (gs
, i
), spc
,
1172 pp_string (buffer
, " = ");
1173 dump_generic_node (buffer
, gimple_omp_for_incr (gs
, i
), spc
,
1175 pp_right_paren (buffer
);
1178 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1180 newline_and_indent (buffer
, spc
+ 2);
1181 pp_left_brace (buffer
);
1182 pp_newline (buffer
);
1183 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1184 newline_and_indent (buffer
, spc
+ 2);
1185 pp_right_brace (buffer
);
1190 /* Dump a GIMPLE_OMP_CONTINUE tuple on the pretty_printer BUFFER. */
1193 dump_gimple_omp_continue (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1195 if (flags
& TDF_RAW
)
1197 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %T>", gs
,
1198 gimple_omp_continue_control_def (gs
),
1199 gimple_omp_continue_control_use (gs
));
1203 pp_string (buffer
, "#pragma omp continue (");
1204 dump_generic_node (buffer
, gimple_omp_continue_control_def (gs
),
1208 dump_generic_node (buffer
, gimple_omp_continue_control_use (gs
),
1210 pp_right_paren (buffer
);
1214 /* Dump a GIMPLE_OMP_SINGLE tuple on the pretty_printer BUFFER. */
1217 dump_gimple_omp_single (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1219 if (flags
& TDF_RAW
)
1221 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1222 gimple_omp_body (gs
));
1223 dump_omp_clauses (buffer
, gimple_omp_single_clauses (gs
), spc
, flags
);
1224 dump_gimple_fmt (buffer
, spc
, flags
, " >");
1228 pp_string (buffer
, "#pragma omp single");
1229 dump_omp_clauses (buffer
, gimple_omp_single_clauses (gs
), spc
, flags
);
1230 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1232 newline_and_indent (buffer
, spc
+ 2);
1233 pp_left_brace (buffer
);
1234 pp_newline (buffer
);
1235 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1236 newline_and_indent (buffer
, spc
+ 2);
1237 pp_right_brace (buffer
);
1242 /* Dump a GIMPLE_OMP_SECTIONS tuple on the pretty_printer BUFFER. */
1245 dump_gimple_omp_sections (pretty_printer
*buffer
, gimple gs
, int spc
,
1248 if (flags
& TDF_RAW
)
1250 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1251 gimple_omp_body (gs
));
1252 dump_omp_clauses (buffer
, gimple_omp_sections_clauses (gs
), spc
, flags
);
1253 dump_gimple_fmt (buffer
, spc
, flags
, " >");
1257 pp_string (buffer
, "#pragma omp sections");
1258 if (gimple_omp_sections_control (gs
))
1260 pp_string (buffer
, " <");
1261 dump_generic_node (buffer
, gimple_omp_sections_control (gs
), spc
,
1263 pp_greater (buffer
);
1265 dump_omp_clauses (buffer
, gimple_omp_sections_clauses (gs
), spc
, flags
);
1266 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1268 newline_and_indent (buffer
, spc
+ 2);
1269 pp_left_brace (buffer
);
1270 pp_newline (buffer
);
1271 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1272 newline_and_indent (buffer
, spc
+ 2);
1273 pp_right_brace (buffer
);
1278 /* Dump a GIMPLE_OMP_{MASTER,ORDERED,SECTION} tuple on the pretty_printer
1282 dump_gimple_omp_block (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1284 if (flags
& TDF_RAW
)
1285 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S> >", gs
,
1286 gimple_omp_body (gs
));
1289 switch (gimple_code (gs
))
1291 case GIMPLE_OMP_MASTER
:
1292 pp_string (buffer
, "#pragma omp master");
1294 case GIMPLE_OMP_ORDERED
:
1295 pp_string (buffer
, "#pragma omp ordered");
1297 case GIMPLE_OMP_SECTION
:
1298 pp_string (buffer
, "#pragma omp section");
1303 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1305 newline_and_indent (buffer
, spc
+ 2);
1306 pp_left_brace (buffer
);
1307 pp_newline (buffer
);
1308 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1309 newline_and_indent (buffer
, spc
+ 2);
1310 pp_right_brace (buffer
);
1315 /* Dump a GIMPLE_OMP_CRITICAL tuple on the pretty_printer BUFFER. */
1318 dump_gimple_omp_critical (pretty_printer
*buffer
, gimple gs
, int spc
,
1321 if (flags
& TDF_RAW
)
1322 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S> >", gs
,
1323 gimple_omp_body (gs
));
1326 pp_string (buffer
, "#pragma omp critical");
1327 if (gimple_omp_critical_name (gs
))
1329 pp_string (buffer
, " (");
1330 dump_generic_node (buffer
, gimple_omp_critical_name (gs
), spc
,
1332 pp_right_paren (buffer
);
1334 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1336 newline_and_indent (buffer
, spc
+ 2);
1337 pp_left_brace (buffer
);
1338 pp_newline (buffer
);
1339 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1340 newline_and_indent (buffer
, spc
+ 2);
1341 pp_right_brace (buffer
);
1346 /* Dump a GIMPLE_OMP_RETURN tuple on the pretty_printer BUFFER. */
1349 dump_gimple_omp_return (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1351 if (flags
& TDF_RAW
)
1353 dump_gimple_fmt (buffer
, spc
, flags
, "%G <nowait=%d>", gs
,
1354 (int) gimple_omp_return_nowait_p (gs
));
1358 pp_string (buffer
, "#pragma omp return");
1359 if (gimple_omp_return_nowait_p (gs
))
1360 pp_string (buffer
, "(nowait)");
1364 /* Dump a GIMPLE_TRANSACTION tuple on the pretty_printer BUFFER. */
1367 dump_gimple_transaction (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1369 unsigned subcode
= gimple_transaction_subcode (gs
);
1371 if (flags
& TDF_RAW
)
1373 dump_gimple_fmt (buffer
, spc
, flags
,
1374 "%G [SUBCODE=%x,LABEL=%T] <%+BODY <%S> >",
1375 gs
, subcode
, gimple_transaction_label (gs
),
1376 gimple_transaction_body (gs
));
1380 if (subcode
& GTMA_IS_OUTER
)
1381 pp_string (buffer
, "__transaction_atomic [[outer]]");
1382 else if (subcode
& GTMA_IS_RELAXED
)
1383 pp_string (buffer
, "__transaction_relaxed");
1385 pp_string (buffer
, "__transaction_atomic");
1386 subcode
&= ~GTMA_DECLARATION_MASK
;
1388 if (subcode
|| gimple_transaction_label (gs
))
1390 pp_string (buffer
, " //");
1391 if (gimple_transaction_label (gs
))
1393 pp_string (buffer
, " LABEL=");
1394 dump_generic_node (buffer
, gimple_transaction_label (gs
),
1399 pp_string (buffer
, " SUBCODE=[ ");
1400 if (subcode
& GTMA_HAVE_ABORT
)
1402 pp_string (buffer
, "GTMA_HAVE_ABORT ");
1403 subcode
&= ~GTMA_HAVE_ABORT
;
1405 if (subcode
& GTMA_HAVE_LOAD
)
1407 pp_string (buffer
, "GTMA_HAVE_LOAD ");
1408 subcode
&= ~GTMA_HAVE_LOAD
;
1410 if (subcode
& GTMA_HAVE_STORE
)
1412 pp_string (buffer
, "GTMA_HAVE_STORE ");
1413 subcode
&= ~GTMA_HAVE_STORE
;
1415 if (subcode
& GTMA_MAY_ENTER_IRREVOCABLE
)
1417 pp_string (buffer
, "GTMA_MAY_ENTER_IRREVOCABLE ");
1418 subcode
&= ~GTMA_MAY_ENTER_IRREVOCABLE
;
1420 if (subcode
& GTMA_DOES_GO_IRREVOCABLE
)
1422 pp_string (buffer
, "GTMA_DOES_GO_IRREVOCABLE ");
1423 subcode
&= ~GTMA_DOES_GO_IRREVOCABLE
;
1425 if (subcode
& GTMA_HAS_NO_INSTRUMENTATION
)
1427 pp_string (buffer
, "GTMA_HAS_NO_INSTRUMENTATION ");
1428 subcode
&= ~GTMA_HAS_NO_INSTRUMENTATION
;
1431 pp_printf (buffer
, "0x%x ", subcode
);
1432 pp_right_bracket (buffer
);
1436 if (!gimple_seq_empty_p (gimple_transaction_body (gs
)))
1438 newline_and_indent (buffer
, spc
+ 2);
1439 pp_left_brace (buffer
);
1440 pp_newline (buffer
);
1441 dump_gimple_seq (buffer
, gimple_transaction_body (gs
),
1443 newline_and_indent (buffer
, spc
+ 2);
1444 pp_right_brace (buffer
);
1449 /* Dump a GIMPLE_ASM tuple on the pretty_printer BUFFER, SPC spaces of
1450 indent. FLAGS specifies details to show in the dump (see TDF_* in
1454 dump_gimple_asm (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1456 unsigned int i
, n
, f
, fields
;
1458 if (flags
& TDF_RAW
)
1460 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+STRING <%n%s%n>", gs
,
1461 gimple_asm_string (gs
));
1463 n
= gimple_asm_noutputs (gs
);
1466 newline_and_indent (buffer
, spc
+ 2);
1467 pp_string (buffer
, "OUTPUT: ");
1468 for (i
= 0; i
< n
; i
++)
1470 dump_generic_node (buffer
, gimple_asm_output_op (gs
, i
),
1473 pp_string (buffer
, ", ");
1477 n
= gimple_asm_ninputs (gs
);
1480 newline_and_indent (buffer
, spc
+ 2);
1481 pp_string (buffer
, "INPUT: ");
1482 for (i
= 0; i
< n
; i
++)
1484 dump_generic_node (buffer
, gimple_asm_input_op (gs
, i
),
1487 pp_string (buffer
, ", ");
1491 n
= gimple_asm_nclobbers (gs
);
1494 newline_and_indent (buffer
, spc
+ 2);
1495 pp_string (buffer
, "CLOBBER: ");
1496 for (i
= 0; i
< n
; i
++)
1498 dump_generic_node (buffer
, gimple_asm_clobber_op (gs
, i
),
1501 pp_string (buffer
, ", ");
1505 n
= gimple_asm_nlabels (gs
);
1508 newline_and_indent (buffer
, spc
+ 2);
1509 pp_string (buffer
, "LABEL: ");
1510 for (i
= 0; i
< n
; i
++)
1512 dump_generic_node (buffer
, gimple_asm_label_op (gs
, i
),
1515 pp_string (buffer
, ", ");
1519 newline_and_indent (buffer
, spc
);
1520 pp_greater (buffer
);
1524 pp_string (buffer
, "__asm__");
1525 if (gimple_asm_volatile_p (gs
))
1526 pp_string (buffer
, " __volatile__");
1527 if (gimple_asm_nlabels (gs
))
1528 pp_string (buffer
, " goto");
1529 pp_string (buffer
, "(\"");
1530 pp_string (buffer
, gimple_asm_string (gs
));
1531 pp_string (buffer
, "\"");
1533 if (gimple_asm_nlabels (gs
))
1535 else if (gimple_asm_nclobbers (gs
))
1537 else if (gimple_asm_ninputs (gs
))
1539 else if (gimple_asm_noutputs (gs
))
1544 for (f
= 0; f
< fields
; ++f
)
1546 pp_string (buffer
, " : ");
1551 n
= gimple_asm_noutputs (gs
);
1552 for (i
= 0; i
< n
; i
++)
1554 dump_generic_node (buffer
, gimple_asm_output_op (gs
, i
),
1557 pp_string (buffer
, ", ");
1562 n
= gimple_asm_ninputs (gs
);
1563 for (i
= 0; i
< n
; i
++)
1565 dump_generic_node (buffer
, gimple_asm_input_op (gs
, i
),
1568 pp_string (buffer
, ", ");
1573 n
= gimple_asm_nclobbers (gs
);
1574 for (i
= 0; i
< n
; i
++)
1576 dump_generic_node (buffer
, gimple_asm_clobber_op (gs
, i
),
1579 pp_string (buffer
, ", ");
1584 n
= gimple_asm_nlabels (gs
);
1585 for (i
= 0; i
< n
; i
++)
1587 dump_generic_node (buffer
, gimple_asm_label_op (gs
, i
),
1590 pp_string (buffer
, ", ");
1599 pp_string (buffer
, ");");
1603 /* Dump ptr_info and range_info for NODE on pretty_printer BUFFER with
1604 SPC spaces of indent. */
1607 dump_ssaname_info (pretty_printer
*buffer
, tree node
, int spc
)
1609 if (TREE_CODE (node
) != SSA_NAME
)
1612 if (POINTER_TYPE_P (TREE_TYPE (node
))
1613 && SSA_NAME_PTR_INFO (node
))
1615 unsigned int align
, misalign
;
1616 struct ptr_info_def
*pi
= SSA_NAME_PTR_INFO (node
);
1617 pp_string (buffer
, "PT = ");
1618 pp_points_to_solution (buffer
, &pi
->pt
);
1619 newline_and_indent (buffer
, spc
);
1620 if (get_ptr_info_alignment (pi
, &align
, &misalign
))
1622 pp_printf (buffer
, "# ALIGN = %u, MISALIGN = %u", align
, misalign
);
1623 newline_and_indent (buffer
, spc
);
1625 pp_string (buffer
, "# ");
1628 if (!POINTER_TYPE_P (TREE_TYPE (node
))
1629 && SSA_NAME_RANGE_INFO (node
))
1631 double_int min
, max
;
1632 value_range_type range_type
= get_range_info (node
, &min
, &max
);
1634 if (range_type
== VR_VARYING
)
1635 pp_printf (buffer
, "# RANGE VR_VARYING");
1636 else if (range_type
== VR_RANGE
|| range_type
== VR_ANTI_RANGE
)
1638 pp_printf (buffer
, "# RANGE ");
1639 pp_printf (buffer
, "%s[", range_type
== VR_RANGE
? "" : "~");
1640 pp_double_int (buffer
, min
, TYPE_UNSIGNED (TREE_TYPE (node
)));
1641 pp_printf (buffer
, ", ");
1642 pp_double_int (buffer
, max
, TYPE_UNSIGNED (TREE_TYPE (node
)));
1643 pp_printf (buffer
, "]");
1644 newline_and_indent (buffer
, spc
);
1650 /* Dump a PHI node PHI. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.
1651 The caller is responsible for calling pp_flush on BUFFER to finalize
1655 dump_gimple_phi (pretty_printer
*buffer
, gimple phi
, int spc
, int flags
)
1658 tree lhs
= gimple_phi_result (phi
);
1660 if (flags
& TDF_ALIAS
)
1661 dump_ssaname_info (buffer
, lhs
, spc
);
1663 if (flags
& TDF_RAW
)
1664 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, ", phi
,
1665 gimple_phi_result (phi
));
1668 dump_generic_node (buffer
, lhs
, spc
, flags
, false);
1669 pp_string (buffer
, " = PHI <");
1671 for (i
= 0; i
< gimple_phi_num_args (phi
); i
++)
1673 if ((flags
& TDF_LINENO
) && gimple_phi_arg_has_location (phi
, i
))
1675 expanded_location xloc
;
1677 xloc
= expand_location (gimple_phi_arg_location (phi
, i
));
1678 pp_left_bracket (buffer
);
1681 pp_string (buffer
, xloc
.file
);
1682 pp_string (buffer
, " : ");
1684 pp_decimal_int (buffer
, xloc
.line
);
1686 pp_decimal_int (buffer
, xloc
.column
);
1687 pp_string (buffer
, "] ");
1689 dump_generic_node (buffer
, gimple_phi_arg_def (phi
, i
), spc
, flags
,
1691 pp_left_paren (buffer
);
1692 pp_decimal_int (buffer
, gimple_phi_arg_edge (phi
, i
)->src
->index
);
1693 pp_right_paren (buffer
);
1694 if (i
< gimple_phi_num_args (phi
) - 1)
1695 pp_string (buffer
, ", ");
1697 pp_greater (buffer
);
1701 /* Dump a GIMPLE_OMP_PARALLEL tuple on the pretty_printer BUFFER, SPC spaces
1702 of indent. FLAGS specifies details to show in the dump (see TDF_* in
1706 dump_gimple_omp_parallel (pretty_printer
*buffer
, gimple gs
, int spc
,
1709 if (flags
& TDF_RAW
)
1711 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1712 gimple_omp_body (gs
));
1713 dump_omp_clauses (buffer
, gimple_omp_parallel_clauses (gs
), spc
, flags
);
1714 dump_gimple_fmt (buffer
, spc
, flags
, " >, %T, %T%n>",
1715 gimple_omp_parallel_child_fn (gs
),
1716 gimple_omp_parallel_data_arg (gs
));
1721 pp_string (buffer
, "#pragma omp parallel");
1722 dump_omp_clauses (buffer
, gimple_omp_parallel_clauses (gs
), spc
, flags
);
1723 if (gimple_omp_parallel_child_fn (gs
))
1725 pp_string (buffer
, " [child fn: ");
1726 dump_generic_node (buffer
, gimple_omp_parallel_child_fn (gs
),
1728 pp_string (buffer
, " (");
1729 if (gimple_omp_parallel_data_arg (gs
))
1730 dump_generic_node (buffer
, gimple_omp_parallel_data_arg (gs
),
1733 pp_string (buffer
, "???");
1734 pp_string (buffer
, ")]");
1736 body
= gimple_omp_body (gs
);
1737 if (body
&& gimple_code (gimple_seq_first_stmt (body
)) != GIMPLE_BIND
)
1739 newline_and_indent (buffer
, spc
+ 2);
1740 pp_left_brace (buffer
);
1741 pp_newline (buffer
);
1742 dump_gimple_seq (buffer
, body
, spc
+ 4, flags
);
1743 newline_and_indent (buffer
, spc
+ 2);
1744 pp_right_brace (buffer
);
1748 pp_newline (buffer
);
1749 dump_gimple_seq (buffer
, body
, spc
+ 2, flags
);
1755 /* Dump a GIMPLE_OMP_TASK tuple on the pretty_printer BUFFER, SPC spaces
1756 of indent. FLAGS specifies details to show in the dump (see TDF_* in
1760 dump_gimple_omp_task (pretty_printer
*buffer
, gimple gs
, int spc
,
1763 if (flags
& TDF_RAW
)
1765 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1766 gimple_omp_body (gs
));
1767 dump_omp_clauses (buffer
, gimple_omp_task_clauses (gs
), spc
, flags
);
1768 dump_gimple_fmt (buffer
, spc
, flags
, " >, %T, %T, %T, %T, %T%n>",
1769 gimple_omp_task_child_fn (gs
),
1770 gimple_omp_task_data_arg (gs
),
1771 gimple_omp_task_copy_fn (gs
),
1772 gimple_omp_task_arg_size (gs
),
1773 gimple_omp_task_arg_size (gs
));
1778 pp_string (buffer
, "#pragma omp task");
1779 dump_omp_clauses (buffer
, gimple_omp_task_clauses (gs
), spc
, flags
);
1780 if (gimple_omp_task_child_fn (gs
))
1782 pp_string (buffer
, " [child fn: ");
1783 dump_generic_node (buffer
, gimple_omp_task_child_fn (gs
),
1785 pp_string (buffer
, " (");
1786 if (gimple_omp_task_data_arg (gs
))
1787 dump_generic_node (buffer
, gimple_omp_task_data_arg (gs
),
1790 pp_string (buffer
, "???");
1791 pp_string (buffer
, ")]");
1793 body
= gimple_omp_body (gs
);
1794 if (body
&& gimple_code (gimple_seq_first_stmt (body
)) != GIMPLE_BIND
)
1796 newline_and_indent (buffer
, spc
+ 2);
1797 pp_left_brace (buffer
);
1798 pp_newline (buffer
);
1799 dump_gimple_seq (buffer
, body
, spc
+ 4, flags
);
1800 newline_and_indent (buffer
, spc
+ 2);
1801 pp_right_brace (buffer
);
1805 pp_newline (buffer
);
1806 dump_gimple_seq (buffer
, body
, spc
+ 2, flags
);
1812 /* Dump a GIMPLE_OMP_ATOMIC_LOAD tuple on the pretty_printer BUFFER, SPC
1813 spaces of indent. FLAGS specifies details to show in the dump (see TDF_*
1817 dump_gimple_omp_atomic_load (pretty_printer
*buffer
, gimple gs
, int spc
,
1820 if (flags
& TDF_RAW
)
1822 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %T>", gs
,
1823 gimple_omp_atomic_load_lhs (gs
),
1824 gimple_omp_atomic_load_rhs (gs
));
1828 pp_string (buffer
, "#pragma omp atomic_load");
1829 if (gimple_omp_atomic_need_value_p (gs
))
1830 pp_string (buffer
, " [needed]");
1831 newline_and_indent (buffer
, spc
+ 2);
1832 dump_generic_node (buffer
, gimple_omp_atomic_load_lhs (gs
),
1838 dump_generic_node (buffer
, gimple_omp_atomic_load_rhs (gs
),
1843 /* Dump a GIMPLE_OMP_ATOMIC_STORE tuple on the pretty_printer BUFFER, SPC
1844 spaces of indent. FLAGS specifies details to show in the dump (see TDF_*
1848 dump_gimple_omp_atomic_store (pretty_printer
*buffer
, gimple gs
, int spc
,
1851 if (flags
& TDF_RAW
)
1853 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
,
1854 gimple_omp_atomic_store_val (gs
));
1858 pp_string (buffer
, "#pragma omp atomic_store ");
1859 if (gimple_omp_atomic_need_value_p (gs
))
1860 pp_string (buffer
, "[needed] ");
1861 pp_left_paren (buffer
);
1862 dump_generic_node (buffer
, gimple_omp_atomic_store_val (gs
),
1864 pp_right_paren (buffer
);
1869 /* Dump all the memory operands for statement GS. BUFFER, SPC and
1870 FLAGS are as in pp_gimple_stmt_1. */
1873 dump_gimple_mem_ops (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1875 tree vdef
= gimple_vdef (gs
);
1876 tree vuse
= gimple_vuse (gs
);
1878 if (!ssa_operands_active (DECL_STRUCT_FUNCTION (current_function_decl
))
1879 || !gimple_references_memory_p (gs
))
1882 if (vdef
!= NULL_TREE
)
1884 pp_string (buffer
, "# ");
1885 dump_generic_node (buffer
, vdef
, spc
+ 2, flags
, false);
1886 pp_string (buffer
, " = VDEF <");
1887 dump_generic_node (buffer
, vuse
, spc
+ 2, flags
, false);
1888 pp_greater (buffer
);
1889 newline_and_indent (buffer
, spc
);
1891 else if (vuse
!= NULL_TREE
)
1893 pp_string (buffer
, "# VUSE <");
1894 dump_generic_node (buffer
, vuse
, spc
+ 2, flags
, false);
1895 pp_greater (buffer
);
1896 newline_and_indent (buffer
, spc
);
1901 /* Print the gimple statement GS on the pretty printer BUFFER, SPC
1902 spaces of indent. FLAGS specifies details to show in the dump (see
1903 TDF_* in dumpfile.h). The caller is responsible for calling
1904 pp_flush on BUFFER to finalize the pretty printer. */
1907 pp_gimple_stmt_1 (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1912 if (flags
& TDF_STMTADDR
)
1913 pp_printf (buffer
, "<&%p> ", (void *) gs
);
1915 if ((flags
& TDF_LINENO
) && gimple_has_location (gs
))
1917 expanded_location xloc
= expand_location (gimple_location (gs
));
1918 pp_left_bracket (buffer
);
1921 pp_string (buffer
, xloc
.file
);
1922 pp_string (buffer
, " : ");
1924 pp_decimal_int (buffer
, xloc
.line
);
1926 pp_decimal_int (buffer
, xloc
.column
);
1927 pp_string (buffer
, "] ");
1932 int lp_nr
= lookup_stmt_eh_lp (gs
);
1934 pp_printf (buffer
, "[LP %d] ", lp_nr
);
1936 pp_printf (buffer
, "[MNT %d] ", -lp_nr
);
1939 if ((flags
& (TDF_VOPS
|TDF_MEMSYMS
))
1940 && gimple_has_mem_ops (gs
))
1941 dump_gimple_mem_ops (buffer
, gs
, spc
, flags
);
1943 if (gimple_has_lhs (gs
)
1944 && (flags
& TDF_ALIAS
))
1945 dump_ssaname_info (buffer
, gimple_get_lhs (gs
), spc
);
1947 switch (gimple_code (gs
))
1950 dump_gimple_asm (buffer
, gs
, spc
, flags
);
1954 dump_gimple_assign (buffer
, gs
, spc
, flags
);
1958 dump_gimple_bind (buffer
, gs
, spc
, flags
);
1962 dump_gimple_call (buffer
, gs
, spc
, flags
);
1966 dump_gimple_cond (buffer
, gs
, spc
, flags
);
1970 dump_gimple_label (buffer
, gs
, spc
, flags
);
1974 dump_gimple_goto (buffer
, gs
, spc
, flags
);
1978 pp_string (buffer
, "GIMPLE_NOP");
1982 dump_gimple_return (buffer
, gs
, spc
, flags
);
1986 dump_gimple_switch (buffer
, gs
, spc
, flags
);
1990 dump_gimple_try (buffer
, gs
, spc
, flags
);
1994 dump_gimple_phi (buffer
, gs
, spc
, flags
);
1997 case GIMPLE_OMP_PARALLEL
:
1998 dump_gimple_omp_parallel (buffer
, gs
, spc
, flags
);
2001 case GIMPLE_OMP_TASK
:
2002 dump_gimple_omp_task (buffer
, gs
, spc
, flags
);
2005 case GIMPLE_OMP_ATOMIC_LOAD
:
2006 dump_gimple_omp_atomic_load (buffer
, gs
, spc
, flags
);
2010 case GIMPLE_OMP_ATOMIC_STORE
:
2011 dump_gimple_omp_atomic_store (buffer
, gs
, spc
, flags
);
2014 case GIMPLE_OMP_FOR
:
2015 dump_gimple_omp_for (buffer
, gs
, spc
, flags
);
2018 case GIMPLE_OMP_CONTINUE
:
2019 dump_gimple_omp_continue (buffer
, gs
, spc
, flags
);
2022 case GIMPLE_OMP_SINGLE
:
2023 dump_gimple_omp_single (buffer
, gs
, spc
, flags
);
2026 case GIMPLE_OMP_RETURN
:
2027 dump_gimple_omp_return (buffer
, gs
, spc
, flags
);
2030 case GIMPLE_OMP_SECTIONS
:
2031 dump_gimple_omp_sections (buffer
, gs
, spc
, flags
);
2034 case GIMPLE_OMP_SECTIONS_SWITCH
:
2035 pp_string (buffer
, "GIMPLE_SECTIONS_SWITCH");
2038 case GIMPLE_OMP_MASTER
:
2039 case GIMPLE_OMP_ORDERED
:
2040 case GIMPLE_OMP_SECTION
:
2041 dump_gimple_omp_block (buffer
, gs
, spc
, flags
);
2044 case GIMPLE_OMP_CRITICAL
:
2045 dump_gimple_omp_critical (buffer
, gs
, spc
, flags
);
2049 dump_gimple_catch (buffer
, gs
, spc
, flags
);
2052 case GIMPLE_EH_FILTER
:
2053 dump_gimple_eh_filter (buffer
, gs
, spc
, flags
);
2056 case GIMPLE_EH_MUST_NOT_THROW
:
2057 dump_gimple_eh_must_not_throw (buffer
, gs
, spc
, flags
);
2060 case GIMPLE_EH_ELSE
:
2061 dump_gimple_eh_else (buffer
, gs
, spc
, flags
);
2065 dump_gimple_resx (buffer
, gs
, spc
, flags
);
2068 case GIMPLE_EH_DISPATCH
:
2069 dump_gimple_eh_dispatch (buffer
, gs
, spc
, flags
);
2073 dump_gimple_debug (buffer
, gs
, spc
, flags
);
2076 case GIMPLE_PREDICT
:
2077 pp_string (buffer
, "// predicted ");
2078 if (gimple_predict_outcome (gs
))
2079 pp_string (buffer
, "likely by ");
2081 pp_string (buffer
, "unlikely by ");
2082 pp_string (buffer
, predictor_name (gimple_predict_predictor (gs
)));
2083 pp_string (buffer
, " predictor.");
2086 case GIMPLE_TRANSACTION
:
2087 dump_gimple_transaction (buffer
, gs
, spc
, flags
);
2096 /* Dumps header of basic block BB to OUTF indented by INDENT
2097 spaces and details described by flags. */
2100 dump_gimple_bb_header (FILE *outf
, basic_block bb
, int indent
, int flags
)
2102 if (flags
& TDF_BLOCKS
)
2104 if (flags
& TDF_LINENO
)
2106 gimple_stmt_iterator gsi
;
2108 if (flags
& TDF_COMMENT
)
2109 fputs (";; ", outf
);
2111 for (gsi
= gsi_start_bb (bb
); !gsi_end_p (gsi
); gsi_next (&gsi
))
2112 if (!is_gimple_debug (gsi_stmt (gsi
))
2113 && get_lineno (gsi_stmt (gsi
)) != UNKNOWN_LOCATION
)
2115 fprintf (outf
, "%*sstarting at line %d",
2116 indent
, "", get_lineno (gsi_stmt (gsi
)));
2119 if (bb
->discriminator
)
2120 fprintf (outf
, ", discriminator %i", bb
->discriminator
);
2126 gimple stmt
= first_stmt (bb
);
2127 if (!stmt
|| gimple_code (stmt
) != GIMPLE_LABEL
)
2128 fprintf (outf
, "%*s<bb %d>:\n", indent
, "", bb
->index
);
2133 /* Dumps end of basic block BB to buffer BUFFER indented by INDENT
2137 dump_gimple_bb_footer (FILE *outf ATTRIBUTE_UNUSED
,
2138 basic_block bb ATTRIBUTE_UNUSED
,
2139 int indent ATTRIBUTE_UNUSED
,
2140 int flags ATTRIBUTE_UNUSED
)
2142 /* There is currently no GIMPLE-specific basic block info to dump. */
2147 /* Dump PHI nodes of basic block BB to BUFFER with details described
2148 by FLAGS and indented by INDENT spaces. */
2151 dump_phi_nodes (pretty_printer
*buffer
, basic_block bb
, int indent
, int flags
)
2153 gimple_stmt_iterator i
;
2155 for (i
= gsi_start_phis (bb
); !gsi_end_p (i
); gsi_next (&i
))
2157 gimple phi
= gsi_stmt (i
);
2158 if (!virtual_operand_p (gimple_phi_result (phi
)) || (flags
& TDF_VOPS
))
2161 pp_string (buffer
, "# ");
2162 dump_gimple_phi (buffer
, phi
, indent
, flags
);
2163 pp_newline (buffer
);
2169 /* Dump jump to basic block BB that is represented implicitly in the cfg
2173 pp_cfg_jump (pretty_printer
*buffer
, basic_block bb
)
2177 stmt
= first_stmt (bb
);
2179 pp_string (buffer
, "goto <bb ");
2180 pp_decimal_int (buffer
, bb
->index
);
2181 pp_greater (buffer
);
2182 if (stmt
&& gimple_code (stmt
) == GIMPLE_LABEL
)
2184 pp_string (buffer
, " (");
2185 dump_generic_node (buffer
, gimple_label_label (stmt
), 0, 0, false);
2186 pp_right_paren (buffer
);
2187 pp_semicolon (buffer
);
2190 pp_semicolon (buffer
);
2194 /* Dump edges represented implicitly in basic block BB to BUFFER, indented
2195 by INDENT spaces, with details given by FLAGS. */
2198 dump_implicit_edges (pretty_printer
*buffer
, basic_block bb
, int indent
,
2204 stmt
= last_stmt (bb
);
2206 if (stmt
&& gimple_code (stmt
) == GIMPLE_COND
)
2208 edge true_edge
, false_edge
;
2210 /* When we are emitting the code or changing CFG, it is possible that
2211 the edges are not yet created. When we are using debug_bb in such
2212 a situation, we do not want it to crash. */
2213 if (EDGE_COUNT (bb
->succs
) != 2)
2215 extract_true_false_edges_from_block (bb
, &true_edge
, &false_edge
);
2217 INDENT (indent
+ 2);
2218 pp_cfg_jump (buffer
, true_edge
->dest
);
2219 newline_and_indent (buffer
, indent
);
2220 pp_string (buffer
, "else");
2221 newline_and_indent (buffer
, indent
+ 2);
2222 pp_cfg_jump (buffer
, false_edge
->dest
);
2223 pp_newline (buffer
);
2227 /* If there is a fallthru edge, we may need to add an artificial
2228 goto to the dump. */
2229 e
= find_fallthru_edge (bb
->succs
);
2231 if (e
&& e
->dest
!= bb
->next_bb
)
2235 if ((flags
& TDF_LINENO
)
2236 && e
->goto_locus
!= UNKNOWN_LOCATION
2239 expanded_location goto_xloc
;
2240 goto_xloc
= expand_location (e
->goto_locus
);
2241 pp_left_bracket (buffer
);
2244 pp_string (buffer
, goto_xloc
.file
);
2245 pp_string (buffer
, " : ");
2247 pp_decimal_int (buffer
, goto_xloc
.line
);
2248 pp_string (buffer
, " : ");
2249 pp_decimal_int (buffer
, goto_xloc
.column
);
2250 pp_string (buffer
, "] ");
2253 pp_cfg_jump (buffer
, e
->dest
);
2254 pp_newline (buffer
);
2259 /* Dumps basic block BB to buffer BUFFER with details described by FLAGS and
2260 indented by INDENT spaces. */
2263 gimple_dump_bb_buff (pretty_printer
*buffer
, basic_block bb
, int indent
,
2266 gimple_stmt_iterator gsi
;
2268 int label_indent
= indent
- 2;
2270 if (label_indent
< 0)
2273 dump_phi_nodes (buffer
, bb
, indent
, flags
);
2275 for (gsi
= gsi_start_bb (bb
); !gsi_end_p (gsi
); gsi_next (&gsi
))
2279 stmt
= gsi_stmt (gsi
);
2281 curr_indent
= gimple_code (stmt
) == GIMPLE_LABEL
? label_indent
: indent
;
2283 INDENT (curr_indent
);
2284 pp_gimple_stmt_1 (buffer
, stmt
, curr_indent
, flags
);
2285 pp_newline_and_flush (buffer
);
2286 gcc_checking_assert (DECL_STRUCT_FUNCTION (current_function_decl
));
2287 dump_histograms_for_stmt (DECL_STRUCT_FUNCTION (current_function_decl
),
2288 pp_buffer(buffer
)->stream
, stmt
);
2291 dump_implicit_edges (buffer
, bb
, indent
, flags
);
2296 /* Dumps basic block BB to FILE with details described by FLAGS and
2297 indented by INDENT spaces. */
2300 gimple_dump_bb (FILE *file
, basic_block bb
, int indent
, int flags
)
2302 dump_gimple_bb_header (file
, bb
, indent
, flags
);
2303 if (bb
->index
>= NUM_FIXED_BLOCKS
)
2305 pretty_printer buffer
;
2306 pp_needs_newline (&buffer
) = true;
2307 buffer
.buffer
->stream
= file
;
2308 gimple_dump_bb_buff (&buffer
, bb
, indent
, flags
);
2310 dump_gimple_bb_footer (file
, bb
, indent
, flags
);
2313 /* Dumps basic block BB to pretty-printer PP with default dump flags and
2314 no indentation, for use as a label of a DOT graph record-node.
2315 ??? Should just use gimple_dump_bb_buff here, except that value profiling
2316 histogram dumping doesn't know about pretty-printers. */
2319 gimple_dump_bb_for_graph (pretty_printer
*pp
, basic_block bb
)
2321 gimple_stmt_iterator gsi
;
2323 pp_printf (pp
, "<bb %d>:\n", bb
->index
);
2324 pp_write_text_as_dot_label_to_stream (pp
, /*for_record=*/true);
2326 for (gsi
= gsi_start_phis (bb
); !gsi_end_p (gsi
); gsi_next (&gsi
))
2328 gimple phi
= gsi_stmt (gsi
);
2329 if (!virtual_operand_p (gimple_phi_result (phi
))
2330 || (dump_flags
& TDF_VOPS
))
2333 pp_write_text_to_stream (pp
);
2334 pp_string (pp
, "# ");
2335 pp_gimple_stmt_1 (pp
, phi
, 0, dump_flags
);
2337 pp_write_text_as_dot_label_to_stream (pp
, /*for_record=*/true);
2341 for (gsi
= gsi_start_bb (bb
); !gsi_end_p (gsi
); gsi_next (&gsi
))
2343 gimple stmt
= gsi_stmt (gsi
);
2345 pp_write_text_to_stream (pp
);
2346 pp_gimple_stmt_1 (pp
, stmt
, 0, dump_flags
);
2348 pp_write_text_as_dot_label_to_stream (pp
, /*for_record=*/true);
2350 dump_implicit_edges (pp
, bb
, 0, dump_flags
);
2351 pp_write_text_as_dot_label_to_stream (pp
, /*for_record=*/true);