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.
119 The caller is responsible for calling pp_flush on BUFFER to finalize
120 the pretty printer. */
123 dump_gimple_seq (pretty_printer
*buffer
, gimple_seq seq
, int spc
, int flags
)
125 gimple_stmt_iterator i
;
127 for (i
= gsi_start (seq
); !gsi_end_p (i
); gsi_next (&i
))
129 gimple gs
= gsi_stmt (i
);
131 dump_gimple_stmt (buffer
, gs
, spc
, flags
);
132 if (!gsi_one_before_end_p (i
))
138 /* Dump GIMPLE sequence SEQ to FILE using SPC indentantion spaces and
139 FLAGS as in dump_gimple_stmt. */
142 print_gimple_seq (FILE *file
, gimple_seq seq
, int spc
, int flags
)
144 maybe_init_pretty_print (file
);
145 dump_gimple_seq (&buffer
, seq
, spc
, flags
);
150 /* Print the GIMPLE sequence SEQ on stderr. */
153 debug_gimple_seq (gimple_seq seq
)
155 print_gimple_seq (stderr
, seq
, 0, TDF_VOPS
|TDF_MEMSYMS
);
159 /* A simple helper to pretty-print some of the gimple tuples in the printf
160 style. The format modifiers are preceded by '%' and are:
161 'G' - outputs a string corresponding to the code of the given gimple,
162 'S' - outputs a gimple_seq with indent of spc + 2,
163 'T' - outputs the tree t,
164 'd' - outputs an int as a decimal,
165 's' - outputs a string,
166 'n' - outputs a newline,
167 'x' - outputs an int as hexadecimal,
168 '+' - increases indent by 2 then outputs a newline,
169 '-' - decreases indent by 2 then outputs a newline. */
172 dump_gimple_fmt (pretty_printer
*buffer
, int spc
, int flags
,
173 const char *fmt
, ...)
179 va_start (args
, fmt
);
180 for (c
= fmt
; *c
; c
++)
190 g
= va_arg (args
, gimple
);
191 tmp
= gimple_code_name
[gimple_code (g
)];
192 pp_string (buffer
, tmp
);
196 seq
= va_arg (args
, gimple_seq
);
198 dump_gimple_seq (buffer
, seq
, spc
+ 2, flags
);
199 newline_and_indent (buffer
, spc
);
203 t
= va_arg (args
, tree
);
205 pp_string (buffer
, "NULL");
207 dump_generic_node (buffer
, t
, spc
, flags
, false);
211 pp_decimal_int (buffer
, va_arg (args
, int));
215 pp_string (buffer
, va_arg (args
, char *));
219 newline_and_indent (buffer
, spc
);
223 pp_scalar (buffer
, "%x", va_arg (args
, int));
228 newline_and_indent (buffer
, spc
);
233 newline_and_indent (buffer
, spc
);
241 pp_character (buffer
, *c
);
247 /* Helper for dump_gimple_assign. Print the unary RHS of the
248 assignment GS. BUFFER, SPC and FLAGS are as in dump_gimple_stmt. */
251 dump_unary_rhs (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
253 enum tree_code rhs_code
= gimple_assign_rhs_code (gs
);
254 tree lhs
= gimple_assign_lhs (gs
);
255 tree rhs
= gimple_assign_rhs1 (gs
);
259 case VIEW_CONVERT_EXPR
:
261 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
264 case FIXED_CONVERT_EXPR
:
265 case ADDR_SPACE_CONVERT_EXPR
:
269 pp_character (buffer
, '(');
270 dump_generic_node (buffer
, TREE_TYPE (lhs
), spc
, flags
, false);
271 pp_string (buffer
, ") ");
272 if (op_prio (rhs
) < op_code_prio (rhs_code
))
274 pp_character (buffer
, '(');
275 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
276 pp_character (buffer
, ')');
279 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
283 pp_string (buffer
, "((");
284 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
285 pp_string (buffer
, "))");
289 pp_string (buffer
, "ABS_EXPR <");
290 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
291 pp_character (buffer
, '>');
295 if (TREE_CODE_CLASS (rhs_code
) == tcc_declaration
296 || TREE_CODE_CLASS (rhs_code
) == tcc_constant
297 || TREE_CODE_CLASS (rhs_code
) == tcc_reference
298 || rhs_code
== SSA_NAME
299 || rhs_code
== ADDR_EXPR
300 || rhs_code
== CONSTRUCTOR
)
302 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
305 else if (rhs_code
== BIT_NOT_EXPR
)
306 pp_character (buffer
, '~');
307 else if (rhs_code
== TRUTH_NOT_EXPR
)
308 pp_character (buffer
, '!');
309 else if (rhs_code
== NEGATE_EXPR
)
310 pp_character (buffer
, '-');
313 pp_character (buffer
, '[');
314 pp_string (buffer
, tree_code_name
[rhs_code
]);
315 pp_string (buffer
, "] ");
318 if (op_prio (rhs
) < op_code_prio (rhs_code
))
320 pp_character (buffer
, '(');
321 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
322 pp_character (buffer
, ')');
325 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
331 /* Helper for dump_gimple_assign. Print the binary RHS of the
332 assignment GS. BUFFER, SPC and FLAGS are as in dump_gimple_stmt. */
335 dump_binary_rhs (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
338 enum tree_code code
= gimple_assign_rhs_code (gs
);
344 case VEC_WIDEN_MULT_HI_EXPR
:
345 case VEC_WIDEN_MULT_LO_EXPR
:
346 case VEC_WIDEN_MULT_EVEN_EXPR
:
347 case VEC_WIDEN_MULT_ODD_EXPR
:
348 case VEC_PACK_TRUNC_EXPR
:
349 case VEC_PACK_SAT_EXPR
:
350 case VEC_PACK_FIX_TRUNC_EXPR
:
351 case VEC_WIDEN_LSHIFT_HI_EXPR
:
352 case VEC_WIDEN_LSHIFT_LO_EXPR
:
353 for (p
= tree_code_name
[(int) code
]; *p
; p
++)
354 pp_character (buffer
, TOUPPER (*p
));
355 pp_string (buffer
, " <");
356 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
357 pp_string (buffer
, ", ");
358 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
359 pp_character (buffer
, '>');
363 if (op_prio (gimple_assign_rhs1 (gs
)) <= op_code_prio (code
))
365 pp_character (buffer
, '(');
366 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
,
368 pp_character (buffer
, ')');
371 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
373 pp_string (buffer
, op_symbol_code (gimple_assign_rhs_code (gs
)));
375 if (op_prio (gimple_assign_rhs2 (gs
)) <= op_code_prio (code
))
377 pp_character (buffer
, '(');
378 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
,
380 pp_character (buffer
, ')');
383 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
387 /* Helper for dump_gimple_assign. Print the ternary RHS of the
388 assignment GS. BUFFER, SPC and FLAGS are as in dump_gimple_stmt. */
391 dump_ternary_rhs (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
394 enum tree_code code
= gimple_assign_rhs_code (gs
);
397 case WIDEN_MULT_PLUS_EXPR
:
398 case WIDEN_MULT_MINUS_EXPR
:
399 for (p
= tree_code_name
[(int) code
]; *p
; p
++)
400 pp_character (buffer
, TOUPPER (*p
));
401 pp_string (buffer
, " <");
402 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
403 pp_string (buffer
, ", ");
404 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
405 pp_string (buffer
, ", ");
406 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
407 pp_character (buffer
, '>');
411 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
412 pp_string (buffer
, " * ");
413 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
414 pp_string (buffer
, " + ");
415 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
419 pp_string (buffer
, "DOT_PROD_EXPR <");
420 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
421 pp_string (buffer
, ", ");
422 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
423 pp_string (buffer
, ", ");
424 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
425 pp_string (buffer
, ">");
429 pp_string (buffer
, "VEC_PERM_EXPR <");
430 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
431 pp_string (buffer
, ", ");
432 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
433 pp_string (buffer
, ", ");
434 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
435 pp_string (buffer
, ">");
438 case REALIGN_LOAD_EXPR
:
439 pp_string (buffer
, "REALIGN_LOAD <");
440 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
441 pp_string (buffer
, ", ");
442 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
443 pp_string (buffer
, ", ");
444 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
445 pp_string (buffer
, ">");
449 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
450 pp_string (buffer
, " ? ");
451 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
452 pp_string (buffer
, " : ");
453 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
457 pp_string (buffer
, "VEC_COND_EXPR <");
458 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
459 pp_string (buffer
, ", ");
460 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
461 pp_string (buffer
, ", ");
462 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
463 pp_string (buffer
, ">");
472 /* Dump the gimple assignment GS. BUFFER, SPC and FLAGS are as in
476 dump_gimple_assign (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
481 if (gimple_num_ops (gs
) == 2)
483 else if (gimple_num_ops (gs
) == 3)
484 last
= gimple_assign_rhs2 (gs
);
488 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%s, %T, %T, %T>", gs
,
489 tree_code_name
[gimple_assign_rhs_code (gs
)],
490 gimple_assign_lhs (gs
), gimple_assign_rhs1 (gs
), last
);
494 if (!(flags
& TDF_RHS_ONLY
))
496 dump_generic_node (buffer
, gimple_assign_lhs (gs
), spc
, flags
, false);
498 pp_character (buffer
, '=');
500 if (gimple_assign_nontemporal_move_p (gs
))
501 pp_string (buffer
, "{nt}");
503 if (gimple_has_volatile_ops (gs
))
504 pp_string (buffer
, "{v}");
509 if (gimple_num_ops (gs
) == 2)
510 dump_unary_rhs (buffer
, gs
, spc
, flags
);
511 else if (gimple_num_ops (gs
) == 3)
512 dump_binary_rhs (buffer
, gs
, spc
, flags
);
513 else if (gimple_num_ops (gs
) == 4)
514 dump_ternary_rhs (buffer
, gs
, spc
, flags
);
517 if (!(flags
& TDF_RHS_ONLY
))
518 pp_semicolon(buffer
);
523 /* Dump the return statement GS. BUFFER, SPC and FLAGS are as in
527 dump_gimple_return (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
531 t
= gimple_return_retval (gs
);
533 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
, t
);
536 pp_string (buffer
, "return");
540 dump_generic_node (buffer
, t
, spc
, flags
, false);
542 pp_semicolon (buffer
);
547 /* Dump the call arguments for a gimple call. BUFFER, FLAGS are as in
551 dump_gimple_call_args (pretty_printer
*buffer
, gimple gs
, int flags
)
555 for (i
= 0; i
< gimple_call_num_args (gs
); i
++)
557 dump_generic_node (buffer
, gimple_call_arg (gs
, i
), 0, flags
, false);
558 if (i
< gimple_call_num_args (gs
) - 1)
559 pp_string (buffer
, ", ");
562 if (gimple_call_va_arg_pack_p (gs
))
564 if (gimple_call_num_args (gs
) > 0)
566 pp_character (buffer
, ',');
570 pp_string (buffer
, "__builtin_va_arg_pack ()");
574 /* Dump the points-to solution *PT to BUFFER. */
577 pp_points_to_solution (pretty_printer
*buffer
, struct pt_solution
*pt
)
581 pp_string (buffer
, "anything ");
585 pp_string (buffer
, "nonlocal ");
587 pp_string (buffer
, "escaped ");
589 pp_string (buffer
, "unit-escaped ");
591 pp_string (buffer
, "null ");
593 && !bitmap_empty_p (pt
->vars
))
597 pp_string (buffer
, "{ ");
598 EXECUTE_IF_SET_IN_BITMAP (pt
->vars
, 0, i
, bi
)
600 pp_string (buffer
, "D.");
601 pp_decimal_int (buffer
, i
);
602 pp_character (buffer
, ' ');
604 pp_character (buffer
, '}');
605 if (pt
->vars_contains_global
)
606 pp_string (buffer
, " (glob)");
610 /* Dump the call statement GS. BUFFER, SPC and FLAGS are as in
614 dump_gimple_call (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
616 tree lhs
= gimple_call_lhs (gs
);
617 tree fn
= gimple_call_fn (gs
);
619 if (flags
& TDF_ALIAS
)
621 struct pt_solution
*pt
;
622 pt
= gimple_call_use_set (gs
);
623 if (!pt_solution_empty_p (pt
))
625 pp_string (buffer
, "# USE = ");
626 pp_points_to_solution (buffer
, pt
);
627 newline_and_indent (buffer
, spc
);
629 pt
= gimple_call_clobber_set (gs
);
630 if (!pt_solution_empty_p (pt
))
632 pp_string (buffer
, "# CLB = ");
633 pp_points_to_solution (buffer
, pt
);
634 newline_and_indent (buffer
, spc
);
640 if (gimple_call_internal_p (gs
))
641 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%s, %T", gs
,
642 internal_fn_name (gimple_call_internal_fn (gs
)), lhs
);
644 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %T", gs
, fn
, lhs
);
645 if (gimple_call_num_args (gs
) > 0)
647 pp_string (buffer
, ", ");
648 dump_gimple_call_args (buffer
, gs
, flags
);
650 pp_character (buffer
, '>');
654 if (lhs
&& !(flags
& TDF_RHS_ONLY
))
656 dump_generic_node (buffer
, lhs
, spc
, flags
, false);
657 pp_string (buffer
, " =");
659 if (gimple_has_volatile_ops (gs
))
660 pp_string (buffer
, "{v}");
664 if (gimple_call_internal_p (gs
))
665 pp_string (buffer
, internal_fn_name (gimple_call_internal_fn (gs
)));
667 print_call_name (buffer
, fn
, flags
);
668 pp_string (buffer
, " (");
669 dump_gimple_call_args (buffer
, gs
, flags
);
670 pp_character (buffer
, ')');
671 if (!(flags
& TDF_RHS_ONLY
))
672 pp_semicolon (buffer
);
675 if (gimple_call_chain (gs
))
677 pp_string (buffer
, " [static-chain: ");
678 dump_generic_node (buffer
, gimple_call_chain (gs
), spc
, flags
, false);
679 pp_character (buffer
, ']');
682 if (gimple_call_return_slot_opt_p (gs
))
683 pp_string (buffer
, " [return slot optimization]");
684 if (gimple_call_tail_p (gs
))
685 pp_string (buffer
, " [tail call]");
690 /* Dump the arguments of _ITM_beginTransaction sanely. */
691 if (TREE_CODE (fn
) == ADDR_EXPR
)
692 fn
= TREE_OPERAND (fn
, 0);
693 if (TREE_CODE (fn
) == FUNCTION_DECL
&& decl_is_tm_clone (fn
))
694 pp_string (buffer
, " [tm-clone]");
695 if (TREE_CODE (fn
) == FUNCTION_DECL
696 && DECL_BUILT_IN_CLASS (fn
) == BUILT_IN_NORMAL
697 && DECL_FUNCTION_CODE (fn
) == BUILT_IN_TM_START
698 && gimple_call_num_args (gs
) > 0)
700 tree t
= gimple_call_arg (gs
, 0);
701 unsigned HOST_WIDE_INT props
;
702 gcc_assert (TREE_CODE (t
) == INTEGER_CST
);
704 pp_string (buffer
, " [ ");
706 /* Get the transaction code properties. */
707 props
= TREE_INT_CST_LOW (t
);
709 if (props
& PR_INSTRUMENTEDCODE
)
710 pp_string (buffer
, "instrumentedCode ");
711 if (props
& PR_UNINSTRUMENTEDCODE
)
712 pp_string (buffer
, "uninstrumentedCode ");
713 if (props
& PR_HASNOXMMUPDATE
)
714 pp_string (buffer
, "hasNoXMMUpdate ");
715 if (props
& PR_HASNOABORT
)
716 pp_string (buffer
, "hasNoAbort ");
717 if (props
& PR_HASNOIRREVOCABLE
)
718 pp_string (buffer
, "hasNoIrrevocable ");
719 if (props
& PR_DOESGOIRREVOCABLE
)
720 pp_string (buffer
, "doesGoIrrevocable ");
721 if (props
& PR_HASNOSIMPLEREADS
)
722 pp_string (buffer
, "hasNoSimpleReads ");
723 if (props
& PR_AWBARRIERSOMITTED
)
724 pp_string (buffer
, "awBarriersOmitted ");
725 if (props
& PR_RARBARRIERSOMITTED
)
726 pp_string (buffer
, "RaRBarriersOmitted ");
727 if (props
& PR_UNDOLOGCODE
)
728 pp_string (buffer
, "undoLogCode ");
729 if (props
& PR_PREFERUNINSTRUMENTED
)
730 pp_string (buffer
, "preferUninstrumented ");
731 if (props
& PR_EXCEPTIONBLOCK
)
732 pp_string (buffer
, "exceptionBlock ");
733 if (props
& PR_HASELSE
)
734 pp_string (buffer
, "hasElse ");
735 if (props
& PR_READONLY
)
736 pp_string (buffer
, "readOnly ");
738 pp_string (buffer
, "]");
743 /* Dump the switch statement GS. BUFFER, SPC and FLAGS are as in
747 dump_gimple_switch (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
751 GIMPLE_CHECK (gs
, GIMPLE_SWITCH
);
753 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, ", gs
,
754 gimple_switch_index (gs
));
757 pp_string (buffer
, "switch (");
758 dump_generic_node (buffer
, gimple_switch_index (gs
), spc
, flags
, true);
759 pp_string (buffer
, ") <");
762 for (i
= 0; i
< gimple_switch_num_labels (gs
); i
++)
764 tree case_label
= gimple_switch_label (gs
, i
);
765 if (case_label
== NULL_TREE
)
768 dump_generic_node (buffer
, case_label
, spc
, flags
, false);
769 pp_character (buffer
, ' ');
770 dump_generic_node (buffer
, CASE_LABEL (case_label
), spc
, flags
, false);
771 if (i
< gimple_switch_num_labels (gs
) - 1)
772 pp_string (buffer
, ", ");
774 pp_character (buffer
, '>');
778 /* Dump the gimple conditional GS. BUFFER, SPC and FLAGS are as in
782 dump_gimple_cond (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
785 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%s, %T, %T, %T, %T>", gs
,
786 tree_code_name
[gimple_cond_code (gs
)],
787 gimple_cond_lhs (gs
), gimple_cond_rhs (gs
),
788 gimple_cond_true_label (gs
), gimple_cond_false_label (gs
));
791 if (!(flags
& TDF_RHS_ONLY
))
792 pp_string (buffer
, "if (");
793 dump_generic_node (buffer
, gimple_cond_lhs (gs
), spc
, flags
, false);
795 pp_string (buffer
, op_symbol_code (gimple_cond_code (gs
)));
797 dump_generic_node (buffer
, gimple_cond_rhs (gs
), spc
, flags
, false);
798 if (!(flags
& TDF_RHS_ONLY
))
800 pp_character (buffer
, ')');
802 if (gimple_cond_true_label (gs
))
804 pp_string (buffer
, " goto ");
805 dump_generic_node (buffer
, gimple_cond_true_label (gs
),
807 pp_semicolon (buffer
);
809 if (gimple_cond_false_label (gs
))
811 pp_string (buffer
, " else goto ");
812 dump_generic_node (buffer
, gimple_cond_false_label (gs
),
814 pp_semicolon (buffer
);
821 /* Dump a GIMPLE_LABEL tuple on the pretty_printer BUFFER, SPC
822 spaces of indent. FLAGS specifies details to show in the dump (see
823 TDF_* in dumpfils.h). */
826 dump_gimple_label (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
828 tree label
= gimple_label_label (gs
);
830 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
, label
);
833 dump_generic_node (buffer
, label
, spc
, flags
, false);
834 pp_character (buffer
, ':');
836 if (DECL_NONLOCAL (label
))
837 pp_string (buffer
, " [non-local]");
838 if ((flags
& TDF_EH
) && EH_LANDING_PAD_NR (label
))
839 pp_printf (buffer
, " [LP %d]", EH_LANDING_PAD_NR (label
));
842 /* Dump a GIMPLE_GOTO tuple on the pretty_printer BUFFER, SPC
843 spaces of indent. FLAGS specifies details to show in the dump (see
844 TDF_* in dumpfile.h). */
847 dump_gimple_goto (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
849 tree label
= gimple_goto_dest (gs
);
851 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
, label
);
853 dump_gimple_fmt (buffer
, spc
, flags
, "goto %T;", label
);
857 /* Dump a GIMPLE_BIND tuple on the pretty_printer BUFFER, SPC
858 spaces of indent. FLAGS specifies details to show in the dump (see
859 TDF_* in dumpfile.h). */
862 dump_gimple_bind (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
865 dump_gimple_fmt (buffer
, spc
, flags
, "%G <", gs
);
867 pp_character (buffer
, '{');
868 if (!(flags
& TDF_SLIM
))
872 for (var
= gimple_bind_vars (gs
); var
; var
= DECL_CHAIN (var
))
874 newline_and_indent (buffer
, 2);
875 print_declaration (buffer
, var
, spc
, flags
);
877 if (gimple_bind_vars (gs
))
881 dump_gimple_seq (buffer
, gimple_bind_body (gs
), spc
+ 2, flags
);
882 newline_and_indent (buffer
, spc
);
884 pp_character (buffer
, '>');
886 pp_character (buffer
, '}');
890 /* Dump a GIMPLE_TRY tuple on the pretty_printer BUFFER, SPC spaces of
891 indent. FLAGS specifies details to show in the dump (see TDF_* in
895 dump_gimple_try (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
900 if (gimple_try_kind (gs
) == GIMPLE_TRY_CATCH
)
901 type
= "GIMPLE_TRY_CATCH";
902 else if (gimple_try_kind (gs
) == GIMPLE_TRY_FINALLY
)
903 type
= "GIMPLE_TRY_FINALLY";
905 type
= "UNKNOWN GIMPLE_TRY";
906 dump_gimple_fmt (buffer
, spc
, flags
,
907 "%G <%s,%+EVAL <%S>%nCLEANUP <%S>%->", gs
, type
,
908 gimple_try_eval (gs
), gimple_try_cleanup (gs
));
912 pp_string (buffer
, "try");
913 newline_and_indent (buffer
, spc
+ 2);
914 pp_character (buffer
, '{');
917 dump_gimple_seq (buffer
, gimple_try_eval (gs
), spc
+ 4, flags
);
918 newline_and_indent (buffer
, spc
+ 2);
919 pp_character (buffer
, '}');
921 if (gimple_try_kind (gs
) == GIMPLE_TRY_CATCH
)
923 newline_and_indent (buffer
, spc
);
924 pp_string (buffer
, "catch");
925 newline_and_indent (buffer
, spc
+ 2);
926 pp_character (buffer
, '{');
928 else if (gimple_try_kind (gs
) == GIMPLE_TRY_FINALLY
)
930 newline_and_indent (buffer
, spc
);
931 pp_string (buffer
, "finally");
932 newline_and_indent (buffer
, spc
+ 2);
933 pp_character (buffer
, '{');
936 pp_string (buffer
, " <UNKNOWN GIMPLE_TRY> {");
939 dump_gimple_seq (buffer
, gimple_try_cleanup (gs
), spc
+ 4, flags
);
940 newline_and_indent (buffer
, spc
+ 2);
941 pp_character (buffer
, '}');
946 /* Dump a GIMPLE_CATCH tuple on the pretty_printer BUFFER, SPC spaces of
947 indent. FLAGS specifies details to show in the dump (see TDF_* in
951 dump_gimple_catch (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
954 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %+CATCH <%S>%->", gs
,
955 gimple_catch_types (gs
), gimple_catch_handler (gs
));
957 dump_gimple_fmt (buffer
, spc
, flags
, "catch (%T)%+{%S}",
958 gimple_catch_types (gs
), gimple_catch_handler (gs
));
962 /* Dump a GIMPLE_EH_FILTER tuple on the pretty_printer BUFFER, SPC spaces of
963 indent. FLAGS specifies details to show in the dump (see TDF_* in
967 dump_gimple_eh_filter (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
970 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %+FAILURE <%S>%->", gs
,
971 gimple_eh_filter_types (gs
),
972 gimple_eh_filter_failure (gs
));
974 dump_gimple_fmt (buffer
, spc
, flags
, "<<<eh_filter (%T)>>>%+{%+%S%-}",
975 gimple_eh_filter_types (gs
),
976 gimple_eh_filter_failure (gs
));
980 /* Dump a GIMPLE_EH_MUST_NOT_THROW tuple. */
983 dump_gimple_eh_must_not_throw (pretty_printer
*buffer
, gimple gs
,
987 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
,
988 gimple_eh_must_not_throw_fndecl (gs
));
990 dump_gimple_fmt (buffer
, spc
, flags
, "<<<eh_must_not_throw (%T)>>>",
991 gimple_eh_must_not_throw_fndecl (gs
));
995 /* Dump a GIMPLE_EH_ELSE tuple on the pretty_printer BUFFER, SPC spaces of
996 indent. FLAGS specifies details to show in the dump (see TDF_* in
1000 dump_gimple_eh_else (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1002 if (flags
& TDF_RAW
)
1003 dump_gimple_fmt (buffer
, spc
, flags
,
1004 "%G <%+N_BODY <%S>%nE_BODY <%S>%->", gs
,
1005 gimple_eh_else_n_body (gs
), gimple_eh_else_e_body (gs
));
1007 dump_gimple_fmt (buffer
, spc
, flags
,
1008 "<<<if_normal_exit>>>%+{%S}%-<<<else_eh_exit>>>%+{%S}",
1009 gimple_eh_else_n_body (gs
), gimple_eh_else_e_body (gs
));
1013 /* Dump a GIMPLE_RESX tuple on the pretty_printer BUFFER, SPC spaces of
1014 indent. FLAGS specifies details to show in the dump (see TDF_* in
1018 dump_gimple_resx (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1020 if (flags
& TDF_RAW
)
1021 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%d>", gs
,
1022 gimple_resx_region (gs
));
1024 dump_gimple_fmt (buffer
, spc
, flags
, "resx %d", gimple_resx_region (gs
));
1027 /* Dump a GIMPLE_EH_DISPATCH tuple on the pretty_printer BUFFER. */
1030 dump_gimple_eh_dispatch (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1032 if (flags
& TDF_RAW
)
1033 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%d>", gs
,
1034 gimple_eh_dispatch_region (gs
));
1036 dump_gimple_fmt (buffer
, spc
, flags
, "eh_dispatch %d",
1037 gimple_eh_dispatch_region (gs
));
1040 /* Dump a GIMPLE_DEBUG tuple on the pretty_printer BUFFER, SPC spaces
1041 of indent. FLAGS specifies details to show in the dump (see TDF_*
1045 dump_gimple_debug (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1047 switch (gs
->gsbase
.subcode
)
1049 case GIMPLE_DEBUG_BIND
:
1050 if (flags
& TDF_RAW
)
1051 dump_gimple_fmt (buffer
, spc
, flags
, "%G BIND <%T, %T>", gs
,
1052 gimple_debug_bind_get_var (gs
),
1053 gimple_debug_bind_get_value (gs
));
1055 dump_gimple_fmt (buffer
, spc
, flags
, "# DEBUG %T => %T",
1056 gimple_debug_bind_get_var (gs
),
1057 gimple_debug_bind_get_value (gs
));
1060 case GIMPLE_DEBUG_SOURCE_BIND
:
1061 if (flags
& TDF_RAW
)
1062 dump_gimple_fmt (buffer
, spc
, flags
, "%G SRCBIND <%T, %T>", gs
,
1063 gimple_debug_source_bind_get_var (gs
),
1064 gimple_debug_source_bind_get_value (gs
));
1066 dump_gimple_fmt (buffer
, spc
, flags
, "# DEBUG %T s=> %T",
1067 gimple_debug_source_bind_get_var (gs
),
1068 gimple_debug_source_bind_get_value (gs
));
1076 /* Dump a GIMPLE_OMP_FOR tuple on the pretty_printer BUFFER. */
1078 dump_gimple_omp_for (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1082 if (flags
& TDF_RAW
)
1084 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1085 gimple_omp_body (gs
));
1086 dump_omp_clauses (buffer
, gimple_omp_for_clauses (gs
), spc
, flags
);
1087 dump_gimple_fmt (buffer
, spc
, flags
, " >,");
1088 for (i
= 0; i
< gimple_omp_for_collapse (gs
); i
++)
1089 dump_gimple_fmt (buffer
, spc
, flags
,
1090 "%+%T, %T, %T, %s, %T,%n",
1091 gimple_omp_for_index (gs
, i
),
1092 gimple_omp_for_initial (gs
, i
),
1093 gimple_omp_for_final (gs
, i
),
1094 tree_code_name
[gimple_omp_for_cond (gs
, i
)],
1095 gimple_omp_for_incr (gs
, i
));
1096 dump_gimple_fmt (buffer
, spc
, flags
, "PRE_BODY <%S>%->",
1097 gimple_omp_for_pre_body (gs
));
1101 pp_string (buffer
, "#pragma omp for");
1102 dump_omp_clauses (buffer
, gimple_omp_for_clauses (gs
), spc
, flags
);
1103 for (i
= 0; i
< gimple_omp_for_collapse (gs
); i
++)
1107 newline_and_indent (buffer
, spc
);
1108 pp_string (buffer
, "for (");
1109 dump_generic_node (buffer
, gimple_omp_for_index (gs
, i
), spc
,
1111 pp_string (buffer
, " = ");
1112 dump_generic_node (buffer
, gimple_omp_for_initial (gs
, i
), spc
,
1114 pp_string (buffer
, "; ");
1116 dump_generic_node (buffer
, gimple_omp_for_index (gs
, i
), spc
,
1119 switch (gimple_omp_for_cond (gs
, i
))
1122 pp_character (buffer
, '<');
1125 pp_character (buffer
, '>');
1128 pp_string (buffer
, "<=");
1131 pp_string (buffer
, ">=");
1137 dump_generic_node (buffer
, gimple_omp_for_final (gs
, i
), spc
,
1139 pp_string (buffer
, "; ");
1141 dump_generic_node (buffer
, gimple_omp_for_index (gs
, i
), spc
,
1143 pp_string (buffer
, " = ");
1144 dump_generic_node (buffer
, gimple_omp_for_incr (gs
, i
), spc
,
1146 pp_character (buffer
, ')');
1149 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1151 newline_and_indent (buffer
, spc
+ 2);
1152 pp_character (buffer
, '{');
1153 pp_newline (buffer
);
1154 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1155 newline_and_indent (buffer
, spc
+ 2);
1156 pp_character (buffer
, '}');
1161 /* Dump a GIMPLE_OMP_CONTINUE tuple on the pretty_printer BUFFER. */
1164 dump_gimple_omp_continue (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1166 if (flags
& TDF_RAW
)
1168 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %T>", gs
,
1169 gimple_omp_continue_control_def (gs
),
1170 gimple_omp_continue_control_use (gs
));
1174 pp_string (buffer
, "#pragma omp continue (");
1175 dump_generic_node (buffer
, gimple_omp_continue_control_def (gs
),
1177 pp_character (buffer
, ',');
1179 dump_generic_node (buffer
, gimple_omp_continue_control_use (gs
),
1181 pp_character (buffer
, ')');
1185 /* Dump a GIMPLE_OMP_SINGLE tuple on the pretty_printer BUFFER. */
1188 dump_gimple_omp_single (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1190 if (flags
& TDF_RAW
)
1192 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1193 gimple_omp_body (gs
));
1194 dump_omp_clauses (buffer
, gimple_omp_single_clauses (gs
), spc
, flags
);
1195 dump_gimple_fmt (buffer
, spc
, flags
, " >");
1199 pp_string (buffer
, "#pragma omp single");
1200 dump_omp_clauses (buffer
, gimple_omp_single_clauses (gs
), spc
, flags
);
1201 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1203 newline_and_indent (buffer
, spc
+ 2);
1204 pp_character (buffer
, '{');
1205 pp_newline (buffer
);
1206 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1207 newline_and_indent (buffer
, spc
+ 2);
1208 pp_character (buffer
, '}');
1213 /* Dump a GIMPLE_OMP_SECTIONS tuple on the pretty_printer BUFFER. */
1216 dump_gimple_omp_sections (pretty_printer
*buffer
, gimple gs
, int spc
,
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_sections_clauses (gs
), spc
, flags
);
1224 dump_gimple_fmt (buffer
, spc
, flags
, " >");
1228 pp_string (buffer
, "#pragma omp sections");
1229 if (gimple_omp_sections_control (gs
))
1231 pp_string (buffer
, " <");
1232 dump_generic_node (buffer
, gimple_omp_sections_control (gs
), spc
,
1234 pp_character (buffer
, '>');
1236 dump_omp_clauses (buffer
, gimple_omp_sections_clauses (gs
), spc
, flags
);
1237 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1239 newline_and_indent (buffer
, spc
+ 2);
1240 pp_character (buffer
, '{');
1241 pp_newline (buffer
);
1242 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1243 newline_and_indent (buffer
, spc
+ 2);
1244 pp_character (buffer
, '}');
1249 /* Dump a GIMPLE_OMP_{MASTER,ORDERED,SECTION} tuple on the pretty_printer
1253 dump_gimple_omp_block (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1255 if (flags
& TDF_RAW
)
1256 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S> >", gs
,
1257 gimple_omp_body (gs
));
1260 switch (gimple_code (gs
))
1262 case GIMPLE_OMP_MASTER
:
1263 pp_string (buffer
, "#pragma omp master");
1265 case GIMPLE_OMP_ORDERED
:
1266 pp_string (buffer
, "#pragma omp ordered");
1268 case GIMPLE_OMP_SECTION
:
1269 pp_string (buffer
, "#pragma omp section");
1274 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1276 newline_and_indent (buffer
, spc
+ 2);
1277 pp_character (buffer
, '{');
1278 pp_newline (buffer
);
1279 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1280 newline_and_indent (buffer
, spc
+ 2);
1281 pp_character (buffer
, '}');
1286 /* Dump a GIMPLE_OMP_CRITICAL tuple on the pretty_printer BUFFER. */
1289 dump_gimple_omp_critical (pretty_printer
*buffer
, gimple gs
, int spc
,
1292 if (flags
& TDF_RAW
)
1293 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S> >", gs
,
1294 gimple_omp_body (gs
));
1297 pp_string (buffer
, "#pragma omp critical");
1298 if (gimple_omp_critical_name (gs
))
1300 pp_string (buffer
, " (");
1301 dump_generic_node (buffer
, gimple_omp_critical_name (gs
), spc
,
1303 pp_character (buffer
, ')');
1305 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1307 newline_and_indent (buffer
, spc
+ 2);
1308 pp_character (buffer
, '{');
1309 pp_newline (buffer
);
1310 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1311 newline_and_indent (buffer
, spc
+ 2);
1312 pp_character (buffer
, '}');
1317 /* Dump a GIMPLE_OMP_RETURN tuple on the pretty_printer BUFFER. */
1320 dump_gimple_omp_return (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1322 if (flags
& TDF_RAW
)
1324 dump_gimple_fmt (buffer
, spc
, flags
, "%G <nowait=%d>", gs
,
1325 (int) gimple_omp_return_nowait_p (gs
));
1329 pp_string (buffer
, "#pragma omp return");
1330 if (gimple_omp_return_nowait_p (gs
))
1331 pp_string (buffer
, "(nowait)");
1335 /* Dump a GIMPLE_TRANSACTION tuple on the pretty_printer BUFFER. */
1338 dump_gimple_transaction (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1340 unsigned subcode
= gimple_transaction_subcode (gs
);
1342 if (flags
& TDF_RAW
)
1344 dump_gimple_fmt (buffer
, spc
, flags
,
1345 "%G [SUBCODE=%x,LABEL=%T] <%+BODY <%S> >",
1346 gs
, subcode
, gimple_transaction_label (gs
),
1347 gimple_transaction_body (gs
));
1351 if (subcode
& GTMA_IS_OUTER
)
1352 pp_string (buffer
, "__transaction_atomic [[outer]]");
1353 else if (subcode
& GTMA_IS_RELAXED
)
1354 pp_string (buffer
, "__transaction_relaxed");
1356 pp_string (buffer
, "__transaction_atomic");
1357 subcode
&= ~GTMA_DECLARATION_MASK
;
1359 if (subcode
|| gimple_transaction_label (gs
))
1361 pp_string (buffer
, " //");
1362 if (gimple_transaction_label (gs
))
1364 pp_string (buffer
, " LABEL=");
1365 dump_generic_node (buffer
, gimple_transaction_label (gs
),
1370 pp_string (buffer
, " SUBCODE=[ ");
1371 if (subcode
& GTMA_HAVE_ABORT
)
1373 pp_string (buffer
, "GTMA_HAVE_ABORT ");
1374 subcode
&= ~GTMA_HAVE_ABORT
;
1376 if (subcode
& GTMA_HAVE_LOAD
)
1378 pp_string (buffer
, "GTMA_HAVE_LOAD ");
1379 subcode
&= ~GTMA_HAVE_LOAD
;
1381 if (subcode
& GTMA_HAVE_STORE
)
1383 pp_string (buffer
, "GTMA_HAVE_STORE ");
1384 subcode
&= ~GTMA_HAVE_STORE
;
1386 if (subcode
& GTMA_MAY_ENTER_IRREVOCABLE
)
1388 pp_string (buffer
, "GTMA_MAY_ENTER_IRREVOCABLE ");
1389 subcode
&= ~GTMA_MAY_ENTER_IRREVOCABLE
;
1391 if (subcode
& GTMA_DOES_GO_IRREVOCABLE
)
1393 pp_string (buffer
, "GTMA_DOES_GO_IRREVOCABLE ");
1394 subcode
&= ~GTMA_DOES_GO_IRREVOCABLE
;
1397 pp_printf (buffer
, "0x%x ", subcode
);
1398 pp_string (buffer
, "]");
1402 if (!gimple_seq_empty_p (gimple_transaction_body (gs
)))
1404 newline_and_indent (buffer
, spc
+ 2);
1405 pp_character (buffer
, '{');
1406 pp_newline (buffer
);
1407 dump_gimple_seq (buffer
, gimple_transaction_body (gs
),
1409 newline_and_indent (buffer
, spc
+ 2);
1410 pp_character (buffer
, '}');
1415 /* Dump a GIMPLE_ASM tuple on the pretty_printer BUFFER, SPC spaces of
1416 indent. FLAGS specifies details to show in the dump (see TDF_* in
1420 dump_gimple_asm (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1422 unsigned int i
, n
, f
, fields
;
1424 if (flags
& TDF_RAW
)
1426 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+STRING <%n%s%n>", gs
,
1427 gimple_asm_string (gs
));
1429 n
= gimple_asm_noutputs (gs
);
1432 newline_and_indent (buffer
, spc
+ 2);
1433 pp_string (buffer
, "OUTPUT: ");
1434 for (i
= 0; i
< n
; i
++)
1436 dump_generic_node (buffer
, gimple_asm_output_op (gs
, i
),
1439 pp_string (buffer
, ", ");
1443 n
= gimple_asm_ninputs (gs
);
1446 newline_and_indent (buffer
, spc
+ 2);
1447 pp_string (buffer
, "INPUT: ");
1448 for (i
= 0; i
< n
; i
++)
1450 dump_generic_node (buffer
, gimple_asm_input_op (gs
, i
),
1453 pp_string (buffer
, ", ");
1457 n
= gimple_asm_nclobbers (gs
);
1460 newline_and_indent (buffer
, spc
+ 2);
1461 pp_string (buffer
, "CLOBBER: ");
1462 for (i
= 0; i
< n
; i
++)
1464 dump_generic_node (buffer
, gimple_asm_clobber_op (gs
, i
),
1467 pp_string (buffer
, ", ");
1471 n
= gimple_asm_nlabels (gs
);
1474 newline_and_indent (buffer
, spc
+ 2);
1475 pp_string (buffer
, "LABEL: ");
1476 for (i
= 0; i
< n
; i
++)
1478 dump_generic_node (buffer
, gimple_asm_label_op (gs
, i
),
1481 pp_string (buffer
, ", ");
1485 newline_and_indent (buffer
, spc
);
1486 pp_character (buffer
, '>');
1490 pp_string (buffer
, "__asm__");
1491 if (gimple_asm_volatile_p (gs
))
1492 pp_string (buffer
, " __volatile__");
1493 if (gimple_asm_nlabels (gs
))
1494 pp_string (buffer
, " goto");
1495 pp_string (buffer
, "(\"");
1496 pp_string (buffer
, gimple_asm_string (gs
));
1497 pp_string (buffer
, "\"");
1499 if (gimple_asm_nlabels (gs
))
1501 else if (gimple_asm_nclobbers (gs
))
1503 else if (gimple_asm_ninputs (gs
))
1505 else if (gimple_asm_noutputs (gs
))
1510 for (f
= 0; f
< fields
; ++f
)
1512 pp_string (buffer
, " : ");
1517 n
= gimple_asm_noutputs (gs
);
1518 for (i
= 0; i
< n
; i
++)
1520 dump_generic_node (buffer
, gimple_asm_output_op (gs
, i
),
1523 pp_string (buffer
, ", ");
1528 n
= gimple_asm_ninputs (gs
);
1529 for (i
= 0; i
< n
; i
++)
1531 dump_generic_node (buffer
, gimple_asm_input_op (gs
, i
),
1534 pp_string (buffer
, ", ");
1539 n
= gimple_asm_nclobbers (gs
);
1540 for (i
= 0; i
< n
; i
++)
1542 dump_generic_node (buffer
, gimple_asm_clobber_op (gs
, i
),
1545 pp_string (buffer
, ", ");
1550 n
= gimple_asm_nlabels (gs
);
1551 for (i
= 0; i
< n
; i
++)
1553 dump_generic_node (buffer
, gimple_asm_label_op (gs
, i
),
1556 pp_string (buffer
, ", ");
1565 pp_string (buffer
, ");");
1570 /* Dump a PHI node PHI. BUFFER, SPC and FLAGS are as in dump_gimple_stmt.
1571 The caller is responsible for calling pp_flush on BUFFER to finalize
1575 dump_gimple_phi (pretty_printer
*buffer
, gimple phi
, int spc
, int flags
)
1578 tree lhs
= gimple_phi_result (phi
);
1580 if (flags
& TDF_ALIAS
1581 && POINTER_TYPE_P (TREE_TYPE (lhs
))
1582 && SSA_NAME_PTR_INFO (lhs
))
1584 unsigned int align
, misalign
;
1585 struct ptr_info_def
*pi
= SSA_NAME_PTR_INFO (lhs
);
1586 pp_string (buffer
, "PT = ");
1587 pp_points_to_solution (buffer
, &pi
->pt
);
1588 newline_and_indent (buffer
, spc
);
1589 if (get_ptr_info_alignment (pi
, &align
, &misalign
))
1591 pp_printf (buffer
, "# ALIGN = %u, MISALIGN = %u", align
, misalign
);
1592 newline_and_indent (buffer
, spc
);
1594 pp_string (buffer
, "# ");
1597 if (flags
& TDF_RAW
)
1598 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, ", phi
,
1599 gimple_phi_result (phi
));
1602 dump_generic_node (buffer
, lhs
, spc
, flags
, false);
1603 pp_string (buffer
, " = PHI <");
1605 for (i
= 0; i
< gimple_phi_num_args (phi
); i
++)
1607 if ((flags
& TDF_LINENO
) && gimple_phi_arg_has_location (phi
, i
))
1609 expanded_location xloc
;
1611 xloc
= expand_location (gimple_phi_arg_location (phi
, i
));
1612 pp_character (buffer
, '[');
1615 pp_string (buffer
, xloc
.file
);
1616 pp_string (buffer
, " : ");
1618 pp_decimal_int (buffer
, xloc
.line
);
1619 pp_string (buffer
, ":");
1620 pp_decimal_int (buffer
, xloc
.column
);
1621 pp_string (buffer
, "] ");
1623 dump_generic_node (buffer
, gimple_phi_arg_def (phi
, i
), spc
, flags
,
1625 pp_character (buffer
, '(');
1626 pp_decimal_int (buffer
, gimple_phi_arg_edge (phi
, i
)->src
->index
);
1627 pp_character (buffer
, ')');
1628 if (i
< gimple_phi_num_args (phi
) - 1)
1629 pp_string (buffer
, ", ");
1631 pp_character (buffer
, '>');
1635 /* Dump a GIMPLE_OMP_PARALLEL tuple on the pretty_printer BUFFER, SPC spaces
1636 of indent. FLAGS specifies details to show in the dump (see TDF_* in
1640 dump_gimple_omp_parallel (pretty_printer
*buffer
, gimple gs
, int spc
,
1643 if (flags
& TDF_RAW
)
1645 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1646 gimple_omp_body (gs
));
1647 dump_omp_clauses (buffer
, gimple_omp_parallel_clauses (gs
), spc
, flags
);
1648 dump_gimple_fmt (buffer
, spc
, flags
, " >, %T, %T%n>",
1649 gimple_omp_parallel_child_fn (gs
),
1650 gimple_omp_parallel_data_arg (gs
));
1655 pp_string (buffer
, "#pragma omp parallel");
1656 dump_omp_clauses (buffer
, gimple_omp_parallel_clauses (gs
), spc
, flags
);
1657 if (gimple_omp_parallel_child_fn (gs
))
1659 pp_string (buffer
, " [child fn: ");
1660 dump_generic_node (buffer
, gimple_omp_parallel_child_fn (gs
),
1662 pp_string (buffer
, " (");
1663 if (gimple_omp_parallel_data_arg (gs
))
1664 dump_generic_node (buffer
, gimple_omp_parallel_data_arg (gs
),
1667 pp_string (buffer
, "???");
1668 pp_string (buffer
, ")]");
1670 body
= gimple_omp_body (gs
);
1671 if (body
&& gimple_code (gimple_seq_first_stmt (body
)) != GIMPLE_BIND
)
1673 newline_and_indent (buffer
, spc
+ 2);
1674 pp_character (buffer
, '{');
1675 pp_newline (buffer
);
1676 dump_gimple_seq (buffer
, body
, spc
+ 4, flags
);
1677 newline_and_indent (buffer
, spc
+ 2);
1678 pp_character (buffer
, '}');
1682 pp_newline (buffer
);
1683 dump_gimple_seq (buffer
, body
, spc
+ 2, flags
);
1689 /* Dump a GIMPLE_OMP_TASK tuple on the pretty_printer BUFFER, SPC spaces
1690 of indent. FLAGS specifies details to show in the dump (see TDF_* in
1694 dump_gimple_omp_task (pretty_printer
*buffer
, gimple gs
, int spc
,
1697 if (flags
& TDF_RAW
)
1699 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1700 gimple_omp_body (gs
));
1701 dump_omp_clauses (buffer
, gimple_omp_task_clauses (gs
), spc
, flags
);
1702 dump_gimple_fmt (buffer
, spc
, flags
, " >, %T, %T, %T, %T, %T%n>",
1703 gimple_omp_task_child_fn (gs
),
1704 gimple_omp_task_data_arg (gs
),
1705 gimple_omp_task_copy_fn (gs
),
1706 gimple_omp_task_arg_size (gs
),
1707 gimple_omp_task_arg_size (gs
));
1712 pp_string (buffer
, "#pragma omp task");
1713 dump_omp_clauses (buffer
, gimple_omp_task_clauses (gs
), spc
, flags
);
1714 if (gimple_omp_task_child_fn (gs
))
1716 pp_string (buffer
, " [child fn: ");
1717 dump_generic_node (buffer
, gimple_omp_task_child_fn (gs
),
1719 pp_string (buffer
, " (");
1720 if (gimple_omp_task_data_arg (gs
))
1721 dump_generic_node (buffer
, gimple_omp_task_data_arg (gs
),
1724 pp_string (buffer
, "???");
1725 pp_string (buffer
, ")]");
1727 body
= gimple_omp_body (gs
);
1728 if (body
&& gimple_code (gimple_seq_first_stmt (body
)) != GIMPLE_BIND
)
1730 newline_and_indent (buffer
, spc
+ 2);
1731 pp_character (buffer
, '{');
1732 pp_newline (buffer
);
1733 dump_gimple_seq (buffer
, body
, spc
+ 4, flags
);
1734 newline_and_indent (buffer
, spc
+ 2);
1735 pp_character (buffer
, '}');
1739 pp_newline (buffer
);
1740 dump_gimple_seq (buffer
, body
, spc
+ 2, flags
);
1746 /* Dump a GIMPLE_OMP_ATOMIC_LOAD tuple on the pretty_printer BUFFER, SPC
1747 spaces of indent. FLAGS specifies details to show in the dump (see TDF_*
1751 dump_gimple_omp_atomic_load (pretty_printer
*buffer
, gimple gs
, int spc
,
1754 if (flags
& TDF_RAW
)
1756 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %T>", gs
,
1757 gimple_omp_atomic_load_lhs (gs
),
1758 gimple_omp_atomic_load_rhs (gs
));
1762 pp_string (buffer
, "#pragma omp atomic_load");
1763 if (gimple_omp_atomic_need_value_p (gs
))
1764 pp_string (buffer
, " [needed]");
1765 newline_and_indent (buffer
, spc
+ 2);
1766 dump_generic_node (buffer
, gimple_omp_atomic_load_lhs (gs
),
1769 pp_character (buffer
, '=');
1771 pp_character (buffer
, '*');
1772 dump_generic_node (buffer
, gimple_omp_atomic_load_rhs (gs
),
1777 /* Dump a GIMPLE_OMP_ATOMIC_STORE tuple on the pretty_printer BUFFER, SPC
1778 spaces of indent. FLAGS specifies details to show in the dump (see TDF_*
1782 dump_gimple_omp_atomic_store (pretty_printer
*buffer
, gimple gs
, int spc
,
1785 if (flags
& TDF_RAW
)
1787 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
,
1788 gimple_omp_atomic_store_val (gs
));
1792 pp_string (buffer
, "#pragma omp atomic_store ");
1793 if (gimple_omp_atomic_need_value_p (gs
))
1794 pp_string (buffer
, "[needed] ");
1795 pp_character (buffer
, '(');
1796 dump_generic_node (buffer
, gimple_omp_atomic_store_val (gs
),
1798 pp_character (buffer
, ')');
1803 /* Dump all the memory operands for statement GS. BUFFER, SPC and
1804 FLAGS are as in dump_gimple_stmt. */
1807 dump_gimple_mem_ops (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1809 tree vdef
= gimple_vdef (gs
);
1810 tree vuse
= gimple_vuse (gs
);
1812 if (!ssa_operands_active () || !gimple_references_memory_p (gs
))
1815 if (vdef
!= NULL_TREE
)
1817 pp_string (buffer
, "# ");
1818 dump_generic_node (buffer
, vdef
, spc
+ 2, flags
, false);
1819 pp_string (buffer
, " = VDEF <");
1820 dump_generic_node (buffer
, vuse
, spc
+ 2, flags
, false);
1821 pp_character (buffer
, '>');
1822 newline_and_indent (buffer
, spc
);
1824 else if (vuse
!= NULL_TREE
)
1826 pp_string (buffer
, "# VUSE <");
1827 dump_generic_node (buffer
, vuse
, spc
+ 2, flags
, false);
1828 pp_character (buffer
, '>');
1829 newline_and_indent (buffer
, spc
);
1834 /* Dump the gimple statement GS on the pretty printer BUFFER, SPC
1835 spaces of indent. FLAGS specifies details to show in the dump (see
1836 TDF_* in dumpfile.h). The caller is responsible for calling
1837 pp_flush on BUFFER to finalize the pretty printer. */
1840 dump_gimple_stmt (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1845 if (flags
& TDF_STMTADDR
)
1846 pp_printf (buffer
, "<&%p> ", (void *) gs
);
1848 if ((flags
& TDF_LINENO
) && gimple_has_location (gs
))
1850 expanded_location xloc
= expand_location (gimple_location (gs
));
1851 pp_character (buffer
, '[');
1854 pp_string (buffer
, xloc
.file
);
1855 pp_string (buffer
, " : ");
1857 pp_decimal_int (buffer
, xloc
.line
);
1858 pp_string (buffer
, ":");
1859 pp_decimal_int (buffer
, xloc
.column
);
1860 pp_string (buffer
, "] ");
1865 int lp_nr
= lookup_stmt_eh_lp (gs
);
1867 pp_printf (buffer
, "[LP %d] ", lp_nr
);
1869 pp_printf (buffer
, "[MNT %d] ", -lp_nr
);
1872 if ((flags
& (TDF_VOPS
|TDF_MEMSYMS
))
1873 && gimple_has_mem_ops (gs
))
1874 dump_gimple_mem_ops (buffer
, gs
, spc
, flags
);
1876 if ((flags
& TDF_ALIAS
)
1877 && gimple_has_lhs (gs
))
1879 tree lhs
= gimple_get_lhs (gs
);
1880 if (TREE_CODE (lhs
) == SSA_NAME
1881 && POINTER_TYPE_P (TREE_TYPE (lhs
))
1882 && SSA_NAME_PTR_INFO (lhs
))
1884 unsigned int align
, misalign
;
1885 struct ptr_info_def
*pi
= SSA_NAME_PTR_INFO (lhs
);
1886 pp_string (buffer
, "# PT = ");
1887 pp_points_to_solution (buffer
, &pi
->pt
);
1888 newline_and_indent (buffer
, spc
);
1889 if (get_ptr_info_alignment (pi
, &align
, &misalign
))
1891 pp_printf (buffer
, "# ALIGN = %u, MISALIGN = %u",
1893 newline_and_indent (buffer
, spc
);
1898 switch (gimple_code (gs
))
1901 dump_gimple_asm (buffer
, gs
, spc
, flags
);
1905 dump_gimple_assign (buffer
, gs
, spc
, flags
);
1909 dump_gimple_bind (buffer
, gs
, spc
, flags
);
1913 dump_gimple_call (buffer
, gs
, spc
, flags
);
1917 dump_gimple_cond (buffer
, gs
, spc
, flags
);
1921 dump_gimple_label (buffer
, gs
, spc
, flags
);
1925 dump_gimple_goto (buffer
, gs
, spc
, flags
);
1929 pp_string (buffer
, "GIMPLE_NOP");
1933 dump_gimple_return (buffer
, gs
, spc
, flags
);
1937 dump_gimple_switch (buffer
, gs
, spc
, flags
);
1941 dump_gimple_try (buffer
, gs
, spc
, flags
);
1945 dump_gimple_phi (buffer
, gs
, spc
, flags
);
1948 case GIMPLE_OMP_PARALLEL
:
1949 dump_gimple_omp_parallel (buffer
, gs
, spc
, flags
);
1952 case GIMPLE_OMP_TASK
:
1953 dump_gimple_omp_task (buffer
, gs
, spc
, flags
);
1956 case GIMPLE_OMP_ATOMIC_LOAD
:
1957 dump_gimple_omp_atomic_load (buffer
, gs
, spc
, flags
);
1961 case GIMPLE_OMP_ATOMIC_STORE
:
1962 dump_gimple_omp_atomic_store (buffer
, gs
, spc
, flags
);
1965 case GIMPLE_OMP_FOR
:
1966 dump_gimple_omp_for (buffer
, gs
, spc
, flags
);
1969 case GIMPLE_OMP_CONTINUE
:
1970 dump_gimple_omp_continue (buffer
, gs
, spc
, flags
);
1973 case GIMPLE_OMP_SINGLE
:
1974 dump_gimple_omp_single (buffer
, gs
, spc
, flags
);
1977 case GIMPLE_OMP_RETURN
:
1978 dump_gimple_omp_return (buffer
, gs
, spc
, flags
);
1981 case GIMPLE_OMP_SECTIONS
:
1982 dump_gimple_omp_sections (buffer
, gs
, spc
, flags
);
1985 case GIMPLE_OMP_SECTIONS_SWITCH
:
1986 pp_string (buffer
, "GIMPLE_SECTIONS_SWITCH");
1989 case GIMPLE_OMP_MASTER
:
1990 case GIMPLE_OMP_ORDERED
:
1991 case GIMPLE_OMP_SECTION
:
1992 dump_gimple_omp_block (buffer
, gs
, spc
, flags
);
1995 case GIMPLE_OMP_CRITICAL
:
1996 dump_gimple_omp_critical (buffer
, gs
, spc
, flags
);
2000 dump_gimple_catch (buffer
, gs
, spc
, flags
);
2003 case GIMPLE_EH_FILTER
:
2004 dump_gimple_eh_filter (buffer
, gs
, spc
, flags
);
2007 case GIMPLE_EH_MUST_NOT_THROW
:
2008 dump_gimple_eh_must_not_throw (buffer
, gs
, spc
, flags
);
2011 case GIMPLE_EH_ELSE
:
2012 dump_gimple_eh_else (buffer
, gs
, spc
, flags
);
2016 dump_gimple_resx (buffer
, gs
, spc
, flags
);
2019 case GIMPLE_EH_DISPATCH
:
2020 dump_gimple_eh_dispatch (buffer
, gs
, spc
, flags
);
2024 dump_gimple_debug (buffer
, gs
, spc
, flags
);
2027 case GIMPLE_PREDICT
:
2028 pp_string (buffer
, "// predicted ");
2029 if (gimple_predict_outcome (gs
))
2030 pp_string (buffer
, "likely by ");
2032 pp_string (buffer
, "unlikely by ");
2033 pp_string (buffer
, predictor_name (gimple_predict_predictor (gs
)));
2034 pp_string (buffer
, " predictor.");
2037 case GIMPLE_TRANSACTION
:
2038 dump_gimple_transaction (buffer
, gs
, spc
, flags
);
2045 /* If we're building a diagnostic, the formatted text will be
2046 written into BUFFER's stream by the caller; otherwise, write it
2048 if (!(flags
& TDF_DIAGNOSTIC
))
2049 pp_write_text_to_stream (buffer
);
2053 /* Dumps header of basic block BB to OUTF indented by INDENT
2054 spaces and details described by flags. */
2057 dump_gimple_bb_header (FILE *outf
, basic_block bb
, int indent
, int flags
)
2059 if (flags
& TDF_BLOCKS
)
2061 if (flags
& TDF_LINENO
)
2063 gimple_stmt_iterator gsi
;
2064 char *s_indent
= (char *) alloca ((size_t) indent
+ 1);
2065 memset (s_indent
, ' ', (size_t) indent
);
2066 s_indent
[indent
] = '\0';
2068 if (flags
& TDF_COMMENT
)
2069 fputs (";; ", outf
);
2071 for (gsi
= gsi_start_bb (bb
); !gsi_end_p (gsi
); gsi_next (&gsi
))
2072 if (!is_gimple_debug (gsi_stmt (gsi
))
2073 && get_lineno (gsi_stmt (gsi
)) != UNKNOWN_LOCATION
)
2075 fprintf (outf
, "%sstarting at line %d",
2076 s_indent
, get_lineno (gsi_stmt (gsi
)));
2079 if (bb
->discriminator
)
2080 fprintf (outf
, ", discriminator %i", bb
->discriminator
);
2086 gimple stmt
= first_stmt (bb
);
2087 if (!stmt
|| gimple_code (stmt
) != GIMPLE_LABEL
)
2089 char *s_indent
= (char *) alloca ((size_t) indent
- 2 + 1);
2090 memset (s_indent
, ' ', (size_t) indent
);
2091 s_indent
[indent
] = '\0';
2092 fprintf (outf
, "%s<bb %d>:\n", s_indent
, bb
->index
);
2098 /* Dumps end of basic block BB to buffer BUFFER indented by INDENT
2102 dump_gimple_bb_footer (FILE *outf ATTRIBUTE_UNUSED
,
2103 basic_block bb ATTRIBUTE_UNUSED
,
2104 int indent ATTRIBUTE_UNUSED
,
2105 int flags ATTRIBUTE_UNUSED
)
2107 /* There is currently no GIMPLE-specific basic block info to dump. */
2112 /* Dump PHI nodes of basic block BB to BUFFER with details described
2113 by FLAGS and indented by INDENT spaces. */
2116 dump_phi_nodes (pretty_printer
*buffer
, basic_block bb
, int indent
, int flags
)
2118 gimple_stmt_iterator i
;
2120 for (i
= gsi_start_phis (bb
); !gsi_end_p (i
); gsi_next (&i
))
2122 gimple phi
= gsi_stmt (i
);
2123 if (is_gimple_reg (gimple_phi_result (phi
)) || (flags
& TDF_VOPS
))
2126 pp_string (buffer
, "# ");
2127 dump_gimple_phi (buffer
, phi
, indent
, flags
);
2128 pp_newline (buffer
);
2134 /* Dump jump to basic block BB that is represented implicitly in the cfg
2138 pp_cfg_jump (pretty_printer
*buffer
, basic_block bb
)
2142 stmt
= first_stmt (bb
);
2144 pp_string (buffer
, "goto <bb ");
2145 pp_decimal_int (buffer
, bb
->index
);
2146 pp_character (buffer
, '>');
2147 if (stmt
&& gimple_code (stmt
) == GIMPLE_LABEL
)
2149 pp_string (buffer
, " (");
2150 dump_generic_node (buffer
, gimple_label_label (stmt
), 0, 0, false);
2151 pp_character (buffer
, ')');
2152 pp_semicolon (buffer
);
2155 pp_semicolon (buffer
);
2159 /* Dump edges represented implicitly in basic block BB to BUFFER, indented
2160 by INDENT spaces, with details given by FLAGS. */
2163 dump_implicit_edges (pretty_printer
*buffer
, basic_block bb
, int indent
,
2169 stmt
= last_stmt (bb
);
2171 if (stmt
&& gimple_code (stmt
) == GIMPLE_COND
)
2173 edge true_edge
, false_edge
;
2175 /* When we are emitting the code or changing CFG, it is possible that
2176 the edges are not yet created. When we are using debug_bb in such
2177 a situation, we do not want it to crash. */
2178 if (EDGE_COUNT (bb
->succs
) != 2)
2180 extract_true_false_edges_from_block (bb
, &true_edge
, &false_edge
);
2182 INDENT (indent
+ 2);
2183 pp_cfg_jump (buffer
, true_edge
->dest
);
2184 newline_and_indent (buffer
, indent
);
2185 pp_string (buffer
, "else");
2186 newline_and_indent (buffer
, indent
+ 2);
2187 pp_cfg_jump (buffer
, false_edge
->dest
);
2188 pp_newline (buffer
);
2192 /* If there is a fallthru edge, we may need to add an artificial
2193 goto to the dump. */
2194 e
= find_fallthru_edge (bb
->succs
);
2196 if (e
&& e
->dest
!= bb
->next_bb
)
2200 if ((flags
& TDF_LINENO
)
2201 && e
->goto_locus
!= UNKNOWN_LOCATION
2204 expanded_location goto_xloc
;
2205 goto_xloc
= expand_location (e
->goto_locus
);
2206 pp_character (buffer
, '[');
2209 pp_string (buffer
, goto_xloc
.file
);
2210 pp_string (buffer
, " : ");
2212 pp_decimal_int (buffer
, goto_xloc
.line
);
2213 pp_string (buffer
, " : ");
2214 pp_decimal_int (buffer
, goto_xloc
.column
);
2215 pp_string (buffer
, "] ");
2218 pp_cfg_jump (buffer
, e
->dest
);
2219 pp_newline (buffer
);
2224 /* Dumps basic block BB to buffer BUFFER with details described by FLAGS and
2225 indented by INDENT spaces. */
2228 gimple_dump_bb_buff (pretty_printer
*buffer
, basic_block bb
, int indent
,
2231 gimple_stmt_iterator gsi
;
2233 int label_indent
= indent
- 2;
2235 if (label_indent
< 0)
2238 dump_phi_nodes (buffer
, bb
, indent
, flags
);
2240 for (gsi
= gsi_start_bb (bb
); !gsi_end_p (gsi
); gsi_next (&gsi
))
2244 stmt
= gsi_stmt (gsi
);
2246 curr_indent
= gimple_code (stmt
) == GIMPLE_LABEL
? label_indent
: indent
;
2248 INDENT (curr_indent
);
2249 dump_gimple_stmt (buffer
, stmt
, curr_indent
, flags
);
2251 dump_histograms_for_stmt (cfun
, buffer
->buffer
->stream
, stmt
);
2254 dump_implicit_edges (buffer
, bb
, indent
, flags
);
2259 /* Dumps basic block BB to FILE with details described by FLAGS and
2260 indented by INDENT spaces. */
2263 gimple_dump_bb (FILE *file
, basic_block bb
, int indent
, int flags
)
2265 dump_gimple_bb_header (file
, bb
, indent
, flags
);
2266 if (bb
->index
>= NUM_FIXED_BLOCKS
)
2268 maybe_init_pretty_print (file
);
2269 gimple_dump_bb_buff (&buffer
, bb
, indent
, flags
);
2271 dump_gimple_bb_footer (file
, bb
, indent
, flags
);