1 /* Pretty formatting of GIMPLE statements and expressions.
2 Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
3 2011 Free Software Foundation, Inc.
4 Contributed by Aldy Hernandez <aldyh@redhat.com> and
5 Diego Novillo <dnovillo@google.com>
7 This file is part of GCC.
9 GCC is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free
11 Software Foundation; either version 3, or (at your option) any later
14 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 You should have received a copy of the GNU General Public License
20 along with GCC; see the file COPYING3. If not see
21 <http://www.gnu.org/licenses/>. */
25 #include "coretypes.h"
28 #include "diagnostic.h"
29 #include "gimple-pretty-print.h"
31 #include "tree-flow.h"
32 #include "dumpfile.h" /* for dump_flags */
34 #include "value-prof.h"
35 #include "trans-mem.h"
37 #define INDENT(SPACE) \
38 do { int i; for (i = 0; i < SPACE; i++) pp_space (buffer); } while (0)
40 static pretty_printer buffer
;
41 static bool initialized
= false;
43 #define GIMPLE_NIY do_niy (buffer,gs)
45 /* Try to print on BUFFER a default message for the unrecognized
46 gimple statement GS. */
49 do_niy (pretty_printer
*buffer
, gimple gs
)
51 pp_printf (buffer
, "<<< Unknown GIMPLE statement: %s >>>\n",
52 gimple_code_name
[(int) gimple_code (gs
)]);
56 /* Initialize the pretty printer on FILE if needed. */
59 maybe_init_pretty_print (FILE *file
)
63 pp_construct (&buffer
, NULL
, 0);
64 pp_needs_newline (&buffer
) = true;
68 buffer
.buffer
->stream
= file
;
72 /* Emit a newline and SPC indentantion spaces to BUFFER. */
75 newline_and_indent (pretty_printer
*buffer
, int spc
)
82 /* Print the GIMPLE statement GS on stderr. */
85 debug_gimple_stmt (gimple gs
)
87 print_gimple_stmt (stderr
, gs
, 0, TDF_VOPS
|TDF_MEMSYMS
);
88 fprintf (stderr
, "\n");
92 /* Dump GIMPLE statement G to FILE using SPC indentantion spaces and
93 FLAGS as in dump_gimple_stmt. */
96 print_gimple_stmt (FILE *file
, gimple g
, int spc
, int flags
)
98 maybe_init_pretty_print (file
);
99 dump_gimple_stmt (&buffer
, g
, spc
, flags
);
104 /* Dump GIMPLE statement G to FILE using SPC indentantion spaces and
105 FLAGS as in dump_gimple_stmt. Print only the right-hand side
109 print_gimple_expr (FILE *file
, gimple g
, int spc
, int flags
)
111 flags
|= TDF_RHS_ONLY
;
112 maybe_init_pretty_print (file
);
113 dump_gimple_stmt (&buffer
, g
, spc
, flags
);
117 /* Print the GIMPLE sequence SEQ on BUFFER using SPC indentantion
118 spaces and FLAGS as in dump_gimple_stmt. */
121 dump_gimple_seq (pretty_printer
*buffer
, gimple_seq seq
, int spc
, int flags
)
123 gimple_stmt_iterator i
;
125 for (i
= gsi_start (seq
); !gsi_end_p (i
); gsi_next (&i
))
127 gimple gs
= gsi_stmt (i
);
129 dump_gimple_stmt (buffer
, gs
, spc
, flags
);
130 if (!gsi_one_before_end_p (i
))
136 /* Dump GIMPLE sequence SEQ to FILE using SPC indentantion spaces and
137 FLAGS as in dump_gimple_stmt. */
140 print_gimple_seq (FILE *file
, gimple_seq seq
, int spc
, int flags
)
142 maybe_init_pretty_print (file
);
143 dump_gimple_seq (&buffer
, seq
, spc
, flags
);
148 /* Print the GIMPLE sequence SEQ on stderr. */
151 debug_gimple_seq (gimple_seq seq
)
153 print_gimple_seq (stderr
, seq
, 0, TDF_VOPS
|TDF_MEMSYMS
);
157 /* A simple helper to pretty-print some of the gimple tuples in the printf
158 style. The format modifiers are preceded by '%' and are:
159 'G' - outputs a string corresponding to the code of the given gimple,
160 'S' - outputs a gimple_seq with indent of spc + 2,
161 'T' - outputs the tree t,
162 'd' - outputs an int as a decimal,
163 's' - outputs a string,
164 'n' - outputs a newline,
165 'x' - outputs an int as hexadecimal,
166 '+' - increases indent by 2 then outputs a newline,
167 '-' - decreases indent by 2 then outputs a newline. */
170 dump_gimple_fmt (pretty_printer
*buffer
, int spc
, int flags
,
171 const char *fmt
, ...)
177 va_start (args
, fmt
);
178 for (c
= fmt
; *c
; c
++)
188 g
= va_arg (args
, gimple
);
189 tmp
= gimple_code_name
[gimple_code (g
)];
190 pp_string (buffer
, tmp
);
194 seq
= va_arg (args
, gimple_seq
);
196 dump_gimple_seq (buffer
, seq
, spc
+ 2, flags
);
197 newline_and_indent (buffer
, spc
);
201 t
= va_arg (args
, tree
);
203 pp_string (buffer
, "NULL");
205 dump_generic_node (buffer
, t
, spc
, flags
, false);
209 pp_decimal_int (buffer
, va_arg (args
, int));
213 pp_string (buffer
, va_arg (args
, char *));
217 newline_and_indent (buffer
, spc
);
221 pp_scalar (buffer
, "%x", va_arg (args
, int));
226 newline_and_indent (buffer
, spc
);
231 newline_and_indent (buffer
, spc
);
239 pp_character (buffer
, *c
);
245 /* Helper for dump_gimple_assign. Print the unary RHS of the
246 assignment GS. BUFFER, SPC and FLAGS are as in dump_gimple_stmt. */
249 dump_unary_rhs (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
251 enum tree_code rhs_code
= gimple_assign_rhs_code (gs
);
252 tree lhs
= gimple_assign_lhs (gs
);
253 tree rhs
= gimple_assign_rhs1 (gs
);
257 case VIEW_CONVERT_EXPR
:
259 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
262 case FIXED_CONVERT_EXPR
:
263 case ADDR_SPACE_CONVERT_EXPR
:
267 pp_character (buffer
, '(');
268 dump_generic_node (buffer
, TREE_TYPE (lhs
), spc
, flags
, false);
269 pp_string (buffer
, ") ");
270 if (op_prio (rhs
) < op_code_prio (rhs_code
))
272 pp_character (buffer
, '(');
273 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
274 pp_character (buffer
, ')');
277 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
281 pp_string (buffer
, "((");
282 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
283 pp_string (buffer
, "))");
287 pp_string (buffer
, "ABS_EXPR <");
288 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
289 pp_character (buffer
, '>');
293 if (TREE_CODE_CLASS (rhs_code
) == tcc_declaration
294 || TREE_CODE_CLASS (rhs_code
) == tcc_constant
295 || TREE_CODE_CLASS (rhs_code
) == tcc_reference
296 || rhs_code
== SSA_NAME
297 || rhs_code
== ADDR_EXPR
298 || rhs_code
== CONSTRUCTOR
)
300 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
303 else if (rhs_code
== BIT_NOT_EXPR
)
304 pp_character (buffer
, '~');
305 else if (rhs_code
== TRUTH_NOT_EXPR
)
306 pp_character (buffer
, '!');
307 else if (rhs_code
== NEGATE_EXPR
)
308 pp_character (buffer
, '-');
311 pp_character (buffer
, '[');
312 pp_string (buffer
, tree_code_name
[rhs_code
]);
313 pp_string (buffer
, "] ");
316 if (op_prio (rhs
) < op_code_prio (rhs_code
))
318 pp_character (buffer
, '(');
319 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
320 pp_character (buffer
, ')');
323 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
329 /* Helper for dump_gimple_assign. Print the binary RHS of the
330 assignment GS. BUFFER, SPC and FLAGS are as in dump_gimple_stmt. */
333 dump_binary_rhs (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
336 enum tree_code code
= gimple_assign_rhs_code (gs
);
342 case VEC_WIDEN_MULT_HI_EXPR
:
343 case VEC_WIDEN_MULT_LO_EXPR
:
344 case VEC_WIDEN_MULT_EVEN_EXPR
:
345 case VEC_WIDEN_MULT_ODD_EXPR
:
346 case VEC_PACK_TRUNC_EXPR
:
347 case VEC_PACK_SAT_EXPR
:
348 case VEC_PACK_FIX_TRUNC_EXPR
:
349 case VEC_WIDEN_LSHIFT_HI_EXPR
:
350 case VEC_WIDEN_LSHIFT_LO_EXPR
:
351 for (p
= tree_code_name
[(int) code
]; *p
; p
++)
352 pp_character (buffer
, TOUPPER (*p
));
353 pp_string (buffer
, " <");
354 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
355 pp_string (buffer
, ", ");
356 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
357 pp_character (buffer
, '>');
361 if (op_prio (gimple_assign_rhs1 (gs
)) <= op_code_prio (code
))
363 pp_character (buffer
, '(');
364 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
,
366 pp_character (buffer
, ')');
369 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
371 pp_string (buffer
, op_symbol_code (gimple_assign_rhs_code (gs
)));
373 if (op_prio (gimple_assign_rhs2 (gs
)) <= op_code_prio (code
))
375 pp_character (buffer
, '(');
376 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
,
378 pp_character (buffer
, ')');
381 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
385 /* Helper for dump_gimple_assign. Print the ternary RHS of the
386 assignment GS. BUFFER, SPC and FLAGS are as in dump_gimple_stmt. */
389 dump_ternary_rhs (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
392 enum tree_code code
= gimple_assign_rhs_code (gs
);
395 case WIDEN_MULT_PLUS_EXPR
:
396 case WIDEN_MULT_MINUS_EXPR
:
397 for (p
= tree_code_name
[(int) code
]; *p
; p
++)
398 pp_character (buffer
, TOUPPER (*p
));
399 pp_string (buffer
, " <");
400 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
401 pp_string (buffer
, ", ");
402 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
403 pp_string (buffer
, ", ");
404 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
405 pp_character (buffer
, '>');
409 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
410 pp_string (buffer
, " * ");
411 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
412 pp_string (buffer
, " + ");
413 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
417 pp_string (buffer
, "DOT_PROD_EXPR <");
418 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
419 pp_string (buffer
, ", ");
420 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
421 pp_string (buffer
, ", ");
422 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
423 pp_string (buffer
, ">");
427 pp_string (buffer
, "VEC_PERM_EXPR <");
428 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
429 pp_string (buffer
, ", ");
430 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
431 pp_string (buffer
, ", ");
432 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
433 pp_string (buffer
, ">");
436 case REALIGN_LOAD_EXPR
:
437 pp_string (buffer
, "REALIGN_LOAD <");
438 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
439 pp_string (buffer
, ", ");
440 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
441 pp_string (buffer
, ", ");
442 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
443 pp_string (buffer
, ">");
447 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
448 pp_string (buffer
, " ? ");
449 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
450 pp_string (buffer
, " : ");
451 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
455 pp_string (buffer
, "VEC_COND_EXPR <");
456 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
457 pp_string (buffer
, ", ");
458 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
459 pp_string (buffer
, ", ");
460 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
461 pp_string (buffer
, ">");
470 /* Dump the gimple assignment GS. BUFFER, SPC and FLAGS are as in
474 dump_gimple_assign (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
479 if (gimple_num_ops (gs
) == 2)
481 else if (gimple_num_ops (gs
) == 3)
482 last
= gimple_assign_rhs2 (gs
);
486 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%s, %T, %T, %T>", gs
,
487 tree_code_name
[gimple_assign_rhs_code (gs
)],
488 gimple_assign_lhs (gs
), gimple_assign_rhs1 (gs
), last
);
492 if (!(flags
& TDF_RHS_ONLY
))
494 dump_generic_node (buffer
, gimple_assign_lhs (gs
), spc
, flags
, false);
496 pp_character (buffer
, '=');
498 if (gimple_assign_nontemporal_move_p (gs
))
499 pp_string (buffer
, "{nt}");
501 if (gimple_has_volatile_ops (gs
))
502 pp_string (buffer
, "{v}");
507 if (gimple_num_ops (gs
) == 2)
508 dump_unary_rhs (buffer
, gs
, spc
, flags
);
509 else if (gimple_num_ops (gs
) == 3)
510 dump_binary_rhs (buffer
, gs
, spc
, flags
);
511 else if (gimple_num_ops (gs
) == 4)
512 dump_ternary_rhs (buffer
, gs
, spc
, flags
);
515 if (!(flags
& TDF_RHS_ONLY
))
516 pp_semicolon(buffer
);
521 /* Dump the return statement GS. BUFFER, SPC and FLAGS are as in
525 dump_gimple_return (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
529 t
= gimple_return_retval (gs
);
531 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
, t
);
534 pp_string (buffer
, "return");
538 dump_generic_node (buffer
, t
, spc
, flags
, false);
540 pp_semicolon (buffer
);
545 /* Dump the call arguments for a gimple call. BUFFER, FLAGS are as in
549 dump_gimple_call_args (pretty_printer
*buffer
, gimple gs
, int flags
)
553 for (i
= 0; i
< gimple_call_num_args (gs
); i
++)
555 dump_generic_node (buffer
, gimple_call_arg (gs
, i
), 0, flags
, false);
556 if (i
< gimple_call_num_args (gs
) - 1)
557 pp_string (buffer
, ", ");
560 if (gimple_call_va_arg_pack_p (gs
))
562 if (gimple_call_num_args (gs
) > 0)
564 pp_character (buffer
, ',');
568 pp_string (buffer
, "__builtin_va_arg_pack ()");
572 /* Dump the points-to solution *PT to BUFFER. */
575 pp_points_to_solution (pretty_printer
*buffer
, struct pt_solution
*pt
)
579 pp_string (buffer
, "anything ");
583 pp_string (buffer
, "nonlocal ");
585 pp_string (buffer
, "escaped ");
587 pp_string (buffer
, "unit-escaped ");
589 pp_string (buffer
, "null ");
591 && !bitmap_empty_p (pt
->vars
))
595 pp_string (buffer
, "{ ");
596 EXECUTE_IF_SET_IN_BITMAP (pt
->vars
, 0, i
, bi
)
598 tree var
= referenced_var_lookup (cfun
, i
);
601 dump_generic_node (buffer
, var
, 0, dump_flags
, false);
602 if (DECL_PT_UID (var
) != DECL_UID (var
))
604 pp_string (buffer
, "ptD.");
605 pp_decimal_int (buffer
, DECL_PT_UID (var
));
610 pp_string (buffer
, "D.");
611 pp_decimal_int (buffer
, i
);
613 pp_character (buffer
, ' ');
615 pp_character (buffer
, '}');
616 if (pt
->vars_contains_global
)
617 pp_string (buffer
, " (glob)");
621 /* Dump the call statement GS. BUFFER, SPC and FLAGS are as in
625 dump_gimple_call (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
627 tree lhs
= gimple_call_lhs (gs
);
628 tree fn
= gimple_call_fn (gs
);
630 if (flags
& TDF_ALIAS
)
632 struct pt_solution
*pt
;
633 pt
= gimple_call_use_set (gs
);
634 if (!pt_solution_empty_p (pt
))
636 pp_string (buffer
, "# USE = ");
637 pp_points_to_solution (buffer
, pt
);
638 newline_and_indent (buffer
, spc
);
640 pt
= gimple_call_clobber_set (gs
);
641 if (!pt_solution_empty_p (pt
))
643 pp_string (buffer
, "# CLB = ");
644 pp_points_to_solution (buffer
, pt
);
645 newline_and_indent (buffer
, spc
);
651 if (gimple_call_internal_p (gs
))
652 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%s, %T", gs
,
653 internal_fn_name (gimple_call_internal_fn (gs
)), lhs
);
655 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %T", gs
, fn
, lhs
);
656 if (gimple_call_num_args (gs
) > 0)
658 pp_string (buffer
, ", ");
659 dump_gimple_call_args (buffer
, gs
, flags
);
661 pp_character (buffer
, '>');
665 if (lhs
&& !(flags
& TDF_RHS_ONLY
))
667 dump_generic_node (buffer
, lhs
, spc
, flags
, false);
668 pp_string (buffer
, " =");
670 if (gimple_has_volatile_ops (gs
))
671 pp_string (buffer
, "{v}");
675 if (gimple_call_internal_p (gs
))
676 pp_string (buffer
, internal_fn_name (gimple_call_internal_fn (gs
)));
678 print_call_name (buffer
, fn
, flags
);
679 pp_string (buffer
, " (");
680 dump_gimple_call_args (buffer
, gs
, flags
);
681 pp_character (buffer
, ')');
682 if (!(flags
& TDF_RHS_ONLY
))
683 pp_semicolon (buffer
);
686 if (gimple_call_chain (gs
))
688 pp_string (buffer
, " [static-chain: ");
689 dump_generic_node (buffer
, gimple_call_chain (gs
), spc
, flags
, false);
690 pp_character (buffer
, ']');
693 if (gimple_call_return_slot_opt_p (gs
))
694 pp_string (buffer
, " [return slot optimization]");
695 if (gimple_call_tail_p (gs
))
696 pp_string (buffer
, " [tail call]");
701 /* Dump the arguments of _ITM_beginTransaction sanely. */
702 if (TREE_CODE (fn
) == ADDR_EXPR
)
703 fn
= TREE_OPERAND (fn
, 0);
704 if (TREE_CODE (fn
) == FUNCTION_DECL
&& decl_is_tm_clone (fn
))
705 pp_string (buffer
, " [tm-clone]");
706 if (TREE_CODE (fn
) == FUNCTION_DECL
707 && DECL_BUILT_IN_CLASS (fn
) == BUILT_IN_NORMAL
708 && DECL_FUNCTION_CODE (fn
) == BUILT_IN_TM_START
709 && gimple_call_num_args (gs
) > 0)
711 tree t
= gimple_call_arg (gs
, 0);
712 unsigned HOST_WIDE_INT props
;
713 gcc_assert (TREE_CODE (t
) == INTEGER_CST
);
715 pp_string (buffer
, " [ ");
717 /* Get the transaction code properties. */
718 props
= TREE_INT_CST_LOW (t
);
720 if (props
& PR_INSTRUMENTEDCODE
)
721 pp_string (buffer
, "instrumentedCode ");
722 if (props
& PR_UNINSTRUMENTEDCODE
)
723 pp_string (buffer
, "uninstrumentedCode ");
724 if (props
& PR_HASNOXMMUPDATE
)
725 pp_string (buffer
, "hasNoXMMUpdate ");
726 if (props
& PR_HASNOABORT
)
727 pp_string (buffer
, "hasNoAbort ");
728 if (props
& PR_HASNOIRREVOCABLE
)
729 pp_string (buffer
, "hasNoIrrevocable ");
730 if (props
& PR_DOESGOIRREVOCABLE
)
731 pp_string (buffer
, "doesGoIrrevocable ");
732 if (props
& PR_HASNOSIMPLEREADS
)
733 pp_string (buffer
, "hasNoSimpleReads ");
734 if (props
& PR_AWBARRIERSOMITTED
)
735 pp_string (buffer
, "awBarriersOmitted ");
736 if (props
& PR_RARBARRIERSOMITTED
)
737 pp_string (buffer
, "RaRBarriersOmitted ");
738 if (props
& PR_UNDOLOGCODE
)
739 pp_string (buffer
, "undoLogCode ");
740 if (props
& PR_PREFERUNINSTRUMENTED
)
741 pp_string (buffer
, "preferUninstrumented ");
742 if (props
& PR_EXCEPTIONBLOCK
)
743 pp_string (buffer
, "exceptionBlock ");
744 if (props
& PR_HASELSE
)
745 pp_string (buffer
, "hasElse ");
746 if (props
& PR_READONLY
)
747 pp_string (buffer
, "readOnly ");
749 pp_string (buffer
, "]");
754 /* Dump the switch statement GS. BUFFER, SPC and FLAGS are as in
758 dump_gimple_switch (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
762 GIMPLE_CHECK (gs
, GIMPLE_SWITCH
);
764 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, ", gs
,
765 gimple_switch_index (gs
));
768 pp_string (buffer
, "switch (");
769 dump_generic_node (buffer
, gimple_switch_index (gs
), spc
, flags
, true);
770 pp_string (buffer
, ") <");
773 for (i
= 0; i
< gimple_switch_num_labels (gs
); i
++)
775 tree case_label
= gimple_switch_label (gs
, i
);
776 if (case_label
== NULL_TREE
)
779 dump_generic_node (buffer
, case_label
, spc
, flags
, false);
780 pp_character (buffer
, ' ');
781 dump_generic_node (buffer
, CASE_LABEL (case_label
), spc
, flags
, false);
782 if (i
< gimple_switch_num_labels (gs
) - 1)
783 pp_string (buffer
, ", ");
785 pp_character (buffer
, '>');
789 /* Dump the gimple conditional GS. BUFFER, SPC and FLAGS are as in
793 dump_gimple_cond (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
796 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%s, %T, %T, %T, %T>", gs
,
797 tree_code_name
[gimple_cond_code (gs
)],
798 gimple_cond_lhs (gs
), gimple_cond_rhs (gs
),
799 gimple_cond_true_label (gs
), gimple_cond_false_label (gs
));
802 if (!(flags
& TDF_RHS_ONLY
))
803 pp_string (buffer
, "if (");
804 dump_generic_node (buffer
, gimple_cond_lhs (gs
), spc
, flags
, false);
806 pp_string (buffer
, op_symbol_code (gimple_cond_code (gs
)));
808 dump_generic_node (buffer
, gimple_cond_rhs (gs
), spc
, flags
, false);
809 if (!(flags
& TDF_RHS_ONLY
))
811 pp_character (buffer
, ')');
813 if (gimple_cond_true_label (gs
))
815 pp_string (buffer
, " goto ");
816 dump_generic_node (buffer
, gimple_cond_true_label (gs
),
818 pp_semicolon (buffer
);
820 if (gimple_cond_false_label (gs
))
822 pp_string (buffer
, " else goto ");
823 dump_generic_node (buffer
, gimple_cond_false_label (gs
),
825 pp_semicolon (buffer
);
832 /* Dump a GIMPLE_LABEL tuple on the pretty_printer BUFFER, SPC
833 spaces of indent. FLAGS specifies details to show in the dump (see
834 TDF_* in dumpfils.h). */
837 dump_gimple_label (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
839 tree label
= gimple_label_label (gs
);
841 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
, label
);
844 dump_generic_node (buffer
, label
, spc
, flags
, false);
845 pp_character (buffer
, ':');
847 if (DECL_NONLOCAL (label
))
848 pp_string (buffer
, " [non-local]");
849 if ((flags
& TDF_EH
) && EH_LANDING_PAD_NR (label
))
850 pp_printf (buffer
, " [LP %d]", EH_LANDING_PAD_NR (label
));
853 /* Dump a GIMPLE_GOTO tuple on the pretty_printer BUFFER, SPC
854 spaces of indent. FLAGS specifies details to show in the dump (see
855 TDF_* in dumpfile.h). */
858 dump_gimple_goto (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
860 tree label
= gimple_goto_dest (gs
);
862 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
, label
);
864 dump_gimple_fmt (buffer
, spc
, flags
, "goto %T;", label
);
868 /* Dump a GIMPLE_BIND tuple on the pretty_printer BUFFER, SPC
869 spaces of indent. FLAGS specifies details to show in the dump (see
870 TDF_* in dumpfile.h). */
873 dump_gimple_bind (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
876 dump_gimple_fmt (buffer
, spc
, flags
, "%G <", gs
);
878 pp_character (buffer
, '{');
879 if (!(flags
& TDF_SLIM
))
883 for (var
= gimple_bind_vars (gs
); var
; var
= DECL_CHAIN (var
))
885 newline_and_indent (buffer
, 2);
886 print_declaration (buffer
, var
, spc
, flags
);
888 if (gimple_bind_vars (gs
))
892 dump_gimple_seq (buffer
, gimple_bind_body (gs
), spc
+ 2, flags
);
893 newline_and_indent (buffer
, spc
);
895 pp_character (buffer
, '>');
897 pp_character (buffer
, '}');
901 /* Dump a GIMPLE_TRY tuple on the pretty_printer BUFFER, SPC spaces of
902 indent. FLAGS specifies details to show in the dump (see TDF_* in
906 dump_gimple_try (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
911 if (gimple_try_kind (gs
) == GIMPLE_TRY_CATCH
)
912 type
= "GIMPLE_TRY_CATCH";
913 else if (gimple_try_kind (gs
) == GIMPLE_TRY_FINALLY
)
914 type
= "GIMPLE_TRY_FINALLY";
916 type
= "UNKNOWN GIMPLE_TRY";
917 dump_gimple_fmt (buffer
, spc
, flags
,
918 "%G <%s,%+EVAL <%S>%nCLEANUP <%S>%->", gs
, type
,
919 gimple_try_eval (gs
), gimple_try_cleanup (gs
));
923 pp_string (buffer
, "try");
924 newline_and_indent (buffer
, spc
+ 2);
925 pp_character (buffer
, '{');
928 dump_gimple_seq (buffer
, gimple_try_eval (gs
), spc
+ 4, flags
);
929 newline_and_indent (buffer
, spc
+ 2);
930 pp_character (buffer
, '}');
932 if (gimple_try_kind (gs
) == GIMPLE_TRY_CATCH
)
934 newline_and_indent (buffer
, spc
);
935 pp_string (buffer
, "catch");
936 newline_and_indent (buffer
, spc
+ 2);
937 pp_character (buffer
, '{');
939 else if (gimple_try_kind (gs
) == GIMPLE_TRY_FINALLY
)
941 newline_and_indent (buffer
, spc
);
942 pp_string (buffer
, "finally");
943 newline_and_indent (buffer
, spc
+ 2);
944 pp_character (buffer
, '{');
947 pp_string (buffer
, " <UNKNOWN GIMPLE_TRY> {");
950 dump_gimple_seq (buffer
, gimple_try_cleanup (gs
), spc
+ 4, flags
);
951 newline_and_indent (buffer
, spc
+ 2);
952 pp_character (buffer
, '}');
957 /* Dump a GIMPLE_CATCH tuple on the pretty_printer BUFFER, SPC spaces of
958 indent. FLAGS specifies details to show in the dump (see TDF_* in
962 dump_gimple_catch (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
965 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %+CATCH <%S>%->", gs
,
966 gimple_catch_types (gs
), gimple_catch_handler (gs
));
968 dump_gimple_fmt (buffer
, spc
, flags
, "catch (%T)%+{%S}",
969 gimple_catch_types (gs
), gimple_catch_handler (gs
));
973 /* Dump a GIMPLE_EH_FILTER tuple on the pretty_printer BUFFER, SPC spaces of
974 indent. FLAGS specifies details to show in the dump (see TDF_* in
978 dump_gimple_eh_filter (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
981 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %+FAILURE <%S>%->", gs
,
982 gimple_eh_filter_types (gs
),
983 gimple_eh_filter_failure (gs
));
985 dump_gimple_fmt (buffer
, spc
, flags
, "<<<eh_filter (%T)>>>%+{%+%S%-}",
986 gimple_eh_filter_types (gs
),
987 gimple_eh_filter_failure (gs
));
991 /* Dump a GIMPLE_EH_MUST_NOT_THROW tuple. */
994 dump_gimple_eh_must_not_throw (pretty_printer
*buffer
, gimple gs
,
998 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
,
999 gimple_eh_must_not_throw_fndecl (gs
));
1001 dump_gimple_fmt (buffer
, spc
, flags
, "<<<eh_must_not_throw (%T)>>>",
1002 gimple_eh_must_not_throw_fndecl (gs
));
1006 /* Dump a GIMPLE_EH_ELSE tuple on the pretty_printer BUFFER, SPC spaces of
1007 indent. FLAGS specifies details to show in the dump (see TDF_* in
1011 dump_gimple_eh_else (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1013 if (flags
& TDF_RAW
)
1014 dump_gimple_fmt (buffer
, spc
, flags
,
1015 "%G <%+N_BODY <%S>%nE_BODY <%S>%->", gs
,
1016 gimple_eh_else_n_body (gs
), gimple_eh_else_e_body (gs
));
1018 dump_gimple_fmt (buffer
, spc
, flags
,
1019 "<<<if_normal_exit>>>%+{%S}%-<<<else_eh_exit>>>%+{%S}",
1020 gimple_eh_else_n_body (gs
), gimple_eh_else_e_body (gs
));
1024 /* Dump a GIMPLE_RESX tuple on the pretty_printer BUFFER, SPC spaces of
1025 indent. FLAGS specifies details to show in the dump (see TDF_* in
1029 dump_gimple_resx (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1031 if (flags
& TDF_RAW
)
1032 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%d>", gs
,
1033 gimple_resx_region (gs
));
1035 dump_gimple_fmt (buffer
, spc
, flags
, "resx %d", gimple_resx_region (gs
));
1038 /* Dump a GIMPLE_EH_DISPATCH tuple on the pretty_printer BUFFER. */
1041 dump_gimple_eh_dispatch (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1043 if (flags
& TDF_RAW
)
1044 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%d>", gs
,
1045 gimple_eh_dispatch_region (gs
));
1047 dump_gimple_fmt (buffer
, spc
, flags
, "eh_dispatch %d",
1048 gimple_eh_dispatch_region (gs
));
1051 /* Dump a GIMPLE_DEBUG tuple on the pretty_printer BUFFER, SPC spaces
1052 of indent. FLAGS specifies details to show in the dump (see TDF_*
1056 dump_gimple_debug (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1058 switch (gs
->gsbase
.subcode
)
1060 case GIMPLE_DEBUG_BIND
:
1061 if (flags
& TDF_RAW
)
1062 dump_gimple_fmt (buffer
, spc
, flags
, "%G BIND <%T, %T>", gs
,
1063 gimple_debug_bind_get_var (gs
),
1064 gimple_debug_bind_get_value (gs
));
1066 dump_gimple_fmt (buffer
, spc
, flags
, "# DEBUG %T => %T",
1067 gimple_debug_bind_get_var (gs
),
1068 gimple_debug_bind_get_value (gs
));
1071 case GIMPLE_DEBUG_SOURCE_BIND
:
1072 if (flags
& TDF_RAW
)
1073 dump_gimple_fmt (buffer
, spc
, flags
, "%G SRCBIND <%T, %T>", gs
,
1074 gimple_debug_source_bind_get_var (gs
),
1075 gimple_debug_source_bind_get_value (gs
));
1077 dump_gimple_fmt (buffer
, spc
, flags
, "# DEBUG %T s=> %T",
1078 gimple_debug_source_bind_get_var (gs
),
1079 gimple_debug_source_bind_get_value (gs
));
1087 /* Dump a GIMPLE_OMP_FOR tuple on the pretty_printer BUFFER. */
1089 dump_gimple_omp_for (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1093 if (flags
& TDF_RAW
)
1095 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1096 gimple_omp_body (gs
));
1097 dump_omp_clauses (buffer
, gimple_omp_for_clauses (gs
), spc
, flags
);
1098 dump_gimple_fmt (buffer
, spc
, flags
, " >,");
1099 for (i
= 0; i
< gimple_omp_for_collapse (gs
); i
++)
1100 dump_gimple_fmt (buffer
, spc
, flags
,
1101 "%+%T, %T, %T, %s, %T,%n",
1102 gimple_omp_for_index (gs
, i
),
1103 gimple_omp_for_initial (gs
, i
),
1104 gimple_omp_for_final (gs
, i
),
1105 tree_code_name
[gimple_omp_for_cond (gs
, i
)],
1106 gimple_omp_for_incr (gs
, i
));
1107 dump_gimple_fmt (buffer
, spc
, flags
, "PRE_BODY <%S>%->",
1108 gimple_omp_for_pre_body (gs
));
1112 pp_string (buffer
, "#pragma omp for");
1113 dump_omp_clauses (buffer
, gimple_omp_for_clauses (gs
), spc
, flags
);
1114 for (i
= 0; i
< gimple_omp_for_collapse (gs
); i
++)
1118 newline_and_indent (buffer
, spc
);
1119 pp_string (buffer
, "for (");
1120 dump_generic_node (buffer
, gimple_omp_for_index (gs
, i
), spc
,
1122 pp_string (buffer
, " = ");
1123 dump_generic_node (buffer
, gimple_omp_for_initial (gs
, i
), spc
,
1125 pp_string (buffer
, "; ");
1127 dump_generic_node (buffer
, gimple_omp_for_index (gs
, i
), spc
,
1130 switch (gimple_omp_for_cond (gs
, i
))
1133 pp_character (buffer
, '<');
1136 pp_character (buffer
, '>');
1139 pp_string (buffer
, "<=");
1142 pp_string (buffer
, ">=");
1148 dump_generic_node (buffer
, gimple_omp_for_final (gs
, i
), spc
,
1150 pp_string (buffer
, "; ");
1152 dump_generic_node (buffer
, gimple_omp_for_index (gs
, i
), spc
,
1154 pp_string (buffer
, " = ");
1155 dump_generic_node (buffer
, gimple_omp_for_incr (gs
, i
), spc
,
1157 pp_character (buffer
, ')');
1160 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1162 newline_and_indent (buffer
, spc
+ 2);
1163 pp_character (buffer
, '{');
1164 pp_newline (buffer
);
1165 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1166 newline_and_indent (buffer
, spc
+ 2);
1167 pp_character (buffer
, '}');
1172 /* Dump a GIMPLE_OMP_CONTINUE tuple on the pretty_printer BUFFER. */
1175 dump_gimple_omp_continue (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1177 if (flags
& TDF_RAW
)
1179 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %T>", gs
,
1180 gimple_omp_continue_control_def (gs
),
1181 gimple_omp_continue_control_use (gs
));
1185 pp_string (buffer
, "#pragma omp continue (");
1186 dump_generic_node (buffer
, gimple_omp_continue_control_def (gs
),
1188 pp_character (buffer
, ',');
1190 dump_generic_node (buffer
, gimple_omp_continue_control_use (gs
),
1192 pp_character (buffer
, ')');
1196 /* Dump a GIMPLE_OMP_SINGLE tuple on the pretty_printer BUFFER. */
1199 dump_gimple_omp_single (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1201 if (flags
& TDF_RAW
)
1203 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1204 gimple_omp_body (gs
));
1205 dump_omp_clauses (buffer
, gimple_omp_single_clauses (gs
), spc
, flags
);
1206 dump_gimple_fmt (buffer
, spc
, flags
, " >");
1210 pp_string (buffer
, "#pragma omp single");
1211 dump_omp_clauses (buffer
, gimple_omp_single_clauses (gs
), spc
, flags
);
1212 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1214 newline_and_indent (buffer
, spc
+ 2);
1215 pp_character (buffer
, '{');
1216 pp_newline (buffer
);
1217 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1218 newline_and_indent (buffer
, spc
+ 2);
1219 pp_character (buffer
, '}');
1224 /* Dump a GIMPLE_OMP_SECTIONS tuple on the pretty_printer BUFFER. */
1227 dump_gimple_omp_sections (pretty_printer
*buffer
, gimple gs
, int spc
,
1230 if (flags
& TDF_RAW
)
1232 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1233 gimple_omp_body (gs
));
1234 dump_omp_clauses (buffer
, gimple_omp_sections_clauses (gs
), spc
, flags
);
1235 dump_gimple_fmt (buffer
, spc
, flags
, " >");
1239 pp_string (buffer
, "#pragma omp sections");
1240 if (gimple_omp_sections_control (gs
))
1242 pp_string (buffer
, " <");
1243 dump_generic_node (buffer
, gimple_omp_sections_control (gs
), spc
,
1245 pp_character (buffer
, '>');
1247 dump_omp_clauses (buffer
, gimple_omp_sections_clauses (gs
), spc
, flags
);
1248 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1250 newline_and_indent (buffer
, spc
+ 2);
1251 pp_character (buffer
, '{');
1252 pp_newline (buffer
);
1253 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1254 newline_and_indent (buffer
, spc
+ 2);
1255 pp_character (buffer
, '}');
1260 /* Dump a GIMPLE_OMP_{MASTER,ORDERED,SECTION} tuple on the pretty_printer
1264 dump_gimple_omp_block (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1266 if (flags
& TDF_RAW
)
1267 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S> >", gs
,
1268 gimple_omp_body (gs
));
1271 switch (gimple_code (gs
))
1273 case GIMPLE_OMP_MASTER
:
1274 pp_string (buffer
, "#pragma omp master");
1276 case GIMPLE_OMP_ORDERED
:
1277 pp_string (buffer
, "#pragma omp ordered");
1279 case GIMPLE_OMP_SECTION
:
1280 pp_string (buffer
, "#pragma omp section");
1285 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1287 newline_and_indent (buffer
, spc
+ 2);
1288 pp_character (buffer
, '{');
1289 pp_newline (buffer
);
1290 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1291 newline_and_indent (buffer
, spc
+ 2);
1292 pp_character (buffer
, '}');
1297 /* Dump a GIMPLE_OMP_CRITICAL tuple on the pretty_printer BUFFER. */
1300 dump_gimple_omp_critical (pretty_printer
*buffer
, gimple gs
, int spc
,
1303 if (flags
& TDF_RAW
)
1304 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S> >", gs
,
1305 gimple_omp_body (gs
));
1308 pp_string (buffer
, "#pragma omp critical");
1309 if (gimple_omp_critical_name (gs
))
1311 pp_string (buffer
, " (");
1312 dump_generic_node (buffer
, gimple_omp_critical_name (gs
), spc
,
1314 pp_character (buffer
, ')');
1316 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1318 newline_and_indent (buffer
, spc
+ 2);
1319 pp_character (buffer
, '{');
1320 pp_newline (buffer
);
1321 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1322 newline_and_indent (buffer
, spc
+ 2);
1323 pp_character (buffer
, '}');
1328 /* Dump a GIMPLE_OMP_RETURN tuple on the pretty_printer BUFFER. */
1331 dump_gimple_omp_return (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1333 if (flags
& TDF_RAW
)
1335 dump_gimple_fmt (buffer
, spc
, flags
, "%G <nowait=%d>", gs
,
1336 (int) gimple_omp_return_nowait_p (gs
));
1340 pp_string (buffer
, "#pragma omp return");
1341 if (gimple_omp_return_nowait_p (gs
))
1342 pp_string (buffer
, "(nowait)");
1346 /* Dump a GIMPLE_TRANSACTION tuple on the pretty_printer BUFFER. */
1349 dump_gimple_transaction (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1351 unsigned subcode
= gimple_transaction_subcode (gs
);
1353 if (flags
& TDF_RAW
)
1355 dump_gimple_fmt (buffer
, spc
, flags
,
1356 "%G [SUBCODE=%x,LABEL=%T] <%+BODY <%S> >",
1357 gs
, subcode
, gimple_transaction_label (gs
),
1358 gimple_transaction_body (gs
));
1362 if (subcode
& GTMA_IS_OUTER
)
1363 pp_string (buffer
, "__transaction_atomic [[outer]]");
1364 else if (subcode
& GTMA_IS_RELAXED
)
1365 pp_string (buffer
, "__transaction_relaxed");
1367 pp_string (buffer
, "__transaction_atomic");
1368 subcode
&= ~GTMA_DECLARATION_MASK
;
1370 if (subcode
|| gimple_transaction_label (gs
))
1372 pp_string (buffer
, " //");
1373 if (gimple_transaction_label (gs
))
1375 pp_string (buffer
, " LABEL=");
1376 dump_generic_node (buffer
, gimple_transaction_label (gs
),
1381 pp_string (buffer
, " SUBCODE=[ ");
1382 if (subcode
& GTMA_HAVE_ABORT
)
1384 pp_string (buffer
, "GTMA_HAVE_ABORT ");
1385 subcode
&= ~GTMA_HAVE_ABORT
;
1387 if (subcode
& GTMA_HAVE_LOAD
)
1389 pp_string (buffer
, "GTMA_HAVE_LOAD ");
1390 subcode
&= ~GTMA_HAVE_LOAD
;
1392 if (subcode
& GTMA_HAVE_STORE
)
1394 pp_string (buffer
, "GTMA_HAVE_STORE ");
1395 subcode
&= ~GTMA_HAVE_STORE
;
1397 if (subcode
& GTMA_MAY_ENTER_IRREVOCABLE
)
1399 pp_string (buffer
, "GTMA_MAY_ENTER_IRREVOCABLE ");
1400 subcode
&= ~GTMA_MAY_ENTER_IRREVOCABLE
;
1402 if (subcode
& GTMA_DOES_GO_IRREVOCABLE
)
1404 pp_string (buffer
, "GTMA_DOES_GO_IRREVOCABLE ");
1405 subcode
&= ~GTMA_DOES_GO_IRREVOCABLE
;
1408 pp_printf (buffer
, "0x%x ", subcode
);
1409 pp_string (buffer
, "]");
1413 if (!gimple_seq_empty_p (gimple_transaction_body (gs
)))
1415 newline_and_indent (buffer
, spc
+ 2);
1416 pp_character (buffer
, '{');
1417 pp_newline (buffer
);
1418 dump_gimple_seq (buffer
, gimple_transaction_body (gs
),
1420 newline_and_indent (buffer
, spc
+ 2);
1421 pp_character (buffer
, '}');
1426 /* Dump a GIMPLE_ASM tuple on the pretty_printer BUFFER, SPC spaces of
1427 indent. FLAGS specifies details to show in the dump (see TDF_* in
1431 dump_gimple_asm (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1433 unsigned int i
, n
, f
, fields
;
1435 if (flags
& TDF_RAW
)
1437 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+STRING <%n%s%n>", gs
,
1438 gimple_asm_string (gs
));
1440 n
= gimple_asm_noutputs (gs
);
1443 newline_and_indent (buffer
, spc
+ 2);
1444 pp_string (buffer
, "OUTPUT: ");
1445 for (i
= 0; i
< n
; i
++)
1447 dump_generic_node (buffer
, gimple_asm_output_op (gs
, i
),
1450 pp_string (buffer
, ", ");
1454 n
= gimple_asm_ninputs (gs
);
1457 newline_and_indent (buffer
, spc
+ 2);
1458 pp_string (buffer
, "INPUT: ");
1459 for (i
= 0; i
< n
; i
++)
1461 dump_generic_node (buffer
, gimple_asm_input_op (gs
, i
),
1464 pp_string (buffer
, ", ");
1468 n
= gimple_asm_nclobbers (gs
);
1471 newline_and_indent (buffer
, spc
+ 2);
1472 pp_string (buffer
, "CLOBBER: ");
1473 for (i
= 0; i
< n
; i
++)
1475 dump_generic_node (buffer
, gimple_asm_clobber_op (gs
, i
),
1478 pp_string (buffer
, ", ");
1482 n
= gimple_asm_nlabels (gs
);
1485 newline_and_indent (buffer
, spc
+ 2);
1486 pp_string (buffer
, "LABEL: ");
1487 for (i
= 0; i
< n
; i
++)
1489 dump_generic_node (buffer
, gimple_asm_label_op (gs
, i
),
1492 pp_string (buffer
, ", ");
1496 newline_and_indent (buffer
, spc
);
1497 pp_character (buffer
, '>');
1501 pp_string (buffer
, "__asm__");
1502 if (gimple_asm_volatile_p (gs
))
1503 pp_string (buffer
, " __volatile__");
1504 if (gimple_asm_nlabels (gs
))
1505 pp_string (buffer
, " goto");
1506 pp_string (buffer
, "(\"");
1507 pp_string (buffer
, gimple_asm_string (gs
));
1508 pp_string (buffer
, "\"");
1510 if (gimple_asm_nlabels (gs
))
1512 else if (gimple_asm_nclobbers (gs
))
1514 else if (gimple_asm_ninputs (gs
))
1516 else if (gimple_asm_noutputs (gs
))
1521 for (f
= 0; f
< fields
; ++f
)
1523 pp_string (buffer
, " : ");
1528 n
= gimple_asm_noutputs (gs
);
1529 for (i
= 0; i
< n
; i
++)
1531 dump_generic_node (buffer
, gimple_asm_output_op (gs
, i
),
1534 pp_string (buffer
, ", ");
1539 n
= gimple_asm_ninputs (gs
);
1540 for (i
= 0; i
< n
; i
++)
1542 dump_generic_node (buffer
, gimple_asm_input_op (gs
, i
),
1545 pp_string (buffer
, ", ");
1550 n
= gimple_asm_nclobbers (gs
);
1551 for (i
= 0; i
< n
; i
++)
1553 dump_generic_node (buffer
, gimple_asm_clobber_op (gs
, i
),
1556 pp_string (buffer
, ", ");
1561 n
= gimple_asm_nlabels (gs
);
1562 for (i
= 0; i
< n
; i
++)
1564 dump_generic_node (buffer
, gimple_asm_label_op (gs
, i
),
1567 pp_string (buffer
, ", ");
1576 pp_string (buffer
, ");");
1581 /* Dump a PHI node PHI. BUFFER, SPC and FLAGS are as in
1582 dump_gimple_stmt. */
1585 dump_gimple_phi (pretty_printer
*buffer
, gimple phi
, int spc
, int flags
)
1588 tree lhs
= gimple_phi_result (phi
);
1590 if (flags
& TDF_ALIAS
1591 && POINTER_TYPE_P (TREE_TYPE (lhs
))
1592 && SSA_NAME_PTR_INFO (lhs
))
1594 unsigned int align
, misalign
;
1595 struct ptr_info_def
*pi
= SSA_NAME_PTR_INFO (lhs
);
1596 pp_string (buffer
, "PT = ");
1597 pp_points_to_solution (buffer
, &pi
->pt
);
1598 newline_and_indent (buffer
, spc
);
1599 if (get_ptr_info_alignment (pi
, &align
, &misalign
))
1601 pp_printf (buffer
, "# ALIGN = %u, MISALIGN = %u", align
, misalign
);
1602 newline_and_indent (buffer
, spc
);
1604 pp_string (buffer
, "# ");
1607 if (flags
& TDF_RAW
)
1608 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, ", phi
,
1609 gimple_phi_result (phi
));
1612 dump_generic_node (buffer
, lhs
, spc
, flags
, false);
1613 pp_string (buffer
, " = PHI <");
1615 for (i
= 0; i
< gimple_phi_num_args (phi
); i
++)
1617 if ((flags
& TDF_LINENO
) && gimple_phi_arg_has_location (phi
, i
))
1619 expanded_location xloc
;
1621 xloc
= expand_location (gimple_phi_arg_location (phi
, i
));
1622 pp_character (buffer
, '[');
1625 pp_string (buffer
, xloc
.file
);
1626 pp_string (buffer
, " : ");
1628 pp_decimal_int (buffer
, xloc
.line
);
1629 pp_string (buffer
, ":");
1630 pp_decimal_int (buffer
, xloc
.column
);
1631 pp_string (buffer
, "] ");
1633 dump_generic_node (buffer
, gimple_phi_arg_def (phi
, i
), spc
, flags
,
1635 pp_character (buffer
, '(');
1636 pp_decimal_int (buffer
, gimple_phi_arg_edge (phi
, i
)->src
->index
);
1637 pp_character (buffer
, ')');
1638 if (i
< gimple_phi_num_args (phi
) - 1)
1639 pp_string (buffer
, ", ");
1641 pp_character (buffer
, '>');
1645 /* Dump a GIMPLE_OMP_PARALLEL tuple on the pretty_printer BUFFER, SPC spaces
1646 of indent. FLAGS specifies details to show in the dump (see TDF_* in
1650 dump_gimple_omp_parallel (pretty_printer
*buffer
, gimple gs
, int spc
,
1653 if (flags
& TDF_RAW
)
1655 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1656 gimple_omp_body (gs
));
1657 dump_omp_clauses (buffer
, gimple_omp_parallel_clauses (gs
), spc
, flags
);
1658 dump_gimple_fmt (buffer
, spc
, flags
, " >, %T, %T%n>",
1659 gimple_omp_parallel_child_fn (gs
),
1660 gimple_omp_parallel_data_arg (gs
));
1665 pp_string (buffer
, "#pragma omp parallel");
1666 dump_omp_clauses (buffer
, gimple_omp_parallel_clauses (gs
), spc
, flags
);
1667 if (gimple_omp_parallel_child_fn (gs
))
1669 pp_string (buffer
, " [child fn: ");
1670 dump_generic_node (buffer
, gimple_omp_parallel_child_fn (gs
),
1672 pp_string (buffer
, " (");
1673 if (gimple_omp_parallel_data_arg (gs
))
1674 dump_generic_node (buffer
, gimple_omp_parallel_data_arg (gs
),
1677 pp_string (buffer
, "???");
1678 pp_string (buffer
, ")]");
1680 body
= gimple_omp_body (gs
);
1681 if (body
&& gimple_code (gimple_seq_first_stmt (body
)) != GIMPLE_BIND
)
1683 newline_and_indent (buffer
, spc
+ 2);
1684 pp_character (buffer
, '{');
1685 pp_newline (buffer
);
1686 dump_gimple_seq (buffer
, body
, spc
+ 4, flags
);
1687 newline_and_indent (buffer
, spc
+ 2);
1688 pp_character (buffer
, '}');
1692 pp_newline (buffer
);
1693 dump_gimple_seq (buffer
, body
, spc
+ 2, flags
);
1699 /* Dump a GIMPLE_OMP_TASK tuple on the pretty_printer BUFFER, SPC spaces
1700 of indent. FLAGS specifies details to show in the dump (see TDF_* in
1704 dump_gimple_omp_task (pretty_printer
*buffer
, gimple gs
, int spc
,
1707 if (flags
& TDF_RAW
)
1709 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1710 gimple_omp_body (gs
));
1711 dump_omp_clauses (buffer
, gimple_omp_task_clauses (gs
), spc
, flags
);
1712 dump_gimple_fmt (buffer
, spc
, flags
, " >, %T, %T, %T, %T, %T%n>",
1713 gimple_omp_task_child_fn (gs
),
1714 gimple_omp_task_data_arg (gs
),
1715 gimple_omp_task_copy_fn (gs
),
1716 gimple_omp_task_arg_size (gs
),
1717 gimple_omp_task_arg_size (gs
));
1722 pp_string (buffer
, "#pragma omp task");
1723 dump_omp_clauses (buffer
, gimple_omp_task_clauses (gs
), spc
, flags
);
1724 if (gimple_omp_task_child_fn (gs
))
1726 pp_string (buffer
, " [child fn: ");
1727 dump_generic_node (buffer
, gimple_omp_task_child_fn (gs
),
1729 pp_string (buffer
, " (");
1730 if (gimple_omp_task_data_arg (gs
))
1731 dump_generic_node (buffer
, gimple_omp_task_data_arg (gs
),
1734 pp_string (buffer
, "???");
1735 pp_string (buffer
, ")]");
1737 body
= gimple_omp_body (gs
);
1738 if (body
&& gimple_code (gimple_seq_first_stmt (body
)) != GIMPLE_BIND
)
1740 newline_and_indent (buffer
, spc
+ 2);
1741 pp_character (buffer
, '{');
1742 pp_newline (buffer
);
1743 dump_gimple_seq (buffer
, body
, spc
+ 4, flags
);
1744 newline_and_indent (buffer
, spc
+ 2);
1745 pp_character (buffer
, '}');
1749 pp_newline (buffer
);
1750 dump_gimple_seq (buffer
, body
, spc
+ 2, flags
);
1756 /* Dump a GIMPLE_OMP_ATOMIC_LOAD tuple on the pretty_printer BUFFER, SPC
1757 spaces of indent. FLAGS specifies details to show in the dump (see TDF_*
1761 dump_gimple_omp_atomic_load (pretty_printer
*buffer
, gimple gs
, int spc
,
1764 if (flags
& TDF_RAW
)
1766 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %T>", gs
,
1767 gimple_omp_atomic_load_lhs (gs
),
1768 gimple_omp_atomic_load_rhs (gs
));
1772 pp_string (buffer
, "#pragma omp atomic_load");
1773 if (gimple_omp_atomic_need_value_p (gs
))
1774 pp_string (buffer
, " [needed]");
1775 newline_and_indent (buffer
, spc
+ 2);
1776 dump_generic_node (buffer
, gimple_omp_atomic_load_lhs (gs
),
1779 pp_character (buffer
, '=');
1781 pp_character (buffer
, '*');
1782 dump_generic_node (buffer
, gimple_omp_atomic_load_rhs (gs
),
1787 /* Dump a GIMPLE_OMP_ATOMIC_STORE tuple on the pretty_printer BUFFER, SPC
1788 spaces of indent. FLAGS specifies details to show in the dump (see TDF_*
1792 dump_gimple_omp_atomic_store (pretty_printer
*buffer
, gimple gs
, int spc
,
1795 if (flags
& TDF_RAW
)
1797 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
,
1798 gimple_omp_atomic_store_val (gs
));
1802 pp_string (buffer
, "#pragma omp atomic_store ");
1803 if (gimple_omp_atomic_need_value_p (gs
))
1804 pp_string (buffer
, "[needed] ");
1805 pp_character (buffer
, '(');
1806 dump_generic_node (buffer
, gimple_omp_atomic_store_val (gs
),
1808 pp_character (buffer
, ')');
1813 /* Dump all the memory operands for statement GS. BUFFER, SPC and
1814 FLAGS are as in dump_gimple_stmt. */
1817 dump_gimple_mem_ops (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1819 tree vdef
= gimple_vdef (gs
);
1820 tree vuse
= gimple_vuse (gs
);
1822 if (!ssa_operands_active () || !gimple_references_memory_p (gs
))
1825 if (vdef
!= NULL_TREE
)
1827 pp_string (buffer
, "# ");
1828 dump_generic_node (buffer
, vdef
, spc
+ 2, flags
, false);
1829 pp_string (buffer
, " = VDEF <");
1830 dump_generic_node (buffer
, vuse
, spc
+ 2, flags
, false);
1831 pp_character (buffer
, '>');
1832 newline_and_indent (buffer
, spc
);
1834 else if (vuse
!= NULL_TREE
)
1836 pp_string (buffer
, "# VUSE <");
1837 dump_generic_node (buffer
, vuse
, spc
+ 2, flags
, false);
1838 pp_character (buffer
, '>');
1839 newline_and_indent (buffer
, spc
);
1844 /* Dump the gimple statement GS on the pretty printer BUFFER, SPC
1845 spaces of indent. FLAGS specifies details to show in the dump (see
1846 TDF_* in dumpfile.h). */
1849 dump_gimple_stmt (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1854 if (flags
& TDF_STMTADDR
)
1855 pp_printf (buffer
, "<&%p> ", (void *) gs
);
1857 if ((flags
& TDF_LINENO
) && gimple_has_location (gs
))
1859 expanded_location xloc
= expand_location (gimple_location (gs
));
1860 pp_character (buffer
, '[');
1863 pp_string (buffer
, xloc
.file
);
1864 pp_string (buffer
, " : ");
1866 pp_decimal_int (buffer
, xloc
.line
);
1867 pp_string (buffer
, ":");
1868 pp_decimal_int (buffer
, xloc
.column
);
1869 pp_string (buffer
, "] ");
1874 int lp_nr
= lookup_stmt_eh_lp (gs
);
1876 pp_printf (buffer
, "[LP %d] ", lp_nr
);
1878 pp_printf (buffer
, "[MNT %d] ", -lp_nr
);
1881 if ((flags
& (TDF_VOPS
|TDF_MEMSYMS
))
1882 && gimple_has_mem_ops (gs
))
1883 dump_gimple_mem_ops (buffer
, gs
, spc
, flags
);
1885 if ((flags
& TDF_ALIAS
)
1886 && gimple_has_lhs (gs
))
1888 tree lhs
= gimple_get_lhs (gs
);
1889 if (TREE_CODE (lhs
) == SSA_NAME
1890 && POINTER_TYPE_P (TREE_TYPE (lhs
))
1891 && SSA_NAME_PTR_INFO (lhs
))
1893 unsigned int align
, misalign
;
1894 struct ptr_info_def
*pi
= SSA_NAME_PTR_INFO (lhs
);
1895 pp_string (buffer
, "# PT = ");
1896 pp_points_to_solution (buffer
, &pi
->pt
);
1897 newline_and_indent (buffer
, spc
);
1898 if (get_ptr_info_alignment (pi
, &align
, &misalign
))
1900 pp_printf (buffer
, "# ALIGN = %u, MISALIGN = %u",
1902 newline_and_indent (buffer
, spc
);
1907 switch (gimple_code (gs
))
1910 dump_gimple_asm (buffer
, gs
, spc
, flags
);
1914 dump_gimple_assign (buffer
, gs
, spc
, flags
);
1918 dump_gimple_bind (buffer
, gs
, spc
, flags
);
1922 dump_gimple_call (buffer
, gs
, spc
, flags
);
1926 dump_gimple_cond (buffer
, gs
, spc
, flags
);
1930 dump_gimple_label (buffer
, gs
, spc
, flags
);
1934 dump_gimple_goto (buffer
, gs
, spc
, flags
);
1938 pp_string (buffer
, "GIMPLE_NOP");
1942 dump_gimple_return (buffer
, gs
, spc
, flags
);
1946 dump_gimple_switch (buffer
, gs
, spc
, flags
);
1950 dump_gimple_try (buffer
, gs
, spc
, flags
);
1954 dump_gimple_phi (buffer
, gs
, spc
, flags
);
1957 case GIMPLE_OMP_PARALLEL
:
1958 dump_gimple_omp_parallel (buffer
, gs
, spc
, flags
);
1961 case GIMPLE_OMP_TASK
:
1962 dump_gimple_omp_task (buffer
, gs
, spc
, flags
);
1965 case GIMPLE_OMP_ATOMIC_LOAD
:
1966 dump_gimple_omp_atomic_load (buffer
, gs
, spc
, flags
);
1970 case GIMPLE_OMP_ATOMIC_STORE
:
1971 dump_gimple_omp_atomic_store (buffer
, gs
, spc
, flags
);
1974 case GIMPLE_OMP_FOR
:
1975 dump_gimple_omp_for (buffer
, gs
, spc
, flags
);
1978 case GIMPLE_OMP_CONTINUE
:
1979 dump_gimple_omp_continue (buffer
, gs
, spc
, flags
);
1982 case GIMPLE_OMP_SINGLE
:
1983 dump_gimple_omp_single (buffer
, gs
, spc
, flags
);
1986 case GIMPLE_OMP_RETURN
:
1987 dump_gimple_omp_return (buffer
, gs
, spc
, flags
);
1990 case GIMPLE_OMP_SECTIONS
:
1991 dump_gimple_omp_sections (buffer
, gs
, spc
, flags
);
1994 case GIMPLE_OMP_SECTIONS_SWITCH
:
1995 pp_string (buffer
, "GIMPLE_SECTIONS_SWITCH");
1998 case GIMPLE_OMP_MASTER
:
1999 case GIMPLE_OMP_ORDERED
:
2000 case GIMPLE_OMP_SECTION
:
2001 dump_gimple_omp_block (buffer
, gs
, spc
, flags
);
2004 case GIMPLE_OMP_CRITICAL
:
2005 dump_gimple_omp_critical (buffer
, gs
, spc
, flags
);
2009 dump_gimple_catch (buffer
, gs
, spc
, flags
);
2012 case GIMPLE_EH_FILTER
:
2013 dump_gimple_eh_filter (buffer
, gs
, spc
, flags
);
2016 case GIMPLE_EH_MUST_NOT_THROW
:
2017 dump_gimple_eh_must_not_throw (buffer
, gs
, spc
, flags
);
2020 case GIMPLE_EH_ELSE
:
2021 dump_gimple_eh_else (buffer
, gs
, spc
, flags
);
2025 dump_gimple_resx (buffer
, gs
, spc
, flags
);
2028 case GIMPLE_EH_DISPATCH
:
2029 dump_gimple_eh_dispatch (buffer
, gs
, spc
, flags
);
2033 dump_gimple_debug (buffer
, gs
, spc
, flags
);
2036 case GIMPLE_PREDICT
:
2037 pp_string (buffer
, "// predicted ");
2038 if (gimple_predict_outcome (gs
))
2039 pp_string (buffer
, "likely by ");
2041 pp_string (buffer
, "unlikely by ");
2042 pp_string (buffer
, predictor_name (gimple_predict_predictor (gs
)));
2043 pp_string (buffer
, " predictor.");
2046 case GIMPLE_TRANSACTION
:
2047 dump_gimple_transaction (buffer
, gs
, spc
, flags
);
2054 /* If we're building a diagnostic, the formatted text will be
2055 written into BUFFER's stream by the caller; otherwise, write it
2057 if (!(flags
& TDF_DIAGNOSTIC
))
2058 pp_write_text_to_stream (buffer
);
2062 /* Dumps header of basic block BB to OUTF indented by INDENT
2063 spaces and details described by flags. */
2066 dump_gimple_bb_header (FILE *outf
, basic_block bb
, int indent
, int flags
)
2068 if (flags
& TDF_BLOCKS
)
2070 dump_bb_info (outf
, bb
, indent
, flags
, true, false);
2072 if (flags
& TDF_LINENO
)
2074 gimple_stmt_iterator gsi
;
2075 char *s_indent
= (char *) alloca ((size_t) indent
+ 1);
2076 memset (s_indent
, ' ', (size_t) indent
);
2077 s_indent
[indent
] = '\0';
2079 if (flags
& TDF_COMMENT
)
2080 fputs (";; ", outf
);
2082 for (gsi
= gsi_start_bb (bb
); !gsi_end_p (gsi
); gsi_next (&gsi
))
2083 if (!is_gimple_debug (gsi_stmt (gsi
))
2084 && get_lineno (gsi_stmt (gsi
)) != UNKNOWN_LOCATION
)
2086 fprintf (outf
, "%sstarting at line %d",
2087 s_indent
, get_lineno (gsi_stmt (gsi
)));
2090 if (bb
->discriminator
)
2091 fprintf (outf
, ", discriminator %i", bb
->discriminator
);
2097 gimple stmt
= first_stmt (bb
);
2098 if (!stmt
|| gimple_code (stmt
) != GIMPLE_LABEL
)
2100 char *s_indent
= (char *) alloca ((size_t) indent
- 2 + 1);
2101 memset (s_indent
, ' ', (size_t) indent
);
2102 s_indent
[indent
] = '\0';
2103 fprintf (outf
, "%s<bb %d>:\n", s_indent
, bb
->index
);
2107 check_bb_profile (bb
, outf
);
2111 /* Dumps end of basic block BB to buffer BUFFER indented by INDENT
2115 dump_gimple_bb_footer (FILE *outf
, basic_block bb
, int indent
, int flags
)
2117 dump_bb_info (outf
, bb
, indent
, flags
, false, true);
2121 /* Dump PHI nodes of basic block BB to BUFFER with details described
2122 by FLAGS and indented by INDENT spaces. */
2125 dump_phi_nodes (pretty_printer
*buffer
, basic_block bb
, int indent
, int flags
)
2127 gimple_stmt_iterator i
;
2129 for (i
= gsi_start_phis (bb
); !gsi_end_p (i
); gsi_next (&i
))
2131 gimple phi
= gsi_stmt (i
);
2132 if (is_gimple_reg (gimple_phi_result (phi
)) || (flags
& TDF_VOPS
))
2135 pp_string (buffer
, "# ");
2136 dump_gimple_phi (buffer
, phi
, indent
, flags
);
2137 pp_newline (buffer
);
2143 /* Dump jump to basic block BB that is represented implicitly in the cfg
2147 pp_cfg_jump (pretty_printer
*buffer
, basic_block bb
)
2151 stmt
= first_stmt (bb
);
2153 pp_string (buffer
, "goto <bb ");
2154 pp_decimal_int (buffer
, bb
->index
);
2155 pp_character (buffer
, '>');
2156 if (stmt
&& gimple_code (stmt
) == GIMPLE_LABEL
)
2158 pp_string (buffer
, " (");
2159 dump_generic_node (buffer
, gimple_label_label (stmt
), 0, 0, false);
2160 pp_character (buffer
, ')');
2161 pp_semicolon (buffer
);
2164 pp_semicolon (buffer
);
2168 /* Dump edges represented implicitly in basic block BB to BUFFER, indented
2169 by INDENT spaces, with details given by FLAGS. */
2172 dump_implicit_edges (pretty_printer
*buffer
, basic_block bb
, int indent
,
2178 stmt
= last_stmt (bb
);
2180 if (stmt
&& gimple_code (stmt
) == GIMPLE_COND
)
2182 edge true_edge
, false_edge
;
2184 /* When we are emitting the code or changing CFG, it is possible that
2185 the edges are not yet created. When we are using debug_bb in such
2186 a situation, we do not want it to crash. */
2187 if (EDGE_COUNT (bb
->succs
) != 2)
2189 extract_true_false_edges_from_block (bb
, &true_edge
, &false_edge
);
2191 INDENT (indent
+ 2);
2192 pp_cfg_jump (buffer
, true_edge
->dest
);
2193 newline_and_indent (buffer
, indent
);
2194 pp_string (buffer
, "else");
2195 newline_and_indent (buffer
, indent
+ 2);
2196 pp_cfg_jump (buffer
, false_edge
->dest
);
2197 pp_newline (buffer
);
2201 /* If there is a fallthru edge, we may need to add an artificial
2202 goto to the dump. */
2203 e
= find_fallthru_edge (bb
->succs
);
2205 if (e
&& e
->dest
!= bb
->next_bb
)
2209 if ((flags
& TDF_LINENO
)
2210 && e
->goto_locus
!= UNKNOWN_LOCATION
2213 expanded_location goto_xloc
;
2214 goto_xloc
= expand_location (e
->goto_locus
);
2215 pp_character (buffer
, '[');
2218 pp_string (buffer
, goto_xloc
.file
);
2219 pp_string (buffer
, " : ");
2221 pp_decimal_int (buffer
, goto_xloc
.line
);
2222 pp_string (buffer
, " : ");
2223 pp_decimal_int (buffer
, goto_xloc
.column
);
2224 pp_string (buffer
, "] ");
2227 pp_cfg_jump (buffer
, e
->dest
);
2228 pp_newline (buffer
);
2233 /* Dumps basic block BB to buffer BUFFER with details described by FLAGS and
2234 indented by INDENT spaces. */
2237 gimple_dump_bb_buff (pretty_printer
*buffer
, basic_block bb
, int indent
,
2240 gimple_stmt_iterator gsi
;
2242 int label_indent
= indent
- 2;
2244 if (label_indent
< 0)
2247 dump_phi_nodes (buffer
, bb
, indent
, flags
);
2249 for (gsi
= gsi_start_bb (bb
); !gsi_end_p (gsi
); gsi_next (&gsi
))
2253 stmt
= gsi_stmt (gsi
);
2255 curr_indent
= gimple_code (stmt
) == GIMPLE_LABEL
? label_indent
: indent
;
2257 INDENT (curr_indent
);
2258 dump_gimple_stmt (buffer
, stmt
, curr_indent
, flags
);
2259 pp_newline (buffer
);
2260 dump_histograms_for_stmt (cfun
, buffer
->buffer
->stream
, stmt
);
2263 dump_implicit_edges (buffer
, bb
, indent
, flags
);
2267 /* Dumps basic block BB to FILE with details described by FLAGS and
2268 indented by INDENT spaces. */
2271 gimple_dump_bb (FILE *file
, basic_block bb
, int indent
, int flags
)
2273 dump_gimple_bb_header (file
, bb
, indent
, flags
);
2274 maybe_init_pretty_print (file
);
2275 gimple_dump_bb_buff (&buffer
, bb
, indent
, flags
);
2277 dump_gimple_bb_footer (file
, bb
, indent
, flags
);