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 indentation 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 /* Print GIMPLE statement G to FILE using SPC indentation spaces and
93 FLAGS as in pp_gimple_stmt_1. */
96 print_gimple_stmt (FILE *file
, gimple g
, int spc
, int flags
)
98 maybe_init_pretty_print (file
);
99 pp_gimple_stmt_1 (&buffer
, g
, spc
, flags
);
100 pp_newline_and_flush (&buffer
);
104 /* Print GIMPLE statement G to FILE using SPC indentation spaces and
105 FLAGS as in pp_gimple_stmt_1. 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 pp_gimple_stmt_1 (&buffer
, g
, spc
, flags
);
117 /* Print the GIMPLE sequence SEQ on BUFFER using SPC indentation
118 spaces and FLAGS as in pp_gimple_stmt_1.
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 pp_gimple_stmt_1 (buffer
, gs
, spc
, flags
);
132 if (!gsi_one_before_end_p (i
))
138 /* Print GIMPLE sequence SEQ to FILE using SPC indentation spaces and
139 FLAGS as in pp_gimple_stmt_1. */
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
);
146 pp_newline_and_flush (&buffer
);
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 pp_gimple_stmt_1. */
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 pp_gimple_stmt_1. */
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 pp_gimple_stmt_1. */
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
)
483 switch (gimple_num_ops (gs
))
486 arg3
= gimple_assign_rhs3 (gs
);
488 arg2
= gimple_assign_rhs2 (gs
);
490 arg1
= gimple_assign_rhs1 (gs
);
496 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%s, %T, %T, %T, %T>", gs
,
497 tree_code_name
[gimple_assign_rhs_code (gs
)],
498 gimple_assign_lhs (gs
), arg1
, arg2
, arg3
);
502 if (!(flags
& TDF_RHS_ONLY
))
504 dump_generic_node (buffer
, gimple_assign_lhs (gs
), spc
, flags
, false);
506 pp_character (buffer
, '=');
508 if (gimple_assign_nontemporal_move_p (gs
))
509 pp_string (buffer
, "{nt}");
511 if (gimple_has_volatile_ops (gs
))
512 pp_string (buffer
, "{v}");
517 if (gimple_num_ops (gs
) == 2)
518 dump_unary_rhs (buffer
, gs
, spc
, flags
);
519 else if (gimple_num_ops (gs
) == 3)
520 dump_binary_rhs (buffer
, gs
, spc
, flags
);
521 else if (gimple_num_ops (gs
) == 4)
522 dump_ternary_rhs (buffer
, gs
, spc
, flags
);
525 if (!(flags
& TDF_RHS_ONLY
))
526 pp_semicolon(buffer
);
531 /* Dump the return statement GS. BUFFER, SPC and FLAGS are as in
535 dump_gimple_return (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
539 t
= gimple_return_retval (gs
);
541 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
, t
);
544 pp_string (buffer
, "return");
548 dump_generic_node (buffer
, t
, spc
, flags
, false);
550 pp_semicolon (buffer
);
555 /* Dump the call arguments for a gimple call. BUFFER, FLAGS are as in
559 dump_gimple_call_args (pretty_printer
*buffer
, gimple gs
, int flags
)
563 for (i
= 0; i
< gimple_call_num_args (gs
); i
++)
565 dump_generic_node (buffer
, gimple_call_arg (gs
, i
), 0, flags
, false);
566 if (i
< gimple_call_num_args (gs
) - 1)
567 pp_string (buffer
, ", ");
570 if (gimple_call_va_arg_pack_p (gs
))
572 if (gimple_call_num_args (gs
) > 0)
574 pp_character (buffer
, ',');
578 pp_string (buffer
, "__builtin_va_arg_pack ()");
582 /* Dump the points-to solution *PT to BUFFER. */
585 pp_points_to_solution (pretty_printer
*buffer
, struct pt_solution
*pt
)
589 pp_string (buffer
, "anything ");
593 pp_string (buffer
, "nonlocal ");
595 pp_string (buffer
, "escaped ");
597 pp_string (buffer
, "unit-escaped ");
599 pp_string (buffer
, "null ");
601 && !bitmap_empty_p (pt
->vars
))
605 pp_string (buffer
, "{ ");
606 EXECUTE_IF_SET_IN_BITMAP (pt
->vars
, 0, i
, bi
)
608 pp_string (buffer
, "D.");
609 pp_decimal_int (buffer
, i
);
610 pp_character (buffer
, ' ');
612 pp_character (buffer
, '}');
613 if (pt
->vars_contains_global
)
614 pp_string (buffer
, " (glob)");
618 /* Dump the call statement GS. BUFFER, SPC and FLAGS are as in
622 dump_gimple_call (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
624 tree lhs
= gimple_call_lhs (gs
);
625 tree fn
= gimple_call_fn (gs
);
627 if (flags
& TDF_ALIAS
)
629 struct pt_solution
*pt
;
630 pt
= gimple_call_use_set (gs
);
631 if (!pt_solution_empty_p (pt
))
633 pp_string (buffer
, "# USE = ");
634 pp_points_to_solution (buffer
, pt
);
635 newline_and_indent (buffer
, spc
);
637 pt
= gimple_call_clobber_set (gs
);
638 if (!pt_solution_empty_p (pt
))
640 pp_string (buffer
, "# CLB = ");
641 pp_points_to_solution (buffer
, pt
);
642 newline_and_indent (buffer
, spc
);
648 if (gimple_call_internal_p (gs
))
649 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%s, %T", gs
,
650 internal_fn_name (gimple_call_internal_fn (gs
)), lhs
);
652 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %T", gs
, fn
, lhs
);
653 if (gimple_call_num_args (gs
) > 0)
655 pp_string (buffer
, ", ");
656 dump_gimple_call_args (buffer
, gs
, flags
);
658 pp_character (buffer
, '>');
662 if (lhs
&& !(flags
& TDF_RHS_ONLY
))
664 dump_generic_node (buffer
, lhs
, spc
, flags
, false);
665 pp_string (buffer
, " =");
667 if (gimple_has_volatile_ops (gs
))
668 pp_string (buffer
, "{v}");
672 if (gimple_call_internal_p (gs
))
673 pp_string (buffer
, internal_fn_name (gimple_call_internal_fn (gs
)));
675 print_call_name (buffer
, fn
, flags
);
676 pp_string (buffer
, " (");
677 dump_gimple_call_args (buffer
, gs
, flags
);
678 pp_character (buffer
, ')');
679 if (!(flags
& TDF_RHS_ONLY
))
680 pp_semicolon (buffer
);
683 if (gimple_call_chain (gs
))
685 pp_string (buffer
, " [static-chain: ");
686 dump_generic_node (buffer
, gimple_call_chain (gs
), spc
, flags
, false);
687 pp_character (buffer
, ']');
690 if (gimple_call_return_slot_opt_p (gs
))
691 pp_string (buffer
, " [return slot optimization]");
692 if (gimple_call_tail_p (gs
))
693 pp_string (buffer
, " [tail call]");
698 /* Dump the arguments of _ITM_beginTransaction sanely. */
699 if (TREE_CODE (fn
) == ADDR_EXPR
)
700 fn
= TREE_OPERAND (fn
, 0);
701 if (TREE_CODE (fn
) == FUNCTION_DECL
&& decl_is_tm_clone (fn
))
702 pp_string (buffer
, " [tm-clone]");
703 if (TREE_CODE (fn
) == FUNCTION_DECL
704 && DECL_BUILT_IN_CLASS (fn
) == BUILT_IN_NORMAL
705 && DECL_FUNCTION_CODE (fn
) == BUILT_IN_TM_START
706 && gimple_call_num_args (gs
) > 0)
708 tree t
= gimple_call_arg (gs
, 0);
709 unsigned HOST_WIDE_INT props
;
710 gcc_assert (TREE_CODE (t
) == INTEGER_CST
);
712 pp_string (buffer
, " [ ");
714 /* Get the transaction code properties. */
715 props
= TREE_INT_CST_LOW (t
);
717 if (props
& PR_INSTRUMENTEDCODE
)
718 pp_string (buffer
, "instrumentedCode ");
719 if (props
& PR_UNINSTRUMENTEDCODE
)
720 pp_string (buffer
, "uninstrumentedCode ");
721 if (props
& PR_HASNOXMMUPDATE
)
722 pp_string (buffer
, "hasNoXMMUpdate ");
723 if (props
& PR_HASNOABORT
)
724 pp_string (buffer
, "hasNoAbort ");
725 if (props
& PR_HASNOIRREVOCABLE
)
726 pp_string (buffer
, "hasNoIrrevocable ");
727 if (props
& PR_DOESGOIRREVOCABLE
)
728 pp_string (buffer
, "doesGoIrrevocable ");
729 if (props
& PR_HASNOSIMPLEREADS
)
730 pp_string (buffer
, "hasNoSimpleReads ");
731 if (props
& PR_AWBARRIERSOMITTED
)
732 pp_string (buffer
, "awBarriersOmitted ");
733 if (props
& PR_RARBARRIERSOMITTED
)
734 pp_string (buffer
, "RaRBarriersOmitted ");
735 if (props
& PR_UNDOLOGCODE
)
736 pp_string (buffer
, "undoLogCode ");
737 if (props
& PR_PREFERUNINSTRUMENTED
)
738 pp_string (buffer
, "preferUninstrumented ");
739 if (props
& PR_EXCEPTIONBLOCK
)
740 pp_string (buffer
, "exceptionBlock ");
741 if (props
& PR_HASELSE
)
742 pp_string (buffer
, "hasElse ");
743 if (props
& PR_READONLY
)
744 pp_string (buffer
, "readOnly ");
746 pp_string (buffer
, "]");
751 /* Dump the switch statement GS. BUFFER, SPC and FLAGS are as in
755 dump_gimple_switch (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
759 GIMPLE_CHECK (gs
, GIMPLE_SWITCH
);
761 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, ", gs
,
762 gimple_switch_index (gs
));
765 pp_string (buffer
, "switch (");
766 dump_generic_node (buffer
, gimple_switch_index (gs
), spc
, flags
, true);
767 pp_string (buffer
, ") <");
770 for (i
= 0; i
< gimple_switch_num_labels (gs
); i
++)
772 tree case_label
= gimple_switch_label (gs
, i
);
773 gcc_checking_assert (case_label
!= NULL_TREE
);
774 dump_generic_node (buffer
, case_label
, spc
, flags
, false);
775 pp_character (buffer
, ' ');
776 dump_generic_node (buffer
, CASE_LABEL (case_label
), spc
, flags
, false);
777 if (i
< gimple_switch_num_labels (gs
) - 1)
778 pp_string (buffer
, ", ");
780 pp_character (buffer
, '>');
784 /* Dump the gimple conditional GS. BUFFER, SPC and FLAGS are as in
788 dump_gimple_cond (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
791 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%s, %T, %T, %T, %T>", gs
,
792 tree_code_name
[gimple_cond_code (gs
)],
793 gimple_cond_lhs (gs
), gimple_cond_rhs (gs
),
794 gimple_cond_true_label (gs
), gimple_cond_false_label (gs
));
797 if (!(flags
& TDF_RHS_ONLY
))
798 pp_string (buffer
, "if (");
799 dump_generic_node (buffer
, gimple_cond_lhs (gs
), spc
, flags
, false);
801 pp_string (buffer
, op_symbol_code (gimple_cond_code (gs
)));
803 dump_generic_node (buffer
, gimple_cond_rhs (gs
), spc
, flags
, false);
804 if (!(flags
& TDF_RHS_ONLY
))
806 pp_character (buffer
, ')');
808 if (gimple_cond_true_label (gs
))
810 pp_string (buffer
, " goto ");
811 dump_generic_node (buffer
, gimple_cond_true_label (gs
),
813 pp_semicolon (buffer
);
815 if (gimple_cond_false_label (gs
))
817 pp_string (buffer
, " else goto ");
818 dump_generic_node (buffer
, gimple_cond_false_label (gs
),
820 pp_semicolon (buffer
);
827 /* Dump a GIMPLE_LABEL tuple on the pretty_printer BUFFER, SPC
828 spaces of indent. FLAGS specifies details to show in the dump (see
829 TDF_* in dumpfils.h). */
832 dump_gimple_label (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
834 tree label
= gimple_label_label (gs
);
836 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
, label
);
839 dump_generic_node (buffer
, label
, spc
, flags
, false);
840 pp_character (buffer
, ':');
842 if (DECL_NONLOCAL (label
))
843 pp_string (buffer
, " [non-local]");
844 if ((flags
& TDF_EH
) && EH_LANDING_PAD_NR (label
))
845 pp_printf (buffer
, " [LP %d]", EH_LANDING_PAD_NR (label
));
848 /* Dump a GIMPLE_GOTO tuple on the pretty_printer BUFFER, SPC
849 spaces of indent. FLAGS specifies details to show in the dump (see
850 TDF_* in dumpfile.h). */
853 dump_gimple_goto (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
855 tree label
= gimple_goto_dest (gs
);
857 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
, label
);
859 dump_gimple_fmt (buffer
, spc
, flags
, "goto %T;", label
);
863 /* Dump a GIMPLE_BIND tuple on the pretty_printer BUFFER, SPC
864 spaces of indent. FLAGS specifies details to show in the dump (see
865 TDF_* in dumpfile.h). */
868 dump_gimple_bind (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
871 dump_gimple_fmt (buffer
, spc
, flags
, "%G <", gs
);
873 pp_character (buffer
, '{');
874 if (!(flags
& TDF_SLIM
))
878 for (var
= gimple_bind_vars (gs
); var
; var
= DECL_CHAIN (var
))
880 newline_and_indent (buffer
, 2);
881 print_declaration (buffer
, var
, spc
, flags
);
883 if (gimple_bind_vars (gs
))
887 dump_gimple_seq (buffer
, gimple_bind_body (gs
), spc
+ 2, flags
);
888 newline_and_indent (buffer
, spc
);
890 pp_character (buffer
, '>');
892 pp_character (buffer
, '}');
896 /* Dump a GIMPLE_TRY tuple on the pretty_printer BUFFER, SPC spaces of
897 indent. FLAGS specifies details to show in the dump (see TDF_* in
901 dump_gimple_try (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
906 if (gimple_try_kind (gs
) == GIMPLE_TRY_CATCH
)
907 type
= "GIMPLE_TRY_CATCH";
908 else if (gimple_try_kind (gs
) == GIMPLE_TRY_FINALLY
)
909 type
= "GIMPLE_TRY_FINALLY";
911 type
= "UNKNOWN GIMPLE_TRY";
912 dump_gimple_fmt (buffer
, spc
, flags
,
913 "%G <%s,%+EVAL <%S>%nCLEANUP <%S>%->", gs
, type
,
914 gimple_try_eval (gs
), gimple_try_cleanup (gs
));
918 pp_string (buffer
, "try");
919 newline_and_indent (buffer
, spc
+ 2);
920 pp_character (buffer
, '{');
923 dump_gimple_seq (buffer
, gimple_try_eval (gs
), spc
+ 4, flags
);
924 newline_and_indent (buffer
, spc
+ 2);
925 pp_character (buffer
, '}');
927 if (gimple_try_kind (gs
) == GIMPLE_TRY_CATCH
)
929 newline_and_indent (buffer
, spc
);
930 pp_string (buffer
, "catch");
931 newline_and_indent (buffer
, spc
+ 2);
932 pp_character (buffer
, '{');
934 else if (gimple_try_kind (gs
) == GIMPLE_TRY_FINALLY
)
936 newline_and_indent (buffer
, spc
);
937 pp_string (buffer
, "finally");
938 newline_and_indent (buffer
, spc
+ 2);
939 pp_character (buffer
, '{');
942 pp_string (buffer
, " <UNKNOWN GIMPLE_TRY> {");
945 dump_gimple_seq (buffer
, gimple_try_cleanup (gs
), spc
+ 4, flags
);
946 newline_and_indent (buffer
, spc
+ 2);
947 pp_character (buffer
, '}');
952 /* Dump a GIMPLE_CATCH tuple on the pretty_printer BUFFER, SPC spaces of
953 indent. FLAGS specifies details to show in the dump (see TDF_* in
957 dump_gimple_catch (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
960 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %+CATCH <%S>%->", gs
,
961 gimple_catch_types (gs
), gimple_catch_handler (gs
));
963 dump_gimple_fmt (buffer
, spc
, flags
, "catch (%T)%+{%S}",
964 gimple_catch_types (gs
), gimple_catch_handler (gs
));
968 /* Dump a GIMPLE_EH_FILTER tuple on the pretty_printer BUFFER, SPC spaces of
969 indent. FLAGS specifies details to show in the dump (see TDF_* in
973 dump_gimple_eh_filter (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
976 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %+FAILURE <%S>%->", gs
,
977 gimple_eh_filter_types (gs
),
978 gimple_eh_filter_failure (gs
));
980 dump_gimple_fmt (buffer
, spc
, flags
, "<<<eh_filter (%T)>>>%+{%+%S%-}",
981 gimple_eh_filter_types (gs
),
982 gimple_eh_filter_failure (gs
));
986 /* Dump a GIMPLE_EH_MUST_NOT_THROW tuple. */
989 dump_gimple_eh_must_not_throw (pretty_printer
*buffer
, gimple gs
,
993 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
,
994 gimple_eh_must_not_throw_fndecl (gs
));
996 dump_gimple_fmt (buffer
, spc
, flags
, "<<<eh_must_not_throw (%T)>>>",
997 gimple_eh_must_not_throw_fndecl (gs
));
1001 /* Dump a GIMPLE_EH_ELSE tuple on the pretty_printer BUFFER, SPC spaces of
1002 indent. FLAGS specifies details to show in the dump (see TDF_* in
1006 dump_gimple_eh_else (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1008 if (flags
& TDF_RAW
)
1009 dump_gimple_fmt (buffer
, spc
, flags
,
1010 "%G <%+N_BODY <%S>%nE_BODY <%S>%->", gs
,
1011 gimple_eh_else_n_body (gs
), gimple_eh_else_e_body (gs
));
1013 dump_gimple_fmt (buffer
, spc
, flags
,
1014 "<<<if_normal_exit>>>%+{%S}%-<<<else_eh_exit>>>%+{%S}",
1015 gimple_eh_else_n_body (gs
), gimple_eh_else_e_body (gs
));
1019 /* Dump a GIMPLE_RESX tuple on the pretty_printer BUFFER, SPC spaces of
1020 indent. FLAGS specifies details to show in the dump (see TDF_* in
1024 dump_gimple_resx (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1026 if (flags
& TDF_RAW
)
1027 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%d>", gs
,
1028 gimple_resx_region (gs
));
1030 dump_gimple_fmt (buffer
, spc
, flags
, "resx %d", gimple_resx_region (gs
));
1033 /* Dump a GIMPLE_EH_DISPATCH tuple on the pretty_printer BUFFER. */
1036 dump_gimple_eh_dispatch (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1038 if (flags
& TDF_RAW
)
1039 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%d>", gs
,
1040 gimple_eh_dispatch_region (gs
));
1042 dump_gimple_fmt (buffer
, spc
, flags
, "eh_dispatch %d",
1043 gimple_eh_dispatch_region (gs
));
1046 /* Dump a GIMPLE_DEBUG tuple on the pretty_printer BUFFER, SPC spaces
1047 of indent. FLAGS specifies details to show in the dump (see TDF_*
1051 dump_gimple_debug (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1053 switch (gs
->gsbase
.subcode
)
1055 case GIMPLE_DEBUG_BIND
:
1056 if (flags
& TDF_RAW
)
1057 dump_gimple_fmt (buffer
, spc
, flags
, "%G BIND <%T, %T>", gs
,
1058 gimple_debug_bind_get_var (gs
),
1059 gimple_debug_bind_get_value (gs
));
1061 dump_gimple_fmt (buffer
, spc
, flags
, "# DEBUG %T => %T",
1062 gimple_debug_bind_get_var (gs
),
1063 gimple_debug_bind_get_value (gs
));
1066 case GIMPLE_DEBUG_SOURCE_BIND
:
1067 if (flags
& TDF_RAW
)
1068 dump_gimple_fmt (buffer
, spc
, flags
, "%G SRCBIND <%T, %T>", gs
,
1069 gimple_debug_source_bind_get_var (gs
),
1070 gimple_debug_source_bind_get_value (gs
));
1072 dump_gimple_fmt (buffer
, spc
, flags
, "# DEBUG %T s=> %T",
1073 gimple_debug_source_bind_get_var (gs
),
1074 gimple_debug_source_bind_get_value (gs
));
1082 /* Dump a GIMPLE_OMP_FOR tuple on the pretty_printer BUFFER. */
1084 dump_gimple_omp_for (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1088 if (flags
& TDF_RAW
)
1090 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1091 gimple_omp_body (gs
));
1092 dump_omp_clauses (buffer
, gimple_omp_for_clauses (gs
), spc
, flags
);
1093 dump_gimple_fmt (buffer
, spc
, flags
, " >,");
1094 for (i
= 0; i
< gimple_omp_for_collapse (gs
); i
++)
1095 dump_gimple_fmt (buffer
, spc
, flags
,
1096 "%+%T, %T, %T, %s, %T,%n",
1097 gimple_omp_for_index (gs
, i
),
1098 gimple_omp_for_initial (gs
, i
),
1099 gimple_omp_for_final (gs
, i
),
1100 tree_code_name
[gimple_omp_for_cond (gs
, i
)],
1101 gimple_omp_for_incr (gs
, i
));
1102 dump_gimple_fmt (buffer
, spc
, flags
, "PRE_BODY <%S>%->",
1103 gimple_omp_for_pre_body (gs
));
1107 pp_string (buffer
, "#pragma omp for");
1108 dump_omp_clauses (buffer
, gimple_omp_for_clauses (gs
), spc
, flags
);
1109 for (i
= 0; i
< gimple_omp_for_collapse (gs
); i
++)
1113 newline_and_indent (buffer
, spc
);
1114 pp_string (buffer
, "for (");
1115 dump_generic_node (buffer
, gimple_omp_for_index (gs
, i
), spc
,
1117 pp_string (buffer
, " = ");
1118 dump_generic_node (buffer
, gimple_omp_for_initial (gs
, i
), spc
,
1120 pp_string (buffer
, "; ");
1122 dump_generic_node (buffer
, gimple_omp_for_index (gs
, i
), spc
,
1125 switch (gimple_omp_for_cond (gs
, i
))
1128 pp_character (buffer
, '<');
1131 pp_character (buffer
, '>');
1134 pp_string (buffer
, "<=");
1137 pp_string (buffer
, ">=");
1143 dump_generic_node (buffer
, gimple_omp_for_final (gs
, i
), spc
,
1145 pp_string (buffer
, "; ");
1147 dump_generic_node (buffer
, gimple_omp_for_index (gs
, i
), spc
,
1149 pp_string (buffer
, " = ");
1150 dump_generic_node (buffer
, gimple_omp_for_incr (gs
, i
), spc
,
1152 pp_character (buffer
, ')');
1155 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1157 newline_and_indent (buffer
, spc
+ 2);
1158 pp_character (buffer
, '{');
1159 pp_newline (buffer
);
1160 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1161 newline_and_indent (buffer
, spc
+ 2);
1162 pp_character (buffer
, '}');
1167 /* Dump a GIMPLE_OMP_CONTINUE tuple on the pretty_printer BUFFER. */
1170 dump_gimple_omp_continue (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1172 if (flags
& TDF_RAW
)
1174 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %T>", gs
,
1175 gimple_omp_continue_control_def (gs
),
1176 gimple_omp_continue_control_use (gs
));
1180 pp_string (buffer
, "#pragma omp continue (");
1181 dump_generic_node (buffer
, gimple_omp_continue_control_def (gs
),
1183 pp_character (buffer
, ',');
1185 dump_generic_node (buffer
, gimple_omp_continue_control_use (gs
),
1187 pp_character (buffer
, ')');
1191 /* Dump a GIMPLE_OMP_SINGLE tuple on the pretty_printer BUFFER. */
1194 dump_gimple_omp_single (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1196 if (flags
& TDF_RAW
)
1198 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1199 gimple_omp_body (gs
));
1200 dump_omp_clauses (buffer
, gimple_omp_single_clauses (gs
), spc
, flags
);
1201 dump_gimple_fmt (buffer
, spc
, flags
, " >");
1205 pp_string (buffer
, "#pragma omp single");
1206 dump_omp_clauses (buffer
, gimple_omp_single_clauses (gs
), spc
, flags
);
1207 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1209 newline_and_indent (buffer
, spc
+ 2);
1210 pp_character (buffer
, '{');
1211 pp_newline (buffer
);
1212 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1213 newline_and_indent (buffer
, spc
+ 2);
1214 pp_character (buffer
, '}');
1219 /* Dump a GIMPLE_OMP_SECTIONS tuple on the pretty_printer BUFFER. */
1222 dump_gimple_omp_sections (pretty_printer
*buffer
, gimple gs
, int spc
,
1225 if (flags
& TDF_RAW
)
1227 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1228 gimple_omp_body (gs
));
1229 dump_omp_clauses (buffer
, gimple_omp_sections_clauses (gs
), spc
, flags
);
1230 dump_gimple_fmt (buffer
, spc
, flags
, " >");
1234 pp_string (buffer
, "#pragma omp sections");
1235 if (gimple_omp_sections_control (gs
))
1237 pp_string (buffer
, " <");
1238 dump_generic_node (buffer
, gimple_omp_sections_control (gs
), spc
,
1240 pp_character (buffer
, '>');
1242 dump_omp_clauses (buffer
, gimple_omp_sections_clauses (gs
), spc
, flags
);
1243 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1245 newline_and_indent (buffer
, spc
+ 2);
1246 pp_character (buffer
, '{');
1247 pp_newline (buffer
);
1248 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1249 newline_and_indent (buffer
, spc
+ 2);
1250 pp_character (buffer
, '}');
1255 /* Dump a GIMPLE_OMP_{MASTER,ORDERED,SECTION} tuple on the pretty_printer
1259 dump_gimple_omp_block (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1261 if (flags
& TDF_RAW
)
1262 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S> >", gs
,
1263 gimple_omp_body (gs
));
1266 switch (gimple_code (gs
))
1268 case GIMPLE_OMP_MASTER
:
1269 pp_string (buffer
, "#pragma omp master");
1271 case GIMPLE_OMP_ORDERED
:
1272 pp_string (buffer
, "#pragma omp ordered");
1274 case GIMPLE_OMP_SECTION
:
1275 pp_string (buffer
, "#pragma omp section");
1280 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1282 newline_and_indent (buffer
, spc
+ 2);
1283 pp_character (buffer
, '{');
1284 pp_newline (buffer
);
1285 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1286 newline_and_indent (buffer
, spc
+ 2);
1287 pp_character (buffer
, '}');
1292 /* Dump a GIMPLE_OMP_CRITICAL tuple on the pretty_printer BUFFER. */
1295 dump_gimple_omp_critical (pretty_printer
*buffer
, gimple gs
, int spc
,
1298 if (flags
& TDF_RAW
)
1299 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S> >", gs
,
1300 gimple_omp_body (gs
));
1303 pp_string (buffer
, "#pragma omp critical");
1304 if (gimple_omp_critical_name (gs
))
1306 pp_string (buffer
, " (");
1307 dump_generic_node (buffer
, gimple_omp_critical_name (gs
), spc
,
1309 pp_character (buffer
, ')');
1311 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1313 newline_and_indent (buffer
, spc
+ 2);
1314 pp_character (buffer
, '{');
1315 pp_newline (buffer
);
1316 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1317 newline_and_indent (buffer
, spc
+ 2);
1318 pp_character (buffer
, '}');
1323 /* Dump a GIMPLE_OMP_RETURN tuple on the pretty_printer BUFFER. */
1326 dump_gimple_omp_return (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1328 if (flags
& TDF_RAW
)
1330 dump_gimple_fmt (buffer
, spc
, flags
, "%G <nowait=%d>", gs
,
1331 (int) gimple_omp_return_nowait_p (gs
));
1335 pp_string (buffer
, "#pragma omp return");
1336 if (gimple_omp_return_nowait_p (gs
))
1337 pp_string (buffer
, "(nowait)");
1341 /* Dump a GIMPLE_TRANSACTION tuple on the pretty_printer BUFFER. */
1344 dump_gimple_transaction (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1346 unsigned subcode
= gimple_transaction_subcode (gs
);
1348 if (flags
& TDF_RAW
)
1350 dump_gimple_fmt (buffer
, spc
, flags
,
1351 "%G [SUBCODE=%x,LABEL=%T] <%+BODY <%S> >",
1352 gs
, subcode
, gimple_transaction_label (gs
),
1353 gimple_transaction_body (gs
));
1357 if (subcode
& GTMA_IS_OUTER
)
1358 pp_string (buffer
, "__transaction_atomic [[outer]]");
1359 else if (subcode
& GTMA_IS_RELAXED
)
1360 pp_string (buffer
, "__transaction_relaxed");
1362 pp_string (buffer
, "__transaction_atomic");
1363 subcode
&= ~GTMA_DECLARATION_MASK
;
1365 if (subcode
|| gimple_transaction_label (gs
))
1367 pp_string (buffer
, " //");
1368 if (gimple_transaction_label (gs
))
1370 pp_string (buffer
, " LABEL=");
1371 dump_generic_node (buffer
, gimple_transaction_label (gs
),
1376 pp_string (buffer
, " SUBCODE=[ ");
1377 if (subcode
& GTMA_HAVE_ABORT
)
1379 pp_string (buffer
, "GTMA_HAVE_ABORT ");
1380 subcode
&= ~GTMA_HAVE_ABORT
;
1382 if (subcode
& GTMA_HAVE_LOAD
)
1384 pp_string (buffer
, "GTMA_HAVE_LOAD ");
1385 subcode
&= ~GTMA_HAVE_LOAD
;
1387 if (subcode
& GTMA_HAVE_STORE
)
1389 pp_string (buffer
, "GTMA_HAVE_STORE ");
1390 subcode
&= ~GTMA_HAVE_STORE
;
1392 if (subcode
& GTMA_MAY_ENTER_IRREVOCABLE
)
1394 pp_string (buffer
, "GTMA_MAY_ENTER_IRREVOCABLE ");
1395 subcode
&= ~GTMA_MAY_ENTER_IRREVOCABLE
;
1397 if (subcode
& GTMA_DOES_GO_IRREVOCABLE
)
1399 pp_string (buffer
, "GTMA_DOES_GO_IRREVOCABLE ");
1400 subcode
&= ~GTMA_DOES_GO_IRREVOCABLE
;
1403 pp_printf (buffer
, "0x%x ", subcode
);
1404 pp_string (buffer
, "]");
1408 if (!gimple_seq_empty_p (gimple_transaction_body (gs
)))
1410 newline_and_indent (buffer
, spc
+ 2);
1411 pp_character (buffer
, '{');
1412 pp_newline (buffer
);
1413 dump_gimple_seq (buffer
, gimple_transaction_body (gs
),
1415 newline_and_indent (buffer
, spc
+ 2);
1416 pp_character (buffer
, '}');
1421 /* Dump a GIMPLE_ASM tuple on the pretty_printer BUFFER, SPC spaces of
1422 indent. FLAGS specifies details to show in the dump (see TDF_* in
1426 dump_gimple_asm (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1428 unsigned int i
, n
, f
, fields
;
1430 if (flags
& TDF_RAW
)
1432 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+STRING <%n%s%n>", gs
,
1433 gimple_asm_string (gs
));
1435 n
= gimple_asm_noutputs (gs
);
1438 newline_and_indent (buffer
, spc
+ 2);
1439 pp_string (buffer
, "OUTPUT: ");
1440 for (i
= 0; i
< n
; i
++)
1442 dump_generic_node (buffer
, gimple_asm_output_op (gs
, i
),
1445 pp_string (buffer
, ", ");
1449 n
= gimple_asm_ninputs (gs
);
1452 newline_and_indent (buffer
, spc
+ 2);
1453 pp_string (buffer
, "INPUT: ");
1454 for (i
= 0; i
< n
; i
++)
1456 dump_generic_node (buffer
, gimple_asm_input_op (gs
, i
),
1459 pp_string (buffer
, ", ");
1463 n
= gimple_asm_nclobbers (gs
);
1466 newline_and_indent (buffer
, spc
+ 2);
1467 pp_string (buffer
, "CLOBBER: ");
1468 for (i
= 0; i
< n
; i
++)
1470 dump_generic_node (buffer
, gimple_asm_clobber_op (gs
, i
),
1473 pp_string (buffer
, ", ");
1477 n
= gimple_asm_nlabels (gs
);
1480 newline_and_indent (buffer
, spc
+ 2);
1481 pp_string (buffer
, "LABEL: ");
1482 for (i
= 0; i
< n
; i
++)
1484 dump_generic_node (buffer
, gimple_asm_label_op (gs
, i
),
1487 pp_string (buffer
, ", ");
1491 newline_and_indent (buffer
, spc
);
1492 pp_character (buffer
, '>');
1496 pp_string (buffer
, "__asm__");
1497 if (gimple_asm_volatile_p (gs
))
1498 pp_string (buffer
, " __volatile__");
1499 if (gimple_asm_nlabels (gs
))
1500 pp_string (buffer
, " goto");
1501 pp_string (buffer
, "(\"");
1502 pp_string (buffer
, gimple_asm_string (gs
));
1503 pp_string (buffer
, "\"");
1505 if (gimple_asm_nlabels (gs
))
1507 else if (gimple_asm_nclobbers (gs
))
1509 else if (gimple_asm_ninputs (gs
))
1511 else if (gimple_asm_noutputs (gs
))
1516 for (f
= 0; f
< fields
; ++f
)
1518 pp_string (buffer
, " : ");
1523 n
= gimple_asm_noutputs (gs
);
1524 for (i
= 0; i
< n
; i
++)
1526 dump_generic_node (buffer
, gimple_asm_output_op (gs
, i
),
1529 pp_string (buffer
, ", ");
1534 n
= gimple_asm_ninputs (gs
);
1535 for (i
= 0; i
< n
; i
++)
1537 dump_generic_node (buffer
, gimple_asm_input_op (gs
, i
),
1540 pp_string (buffer
, ", ");
1545 n
= gimple_asm_nclobbers (gs
);
1546 for (i
= 0; i
< n
; i
++)
1548 dump_generic_node (buffer
, gimple_asm_clobber_op (gs
, i
),
1551 pp_string (buffer
, ", ");
1556 n
= gimple_asm_nlabels (gs
);
1557 for (i
= 0; i
< n
; i
++)
1559 dump_generic_node (buffer
, gimple_asm_label_op (gs
, i
),
1562 pp_string (buffer
, ", ");
1571 pp_string (buffer
, ");");
1576 /* Dump a PHI node PHI. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.
1577 The caller is responsible for calling pp_flush on BUFFER to finalize
1581 dump_gimple_phi (pretty_printer
*buffer
, gimple phi
, int spc
, int flags
)
1584 tree lhs
= gimple_phi_result (phi
);
1586 if (flags
& TDF_ALIAS
1587 && POINTER_TYPE_P (TREE_TYPE (lhs
))
1588 && SSA_NAME_PTR_INFO (lhs
))
1590 unsigned int align
, misalign
;
1591 struct ptr_info_def
*pi
= SSA_NAME_PTR_INFO (lhs
);
1592 pp_string (buffer
, "PT = ");
1593 pp_points_to_solution (buffer
, &pi
->pt
);
1594 newline_and_indent (buffer
, spc
);
1595 if (get_ptr_info_alignment (pi
, &align
, &misalign
))
1597 pp_printf (buffer
, "# ALIGN = %u, MISALIGN = %u", align
, misalign
);
1598 newline_and_indent (buffer
, spc
);
1600 pp_string (buffer
, "# ");
1603 if (flags
& TDF_RAW
)
1604 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, ", phi
,
1605 gimple_phi_result (phi
));
1608 dump_generic_node (buffer
, lhs
, spc
, flags
, false);
1609 pp_string (buffer
, " = PHI <");
1611 for (i
= 0; i
< gimple_phi_num_args (phi
); i
++)
1613 if ((flags
& TDF_LINENO
) && gimple_phi_arg_has_location (phi
, i
))
1615 expanded_location xloc
;
1617 xloc
= expand_location (gimple_phi_arg_location (phi
, i
));
1618 pp_character (buffer
, '[');
1621 pp_string (buffer
, xloc
.file
);
1622 pp_string (buffer
, " : ");
1624 pp_decimal_int (buffer
, xloc
.line
);
1625 pp_string (buffer
, ":");
1626 pp_decimal_int (buffer
, xloc
.column
);
1627 pp_string (buffer
, "] ");
1629 dump_generic_node (buffer
, gimple_phi_arg_def (phi
, i
), spc
, flags
,
1631 pp_character (buffer
, '(');
1632 pp_decimal_int (buffer
, gimple_phi_arg_edge (phi
, i
)->src
->index
);
1633 pp_character (buffer
, ')');
1634 if (i
< gimple_phi_num_args (phi
) - 1)
1635 pp_string (buffer
, ", ");
1637 pp_character (buffer
, '>');
1641 /* Dump a GIMPLE_OMP_PARALLEL tuple on the pretty_printer BUFFER, SPC spaces
1642 of indent. FLAGS specifies details to show in the dump (see TDF_* in
1646 dump_gimple_omp_parallel (pretty_printer
*buffer
, gimple gs
, int spc
,
1649 if (flags
& TDF_RAW
)
1651 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1652 gimple_omp_body (gs
));
1653 dump_omp_clauses (buffer
, gimple_omp_parallel_clauses (gs
), spc
, flags
);
1654 dump_gimple_fmt (buffer
, spc
, flags
, " >, %T, %T%n>",
1655 gimple_omp_parallel_child_fn (gs
),
1656 gimple_omp_parallel_data_arg (gs
));
1661 pp_string (buffer
, "#pragma omp parallel");
1662 dump_omp_clauses (buffer
, gimple_omp_parallel_clauses (gs
), spc
, flags
);
1663 if (gimple_omp_parallel_child_fn (gs
))
1665 pp_string (buffer
, " [child fn: ");
1666 dump_generic_node (buffer
, gimple_omp_parallel_child_fn (gs
),
1668 pp_string (buffer
, " (");
1669 if (gimple_omp_parallel_data_arg (gs
))
1670 dump_generic_node (buffer
, gimple_omp_parallel_data_arg (gs
),
1673 pp_string (buffer
, "???");
1674 pp_string (buffer
, ")]");
1676 body
= gimple_omp_body (gs
);
1677 if (body
&& gimple_code (gimple_seq_first_stmt (body
)) != GIMPLE_BIND
)
1679 newline_and_indent (buffer
, spc
+ 2);
1680 pp_character (buffer
, '{');
1681 pp_newline (buffer
);
1682 dump_gimple_seq (buffer
, body
, spc
+ 4, flags
);
1683 newline_and_indent (buffer
, spc
+ 2);
1684 pp_character (buffer
, '}');
1688 pp_newline (buffer
);
1689 dump_gimple_seq (buffer
, body
, spc
+ 2, flags
);
1695 /* Dump a GIMPLE_OMP_TASK tuple on the pretty_printer BUFFER, SPC spaces
1696 of indent. FLAGS specifies details to show in the dump (see TDF_* in
1700 dump_gimple_omp_task (pretty_printer
*buffer
, gimple gs
, int spc
,
1703 if (flags
& TDF_RAW
)
1705 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1706 gimple_omp_body (gs
));
1707 dump_omp_clauses (buffer
, gimple_omp_task_clauses (gs
), spc
, flags
);
1708 dump_gimple_fmt (buffer
, spc
, flags
, " >, %T, %T, %T, %T, %T%n>",
1709 gimple_omp_task_child_fn (gs
),
1710 gimple_omp_task_data_arg (gs
),
1711 gimple_omp_task_copy_fn (gs
),
1712 gimple_omp_task_arg_size (gs
),
1713 gimple_omp_task_arg_size (gs
));
1718 pp_string (buffer
, "#pragma omp task");
1719 dump_omp_clauses (buffer
, gimple_omp_task_clauses (gs
), spc
, flags
);
1720 if (gimple_omp_task_child_fn (gs
))
1722 pp_string (buffer
, " [child fn: ");
1723 dump_generic_node (buffer
, gimple_omp_task_child_fn (gs
),
1725 pp_string (buffer
, " (");
1726 if (gimple_omp_task_data_arg (gs
))
1727 dump_generic_node (buffer
, gimple_omp_task_data_arg (gs
),
1730 pp_string (buffer
, "???");
1731 pp_string (buffer
, ")]");
1733 body
= gimple_omp_body (gs
);
1734 if (body
&& gimple_code (gimple_seq_first_stmt (body
)) != GIMPLE_BIND
)
1736 newline_and_indent (buffer
, spc
+ 2);
1737 pp_character (buffer
, '{');
1738 pp_newline (buffer
);
1739 dump_gimple_seq (buffer
, body
, spc
+ 4, flags
);
1740 newline_and_indent (buffer
, spc
+ 2);
1741 pp_character (buffer
, '}');
1745 pp_newline (buffer
);
1746 dump_gimple_seq (buffer
, body
, spc
+ 2, flags
);
1752 /* Dump a GIMPLE_OMP_ATOMIC_LOAD tuple on the pretty_printer BUFFER, SPC
1753 spaces of indent. FLAGS specifies details to show in the dump (see TDF_*
1757 dump_gimple_omp_atomic_load (pretty_printer
*buffer
, gimple gs
, int spc
,
1760 if (flags
& TDF_RAW
)
1762 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %T>", gs
,
1763 gimple_omp_atomic_load_lhs (gs
),
1764 gimple_omp_atomic_load_rhs (gs
));
1768 pp_string (buffer
, "#pragma omp atomic_load");
1769 if (gimple_omp_atomic_need_value_p (gs
))
1770 pp_string (buffer
, " [needed]");
1771 newline_and_indent (buffer
, spc
+ 2);
1772 dump_generic_node (buffer
, gimple_omp_atomic_load_lhs (gs
),
1775 pp_character (buffer
, '=');
1777 pp_character (buffer
, '*');
1778 dump_generic_node (buffer
, gimple_omp_atomic_load_rhs (gs
),
1783 /* Dump a GIMPLE_OMP_ATOMIC_STORE tuple on the pretty_printer BUFFER, SPC
1784 spaces of indent. FLAGS specifies details to show in the dump (see TDF_*
1788 dump_gimple_omp_atomic_store (pretty_printer
*buffer
, gimple gs
, int spc
,
1791 if (flags
& TDF_RAW
)
1793 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
,
1794 gimple_omp_atomic_store_val (gs
));
1798 pp_string (buffer
, "#pragma omp atomic_store ");
1799 if (gimple_omp_atomic_need_value_p (gs
))
1800 pp_string (buffer
, "[needed] ");
1801 pp_character (buffer
, '(');
1802 dump_generic_node (buffer
, gimple_omp_atomic_store_val (gs
),
1804 pp_character (buffer
, ')');
1809 /* Dump all the memory operands for statement GS. BUFFER, SPC and
1810 FLAGS are as in pp_gimple_stmt_1. */
1813 dump_gimple_mem_ops (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1815 tree vdef
= gimple_vdef (gs
);
1816 tree vuse
= gimple_vuse (gs
);
1818 if (!ssa_operands_active (DECL_STRUCT_FUNCTION (current_function_decl
))
1819 || !gimple_references_memory_p (gs
))
1822 if (vdef
!= NULL_TREE
)
1824 pp_string (buffer
, "# ");
1825 dump_generic_node (buffer
, vdef
, spc
+ 2, flags
, false);
1826 pp_string (buffer
, " = VDEF <");
1827 dump_generic_node (buffer
, vuse
, spc
+ 2, flags
, false);
1828 pp_character (buffer
, '>');
1829 newline_and_indent (buffer
, spc
);
1831 else if (vuse
!= NULL_TREE
)
1833 pp_string (buffer
, "# VUSE <");
1834 dump_generic_node (buffer
, vuse
, spc
+ 2, flags
, false);
1835 pp_character (buffer
, '>');
1836 newline_and_indent (buffer
, spc
);
1841 /* Print the gimple statement GS on the pretty printer BUFFER, SPC
1842 spaces of indent. FLAGS specifies details to show in the dump (see
1843 TDF_* in dumpfile.h). The caller is responsible for calling
1844 pp_flush on BUFFER to finalize the pretty printer. */
1847 pp_gimple_stmt_1 (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1852 if (flags
& TDF_STMTADDR
)
1853 pp_printf (buffer
, "<&%p> ", (void *) gs
);
1855 if ((flags
& TDF_LINENO
) && gimple_has_location (gs
))
1857 expanded_location xloc
= expand_location (gimple_location (gs
));
1858 pp_character (buffer
, '[');
1861 pp_string (buffer
, xloc
.file
);
1862 pp_string (buffer
, " : ");
1864 pp_decimal_int (buffer
, xloc
.line
);
1865 pp_string (buffer
, ":");
1866 pp_decimal_int (buffer
, xloc
.column
);
1867 pp_string (buffer
, "] ");
1872 int lp_nr
= lookup_stmt_eh_lp (gs
);
1874 pp_printf (buffer
, "[LP %d] ", lp_nr
);
1876 pp_printf (buffer
, "[MNT %d] ", -lp_nr
);
1879 if ((flags
& (TDF_VOPS
|TDF_MEMSYMS
))
1880 && gimple_has_mem_ops (gs
))
1881 dump_gimple_mem_ops (buffer
, gs
, spc
, flags
);
1883 if ((flags
& TDF_ALIAS
)
1884 && gimple_has_lhs (gs
))
1886 tree lhs
= gimple_get_lhs (gs
);
1887 if (TREE_CODE (lhs
) == SSA_NAME
1888 && POINTER_TYPE_P (TREE_TYPE (lhs
))
1889 && SSA_NAME_PTR_INFO (lhs
))
1891 unsigned int align
, misalign
;
1892 struct ptr_info_def
*pi
= SSA_NAME_PTR_INFO (lhs
);
1893 pp_string (buffer
, "# PT = ");
1894 pp_points_to_solution (buffer
, &pi
->pt
);
1895 newline_and_indent (buffer
, spc
);
1896 if (get_ptr_info_alignment (pi
, &align
, &misalign
))
1898 pp_printf (buffer
, "# ALIGN = %u, MISALIGN = %u",
1900 newline_and_indent (buffer
, spc
);
1905 switch (gimple_code (gs
))
1908 dump_gimple_asm (buffer
, gs
, spc
, flags
);
1912 dump_gimple_assign (buffer
, gs
, spc
, flags
);
1916 dump_gimple_bind (buffer
, gs
, spc
, flags
);
1920 dump_gimple_call (buffer
, gs
, spc
, flags
);
1924 dump_gimple_cond (buffer
, gs
, spc
, flags
);
1928 dump_gimple_label (buffer
, gs
, spc
, flags
);
1932 dump_gimple_goto (buffer
, gs
, spc
, flags
);
1936 pp_string (buffer
, "GIMPLE_NOP");
1940 dump_gimple_return (buffer
, gs
, spc
, flags
);
1944 dump_gimple_switch (buffer
, gs
, spc
, flags
);
1948 dump_gimple_try (buffer
, gs
, spc
, flags
);
1952 dump_gimple_phi (buffer
, gs
, spc
, flags
);
1955 case GIMPLE_OMP_PARALLEL
:
1956 dump_gimple_omp_parallel (buffer
, gs
, spc
, flags
);
1959 case GIMPLE_OMP_TASK
:
1960 dump_gimple_omp_task (buffer
, gs
, spc
, flags
);
1963 case GIMPLE_OMP_ATOMIC_LOAD
:
1964 dump_gimple_omp_atomic_load (buffer
, gs
, spc
, flags
);
1968 case GIMPLE_OMP_ATOMIC_STORE
:
1969 dump_gimple_omp_atomic_store (buffer
, gs
, spc
, flags
);
1972 case GIMPLE_OMP_FOR
:
1973 dump_gimple_omp_for (buffer
, gs
, spc
, flags
);
1976 case GIMPLE_OMP_CONTINUE
:
1977 dump_gimple_omp_continue (buffer
, gs
, spc
, flags
);
1980 case GIMPLE_OMP_SINGLE
:
1981 dump_gimple_omp_single (buffer
, gs
, spc
, flags
);
1984 case GIMPLE_OMP_RETURN
:
1985 dump_gimple_omp_return (buffer
, gs
, spc
, flags
);
1988 case GIMPLE_OMP_SECTIONS
:
1989 dump_gimple_omp_sections (buffer
, gs
, spc
, flags
);
1992 case GIMPLE_OMP_SECTIONS_SWITCH
:
1993 pp_string (buffer
, "GIMPLE_SECTIONS_SWITCH");
1996 case GIMPLE_OMP_MASTER
:
1997 case GIMPLE_OMP_ORDERED
:
1998 case GIMPLE_OMP_SECTION
:
1999 dump_gimple_omp_block (buffer
, gs
, spc
, flags
);
2002 case GIMPLE_OMP_CRITICAL
:
2003 dump_gimple_omp_critical (buffer
, gs
, spc
, flags
);
2007 dump_gimple_catch (buffer
, gs
, spc
, flags
);
2010 case GIMPLE_EH_FILTER
:
2011 dump_gimple_eh_filter (buffer
, gs
, spc
, flags
);
2014 case GIMPLE_EH_MUST_NOT_THROW
:
2015 dump_gimple_eh_must_not_throw (buffer
, gs
, spc
, flags
);
2018 case GIMPLE_EH_ELSE
:
2019 dump_gimple_eh_else (buffer
, gs
, spc
, flags
);
2023 dump_gimple_resx (buffer
, gs
, spc
, flags
);
2026 case GIMPLE_EH_DISPATCH
:
2027 dump_gimple_eh_dispatch (buffer
, gs
, spc
, flags
);
2031 dump_gimple_debug (buffer
, gs
, spc
, flags
);
2034 case GIMPLE_PREDICT
:
2035 pp_string (buffer
, "// predicted ");
2036 if (gimple_predict_outcome (gs
))
2037 pp_string (buffer
, "likely by ");
2039 pp_string (buffer
, "unlikely by ");
2040 pp_string (buffer
, predictor_name (gimple_predict_predictor (gs
)));
2041 pp_string (buffer
, " predictor.");
2044 case GIMPLE_TRANSACTION
:
2045 dump_gimple_transaction (buffer
, gs
, spc
, flags
);
2052 /* If we're building a diagnostic, the formatted text will be
2053 written into BUFFER's stream by the caller; otherwise, write it
2055 if (!(flags
& TDF_DIAGNOSTIC
))
2056 pp_write_text_to_stream (buffer
);
2060 /* Dumps header of basic block BB to OUTF indented by INDENT
2061 spaces and details described by flags. */
2064 dump_gimple_bb_header (FILE *outf
, basic_block bb
, int indent
, int flags
)
2066 if (flags
& TDF_BLOCKS
)
2068 if (flags
& TDF_LINENO
)
2070 gimple_stmt_iterator gsi
;
2071 char *s_indent
= (char *) alloca ((size_t) indent
+ 1);
2072 memset (s_indent
, ' ', (size_t) indent
);
2073 s_indent
[indent
] = '\0';
2075 if (flags
& TDF_COMMENT
)
2076 fputs (";; ", outf
);
2078 for (gsi
= gsi_start_bb (bb
); !gsi_end_p (gsi
); gsi_next (&gsi
))
2079 if (!is_gimple_debug (gsi_stmt (gsi
))
2080 && get_lineno (gsi_stmt (gsi
)) != UNKNOWN_LOCATION
)
2082 fprintf (outf
, "%sstarting at line %d",
2083 s_indent
, get_lineno (gsi_stmt (gsi
)));
2086 if (bb
->discriminator
)
2087 fprintf (outf
, ", discriminator %i", bb
->discriminator
);
2093 gimple stmt
= first_stmt (bb
);
2094 if (!stmt
|| gimple_code (stmt
) != GIMPLE_LABEL
)
2096 char *s_indent
= (char *) alloca ((size_t) indent
- 2 + 1);
2097 memset (s_indent
, ' ', (size_t) indent
);
2098 s_indent
[indent
] = '\0';
2099 fprintf (outf
, "%s<bb %d>:\n", s_indent
, bb
->index
);
2105 /* Dumps end of basic block BB to buffer BUFFER indented by INDENT
2109 dump_gimple_bb_footer (FILE *outf ATTRIBUTE_UNUSED
,
2110 basic_block bb ATTRIBUTE_UNUSED
,
2111 int indent ATTRIBUTE_UNUSED
,
2112 int flags ATTRIBUTE_UNUSED
)
2114 /* There is currently no GIMPLE-specific basic block info to dump. */
2119 /* Dump PHI nodes of basic block BB to BUFFER with details described
2120 by FLAGS and indented by INDENT spaces. */
2123 dump_phi_nodes (pretty_printer
*buffer
, basic_block bb
, int indent
, int flags
)
2125 gimple_stmt_iterator i
;
2127 for (i
= gsi_start_phis (bb
); !gsi_end_p (i
); gsi_next (&i
))
2129 gimple phi
= gsi_stmt (i
);
2130 if (!virtual_operand_p (gimple_phi_result (phi
)) || (flags
& TDF_VOPS
))
2133 pp_string (buffer
, "# ");
2134 dump_gimple_phi (buffer
, phi
, indent
, flags
);
2135 pp_newline (buffer
);
2141 /* Dump jump to basic block BB that is represented implicitly in the cfg
2145 pp_cfg_jump (pretty_printer
*buffer
, basic_block bb
)
2149 stmt
= first_stmt (bb
);
2151 pp_string (buffer
, "goto <bb ");
2152 pp_decimal_int (buffer
, bb
->index
);
2153 pp_character (buffer
, '>');
2154 if (stmt
&& gimple_code (stmt
) == GIMPLE_LABEL
)
2156 pp_string (buffer
, " (");
2157 dump_generic_node (buffer
, gimple_label_label (stmt
), 0, 0, false);
2158 pp_character (buffer
, ')');
2159 pp_semicolon (buffer
);
2162 pp_semicolon (buffer
);
2166 /* Dump edges represented implicitly in basic block BB to BUFFER, indented
2167 by INDENT spaces, with details given by FLAGS. */
2170 dump_implicit_edges (pretty_printer
*buffer
, basic_block bb
, int indent
,
2176 stmt
= last_stmt (bb
);
2178 if (stmt
&& gimple_code (stmt
) == GIMPLE_COND
)
2180 edge true_edge
, false_edge
;
2182 /* When we are emitting the code or changing CFG, it is possible that
2183 the edges are not yet created. When we are using debug_bb in such
2184 a situation, we do not want it to crash. */
2185 if (EDGE_COUNT (bb
->succs
) != 2)
2187 extract_true_false_edges_from_block (bb
, &true_edge
, &false_edge
);
2189 INDENT (indent
+ 2);
2190 pp_cfg_jump (buffer
, true_edge
->dest
);
2191 newline_and_indent (buffer
, indent
);
2192 pp_string (buffer
, "else");
2193 newline_and_indent (buffer
, indent
+ 2);
2194 pp_cfg_jump (buffer
, false_edge
->dest
);
2195 pp_newline (buffer
);
2199 /* If there is a fallthru edge, we may need to add an artificial
2200 goto to the dump. */
2201 e
= find_fallthru_edge (bb
->succs
);
2203 if (e
&& e
->dest
!= bb
->next_bb
)
2207 if ((flags
& TDF_LINENO
)
2208 && e
->goto_locus
!= UNKNOWN_LOCATION
2211 expanded_location goto_xloc
;
2212 goto_xloc
= expand_location (e
->goto_locus
);
2213 pp_character (buffer
, '[');
2216 pp_string (buffer
, goto_xloc
.file
);
2217 pp_string (buffer
, " : ");
2219 pp_decimal_int (buffer
, goto_xloc
.line
);
2220 pp_string (buffer
, " : ");
2221 pp_decimal_int (buffer
, goto_xloc
.column
);
2222 pp_string (buffer
, "] ");
2225 pp_cfg_jump (buffer
, e
->dest
);
2226 pp_newline (buffer
);
2231 /* Dumps basic block BB to buffer BUFFER with details described by FLAGS and
2232 indented by INDENT spaces. */
2235 gimple_dump_bb_buff (pretty_printer
*buffer
, basic_block bb
, int indent
,
2238 gimple_stmt_iterator gsi
;
2240 int label_indent
= indent
- 2;
2242 if (label_indent
< 0)
2245 dump_phi_nodes (buffer
, bb
, indent
, flags
);
2247 for (gsi
= gsi_start_bb (bb
); !gsi_end_p (gsi
); gsi_next (&gsi
))
2251 stmt
= gsi_stmt (gsi
);
2253 curr_indent
= gimple_code (stmt
) == GIMPLE_LABEL
? label_indent
: indent
;
2255 INDENT (curr_indent
);
2256 pp_gimple_stmt_1 (buffer
, stmt
, curr_indent
, flags
);
2257 pp_newline_and_flush (buffer
);
2258 gcc_checking_assert (DECL_STRUCT_FUNCTION (current_function_decl
));
2259 dump_histograms_for_stmt (DECL_STRUCT_FUNCTION (current_function_decl
),
2260 buffer
->buffer
->stream
, stmt
);
2263 dump_implicit_edges (buffer
, bb
, indent
, flags
);
2268 /* Dumps basic block BB to FILE with details described by FLAGS and
2269 indented by INDENT spaces. */
2272 gimple_dump_bb (FILE *file
, basic_block bb
, int indent
, int flags
)
2274 dump_gimple_bb_header (file
, bb
, indent
, flags
);
2275 if (bb
->index
>= NUM_FIXED_BLOCKS
)
2277 maybe_init_pretty_print (file
);
2278 gimple_dump_bb_buff (&buffer
, bb
, indent
, flags
);
2280 dump_gimple_bb_footer (file
, bb
, indent
, flags
);