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 "tree-pretty-print.h"
30 #include "gimple-pretty-print.h"
32 #include "tree-flow.h"
33 #include "tree-pass.h"
35 #include "value-prof.h"
36 #include "trans-mem.h"
38 #define INDENT(SPACE) \
39 do { int i; for (i = 0; i < SPACE; i++) pp_space (buffer); } while (0)
41 static pretty_printer buffer
;
42 static bool initialized
= false;
44 #define GIMPLE_NIY do_niy (buffer,gs)
46 /* Try to print on BUFFER a default message for the unrecognized
47 gimple statement GS. */
50 do_niy (pretty_printer
*buffer
, gimple gs
)
52 pp_printf (buffer
, "<<< Unknown GIMPLE statement: %s >>>\n",
53 gimple_code_name
[(int) gimple_code (gs
)]);
57 /* Initialize the pretty printer on FILE if needed. */
60 maybe_init_pretty_print (FILE *file
)
64 pp_construct (&buffer
, NULL
, 0);
65 pp_needs_newline (&buffer
) = true;
69 buffer
.buffer
->stream
= file
;
73 /* Emit a newline and SPC indentantion spaces to BUFFER. */
76 newline_and_indent (pretty_printer
*buffer
, int spc
)
83 /* Print the GIMPLE statement GS on stderr. */
86 debug_gimple_stmt (gimple gs
)
88 print_gimple_stmt (stderr
, gs
, 0, TDF_VOPS
|TDF_MEMSYMS
);
89 fprintf (stderr
, "\n");
93 /* Dump GIMPLE statement G to FILE using SPC indentantion spaces and
94 FLAGS as in dump_gimple_stmt. */
97 print_gimple_stmt (FILE *file
, gimple g
, int spc
, int flags
)
99 maybe_init_pretty_print (file
);
100 dump_gimple_stmt (&buffer
, g
, spc
, flags
);
105 /* Dump GIMPLE statement G to FILE using SPC indentantion spaces and
106 FLAGS as in dump_gimple_stmt. Print only the right-hand side
110 print_gimple_expr (FILE *file
, gimple g
, int spc
, int flags
)
112 flags
|= TDF_RHS_ONLY
;
113 maybe_init_pretty_print (file
);
114 dump_gimple_stmt (&buffer
, g
, spc
, flags
);
118 /* Print the GIMPLE sequence SEQ on BUFFER using SPC indentantion
119 spaces and FLAGS as in dump_gimple_stmt. */
122 dump_gimple_seq (pretty_printer
*buffer
, gimple_seq seq
, int spc
, int flags
)
124 gimple_stmt_iterator i
;
126 for (i
= gsi_start (seq
); !gsi_end_p (i
); gsi_next (&i
))
128 gimple gs
= gsi_stmt (i
);
130 dump_gimple_stmt (buffer
, gs
, spc
, flags
);
131 if (!gsi_one_before_end_p (i
))
137 /* Dump GIMPLE sequence SEQ to FILE using SPC indentantion spaces and
138 FLAGS as in dump_gimple_stmt. */
141 print_gimple_seq (FILE *file
, gimple_seq seq
, int spc
, int flags
)
143 maybe_init_pretty_print (file
);
144 dump_gimple_seq (&buffer
, seq
, spc
, flags
);
149 /* Print the GIMPLE sequence SEQ on stderr. */
152 debug_gimple_seq (gimple_seq seq
)
154 print_gimple_seq (stderr
, seq
, 0, TDF_VOPS
|TDF_MEMSYMS
);
158 /* A simple helper to pretty-print some of the gimple tuples in the printf
159 style. The format modifiers are preceeded by '%' and are:
160 'G' - outputs a string corresponding to the code of the given gimple,
161 'S' - outputs a gimple_seq with indent of spc + 2,
162 'T' - outputs the tree t,
163 'd' - outputs an int as a decimal,
164 's' - outputs a string,
165 'n' - outputs a newline,
166 'x' - outputs an int as hexadecimal,
167 '+' - increases indent by 2 then outputs a newline,
168 '-' - decreases indent by 2 then outputs a newline. */
171 dump_gimple_fmt (pretty_printer
*buffer
, int spc
, int flags
,
172 const char *fmt
, ...)
178 va_start (args
, fmt
);
179 for (c
= fmt
; *c
; c
++)
189 g
= va_arg (args
, gimple
);
190 tmp
= gimple_code_name
[gimple_code (g
)];
191 pp_string (buffer
, tmp
);
195 seq
= va_arg (args
, gimple_seq
);
197 dump_gimple_seq (buffer
, seq
, spc
+ 2, flags
);
198 newline_and_indent (buffer
, spc
);
202 t
= va_arg (args
, tree
);
204 pp_string (buffer
, "NULL");
206 dump_generic_node (buffer
, t
, spc
, flags
, false);
210 pp_decimal_int (buffer
, va_arg (args
, int));
214 pp_string (buffer
, va_arg (args
, char *));
218 newline_and_indent (buffer
, spc
);
222 pp_scalar (buffer
, "%x", va_arg (args
, int));
227 newline_and_indent (buffer
, spc
);
232 newline_and_indent (buffer
, spc
);
240 pp_character (buffer
, *c
);
246 /* Helper for dump_gimple_assign. Print the unary RHS of the
247 assignment GS. BUFFER, SPC and FLAGS are as in dump_gimple_stmt. */
250 dump_unary_rhs (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
252 enum tree_code rhs_code
= gimple_assign_rhs_code (gs
);
253 tree lhs
= gimple_assign_lhs (gs
);
254 tree rhs
= gimple_assign_rhs1 (gs
);
258 case VIEW_CONVERT_EXPR
:
260 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
263 case FIXED_CONVERT_EXPR
:
264 case ADDR_SPACE_CONVERT_EXPR
:
268 pp_character (buffer
, '(');
269 dump_generic_node (buffer
, TREE_TYPE (lhs
), spc
, flags
, false);
270 pp_string (buffer
, ") ");
271 if (op_prio (rhs
) < op_code_prio (rhs_code
))
273 pp_character (buffer
, '(');
274 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
275 pp_character (buffer
, ')');
278 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
282 pp_string (buffer
, "((");
283 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
284 pp_string (buffer
, "))");
288 pp_string (buffer
, "ABS_EXPR <");
289 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
290 pp_character (buffer
, '>');
294 if (TREE_CODE_CLASS (rhs_code
) == tcc_declaration
295 || TREE_CODE_CLASS (rhs_code
) == tcc_constant
296 || TREE_CODE_CLASS (rhs_code
) == tcc_reference
297 || rhs_code
== SSA_NAME
298 || rhs_code
== ADDR_EXPR
299 || rhs_code
== CONSTRUCTOR
)
301 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
304 else if (rhs_code
== BIT_NOT_EXPR
)
305 pp_character (buffer
, '~');
306 else if (rhs_code
== TRUTH_NOT_EXPR
)
307 pp_character (buffer
, '!');
308 else if (rhs_code
== NEGATE_EXPR
)
309 pp_character (buffer
, '-');
312 pp_character (buffer
, '[');
313 pp_string (buffer
, tree_code_name
[rhs_code
]);
314 pp_string (buffer
, "] ");
317 if (op_prio (rhs
) < op_code_prio (rhs_code
))
319 pp_character (buffer
, '(');
320 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
321 pp_character (buffer
, ')');
324 dump_generic_node (buffer
, rhs
, spc
, flags
, false);
330 /* Helper for dump_gimple_assign. Print the binary RHS of the
331 assignment GS. BUFFER, SPC and FLAGS are as in dump_gimple_stmt. */
334 dump_binary_rhs (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
337 enum tree_code code
= gimple_assign_rhs_code (gs
);
343 case VEC_WIDEN_MULT_HI_EXPR
:
344 case VEC_WIDEN_MULT_LO_EXPR
:
345 case VEC_PACK_TRUNC_EXPR
:
346 case VEC_PACK_SAT_EXPR
:
347 case VEC_PACK_FIX_TRUNC_EXPR
:
348 case VEC_WIDEN_LSHIFT_HI_EXPR
:
349 case VEC_WIDEN_LSHIFT_LO_EXPR
:
350 for (p
= tree_code_name
[(int) code
]; *p
; p
++)
351 pp_character (buffer
, TOUPPER (*p
));
352 pp_string (buffer
, " <");
353 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
354 pp_string (buffer
, ", ");
355 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
356 pp_character (buffer
, '>');
360 if (op_prio (gimple_assign_rhs1 (gs
)) <= op_code_prio (code
))
362 pp_character (buffer
, '(');
363 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
,
365 pp_character (buffer
, ')');
368 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
370 pp_string (buffer
, op_symbol_code (gimple_assign_rhs_code (gs
)));
372 if (op_prio (gimple_assign_rhs2 (gs
)) <= op_code_prio (code
))
374 pp_character (buffer
, '(');
375 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
,
377 pp_character (buffer
, ')');
380 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
384 /* Helper for dump_gimple_assign. Print the ternary RHS of the
385 assignment GS. BUFFER, SPC and FLAGS are as in dump_gimple_stmt. */
388 dump_ternary_rhs (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
391 enum tree_code code
= gimple_assign_rhs_code (gs
);
394 case WIDEN_MULT_PLUS_EXPR
:
395 case WIDEN_MULT_MINUS_EXPR
:
396 for (p
= tree_code_name
[(int) code
]; *p
; p
++)
397 pp_character (buffer
, TOUPPER (*p
));
398 pp_string (buffer
, " <");
399 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
400 pp_string (buffer
, ", ");
401 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
402 pp_string (buffer
, ", ");
403 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
404 pp_character (buffer
, '>');
408 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
409 pp_string (buffer
, " * ");
410 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
411 pp_string (buffer
, " + ");
412 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
416 pp_string (buffer
, "DOT_PROD_EXPR <");
417 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
418 pp_string (buffer
, ", ");
419 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
420 pp_string (buffer
, ", ");
421 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
422 pp_string (buffer
, ">");
426 pp_string (buffer
, "VEC_PERM_EXPR <");
427 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
428 pp_string (buffer
, ", ");
429 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
430 pp_string (buffer
, ", ");
431 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
432 pp_string (buffer
, ">");
435 case REALIGN_LOAD_EXPR
:
436 pp_string (buffer
, "REALIGN_LOAD <");
437 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
438 pp_string (buffer
, ", ");
439 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
440 pp_string (buffer
, ", ");
441 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
442 pp_string (buffer
, ">");
446 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
447 pp_string (buffer
, " ? ");
448 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
449 pp_string (buffer
, " : ");
450 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
454 pp_string (buffer
, "VEC_COND_EXPR <");
455 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
456 pp_string (buffer
, ", ");
457 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
458 pp_string (buffer
, ", ");
459 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
460 pp_string (buffer
, ">");
469 /* Dump the gimple assignment GS. BUFFER, SPC and FLAGS are as in
473 dump_gimple_assign (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
478 if (gimple_num_ops (gs
) == 2)
480 else if (gimple_num_ops (gs
) == 3)
481 last
= gimple_assign_rhs2 (gs
);
485 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%s, %T, %T, %T>", gs
,
486 tree_code_name
[gimple_assign_rhs_code (gs
)],
487 gimple_assign_lhs (gs
), gimple_assign_rhs1 (gs
), last
);
491 if (!(flags
& TDF_RHS_ONLY
))
493 dump_generic_node (buffer
, gimple_assign_lhs (gs
), spc
, flags
, false);
495 pp_character (buffer
, '=');
497 if (gimple_assign_nontemporal_move_p (gs
))
498 pp_string (buffer
, "{nt}");
500 if (gimple_has_volatile_ops (gs
))
501 pp_string (buffer
, "{v}");
506 if (gimple_num_ops (gs
) == 2)
507 dump_unary_rhs (buffer
, gs
, spc
, flags
);
508 else if (gimple_num_ops (gs
) == 3)
509 dump_binary_rhs (buffer
, gs
, spc
, flags
);
510 else if (gimple_num_ops (gs
) == 4)
511 dump_ternary_rhs (buffer
, gs
, spc
, flags
);
514 if (!(flags
& TDF_RHS_ONLY
))
515 pp_semicolon(buffer
);
520 /* Dump the return statement GS. BUFFER, SPC and FLAGS are as in
524 dump_gimple_return (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
528 t
= gimple_return_retval (gs
);
530 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
, t
);
533 pp_string (buffer
, "return");
537 dump_generic_node (buffer
, t
, spc
, flags
, false);
539 pp_semicolon (buffer
);
544 /* Dump the call arguments for a gimple call. BUFFER, FLAGS are as in
548 dump_gimple_call_args (pretty_printer
*buffer
, gimple gs
, int flags
)
552 for (i
= 0; i
< gimple_call_num_args (gs
); i
++)
554 dump_generic_node (buffer
, gimple_call_arg (gs
, i
), 0, flags
, false);
555 if (i
< gimple_call_num_args (gs
) - 1)
556 pp_string (buffer
, ", ");
559 if (gimple_call_va_arg_pack_p (gs
))
561 if (gimple_call_num_args (gs
) > 0)
563 pp_character (buffer
, ',');
567 pp_string (buffer
, "__builtin_va_arg_pack ()");
571 /* Dump the points-to solution *PT to BUFFER. */
574 pp_points_to_solution (pretty_printer
*buffer
, struct pt_solution
*pt
)
578 pp_string (buffer
, "anything ");
582 pp_string (buffer
, "nonlocal ");
584 pp_string (buffer
, "escaped ");
586 pp_string (buffer
, "unit-escaped ");
588 pp_string (buffer
, "null ");
590 && !bitmap_empty_p (pt
->vars
))
594 pp_string (buffer
, "{ ");
595 EXECUTE_IF_SET_IN_BITMAP (pt
->vars
, 0, i
, bi
)
597 tree var
= referenced_var_lookup (cfun
, i
);
600 dump_generic_node (buffer
, var
, 0, dump_flags
, false);
601 if (DECL_PT_UID (var
) != DECL_UID (var
))
603 pp_string (buffer
, "ptD.");
604 pp_decimal_int (buffer
, DECL_PT_UID (var
));
609 pp_string (buffer
, "D.");
610 pp_decimal_int (buffer
, i
);
612 pp_character (buffer
, ' ');
614 pp_character (buffer
, '}');
615 if (pt
->vars_contains_global
)
616 pp_string (buffer
, " (glob)");
620 /* Dump the call statement GS. BUFFER, SPC and FLAGS are as in
624 dump_gimple_call (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
626 tree lhs
= gimple_call_lhs (gs
);
627 tree fn
= gimple_call_fn (gs
);
629 if (flags
& TDF_ALIAS
)
631 struct pt_solution
*pt
;
632 pt
= gimple_call_use_set (gs
);
633 if (!pt_solution_empty_p (pt
))
635 pp_string (buffer
, "# USE = ");
636 pp_points_to_solution (buffer
, pt
);
637 newline_and_indent (buffer
, spc
);
639 pt
= gimple_call_clobber_set (gs
);
640 if (!pt_solution_empty_p (pt
))
642 pp_string (buffer
, "# CLB = ");
643 pp_points_to_solution (buffer
, pt
);
644 newline_and_indent (buffer
, spc
);
650 if (gimple_call_internal_p (gs
))
651 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%s, %T", gs
,
652 internal_fn_name (gimple_call_internal_fn (gs
)), lhs
);
654 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %T", gs
, fn
, lhs
);
655 if (gimple_call_num_args (gs
) > 0)
657 pp_string (buffer
, ", ");
658 dump_gimple_call_args (buffer
, gs
, flags
);
660 pp_character (buffer
, '>');
664 if (lhs
&& !(flags
& TDF_RHS_ONLY
))
666 dump_generic_node (buffer
, lhs
, spc
, flags
, false);
667 pp_string (buffer
, " =");
669 if (gimple_has_volatile_ops (gs
))
670 pp_string (buffer
, "{v}");
674 if (gimple_call_internal_p (gs
))
675 pp_string (buffer
, internal_fn_name (gimple_call_internal_fn (gs
)));
677 print_call_name (buffer
, fn
, flags
);
678 pp_string (buffer
, " (");
679 dump_gimple_call_args (buffer
, gs
, flags
);
680 pp_character (buffer
, ')');
681 if (!(flags
& TDF_RHS_ONLY
))
682 pp_semicolon (buffer
);
685 if (gimple_call_chain (gs
))
687 pp_string (buffer
, " [static-chain: ");
688 dump_generic_node (buffer
, gimple_call_chain (gs
), spc
, flags
, false);
689 pp_character (buffer
, ']');
692 if (gimple_call_return_slot_opt_p (gs
))
693 pp_string (buffer
, " [return slot optimization]");
694 if (gimple_call_tail_p (gs
))
695 pp_string (buffer
, " [tail call]");
700 /* Dump the arguments of _ITM_beginTransaction sanely. */
701 if (TREE_CODE (fn
) == ADDR_EXPR
)
702 fn
= TREE_OPERAND (fn
, 0);
703 if (TREE_CODE (fn
) == FUNCTION_DECL
&& decl_is_tm_clone (fn
))
704 pp_string (buffer
, " [tm-clone]");
705 if (TREE_CODE (fn
) == FUNCTION_DECL
706 && DECL_BUILT_IN_CLASS (fn
) == BUILT_IN_NORMAL
707 && DECL_FUNCTION_CODE (fn
) == BUILT_IN_TM_START
708 && gimple_call_num_args (gs
) > 0)
710 tree t
= gimple_call_arg (gs
, 0);
711 unsigned HOST_WIDE_INT props
;
712 gcc_assert (TREE_CODE (t
) == INTEGER_CST
);
714 pp_string (buffer
, " [ ");
716 /* Get the transaction code properties. */
717 props
= TREE_INT_CST_LOW (t
);
719 if (props
& PR_INSTRUMENTEDCODE
)
720 pp_string (buffer
, "instrumentedCode ");
721 if (props
& PR_UNINSTRUMENTEDCODE
)
722 pp_string (buffer
, "uninstrumentedCode ");
723 if (props
& PR_HASNOXMMUPDATE
)
724 pp_string (buffer
, "hasNoXMMUpdate ");
725 if (props
& PR_HASNOABORT
)
726 pp_string (buffer
, "hasNoAbort ");
727 if (props
& PR_HASNOIRREVOCABLE
)
728 pp_string (buffer
, "hasNoIrrevocable ");
729 if (props
& PR_DOESGOIRREVOCABLE
)
730 pp_string (buffer
, "doesGoIrrevocable ");
731 if (props
& PR_HASNOSIMPLEREADS
)
732 pp_string (buffer
, "hasNoSimpleReads ");
733 if (props
& PR_AWBARRIERSOMITTED
)
734 pp_string (buffer
, "awBarriersOmitted ");
735 if (props
& PR_RARBARRIERSOMITTED
)
736 pp_string (buffer
, "RaRBarriersOmitted ");
737 if (props
& PR_UNDOLOGCODE
)
738 pp_string (buffer
, "undoLogCode ");
739 if (props
& PR_PREFERUNINSTRUMENTED
)
740 pp_string (buffer
, "preferUninstrumented ");
741 if (props
& PR_EXCEPTIONBLOCK
)
742 pp_string (buffer
, "exceptionBlock ");
743 if (props
& PR_HASELSE
)
744 pp_string (buffer
, "hasElse ");
745 if (props
& PR_READONLY
)
746 pp_string (buffer
, "readOnly ");
748 pp_string (buffer
, "]");
753 /* Dump the switch statement GS. BUFFER, SPC and FLAGS are as in
757 dump_gimple_switch (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
761 GIMPLE_CHECK (gs
, GIMPLE_SWITCH
);
763 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, ", gs
,
764 gimple_switch_index (gs
));
767 pp_string (buffer
, "switch (");
768 dump_generic_node (buffer
, gimple_switch_index (gs
), spc
, flags
, true);
769 pp_string (buffer
, ") <");
772 for (i
= 0; i
< gimple_switch_num_labels (gs
); i
++)
774 tree case_label
= gimple_switch_label (gs
, i
);
775 if (case_label
== NULL_TREE
)
778 dump_generic_node (buffer
, case_label
, spc
, flags
, false);
779 pp_character (buffer
, ' ');
780 dump_generic_node (buffer
, CASE_LABEL (case_label
), spc
, flags
, false);
781 if (i
< gimple_switch_num_labels (gs
) - 1)
782 pp_string (buffer
, ", ");
784 pp_character (buffer
, '>');
788 /* Dump the gimple conditional GS. BUFFER, SPC and FLAGS are as in
792 dump_gimple_cond (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
795 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%s, %T, %T, %T, %T>", gs
,
796 tree_code_name
[gimple_cond_code (gs
)],
797 gimple_cond_lhs (gs
), gimple_cond_rhs (gs
),
798 gimple_cond_true_label (gs
), gimple_cond_false_label (gs
));
801 if (!(flags
& TDF_RHS_ONLY
))
802 pp_string (buffer
, "if (");
803 dump_generic_node (buffer
, gimple_cond_lhs (gs
), spc
, flags
, false);
805 pp_string (buffer
, op_symbol_code (gimple_cond_code (gs
)));
807 dump_generic_node (buffer
, gimple_cond_rhs (gs
), spc
, flags
, false);
808 if (!(flags
& TDF_RHS_ONLY
))
810 pp_character (buffer
, ')');
812 if (gimple_cond_true_label (gs
))
814 pp_string (buffer
, " goto ");
815 dump_generic_node (buffer
, gimple_cond_true_label (gs
),
817 pp_semicolon (buffer
);
819 if (gimple_cond_false_label (gs
))
821 pp_string (buffer
, " else goto ");
822 dump_generic_node (buffer
, gimple_cond_false_label (gs
),
824 pp_semicolon (buffer
);
831 /* Dump a GIMPLE_LABEL tuple on the pretty_printer BUFFER, SPC
832 spaces of indent. FLAGS specifies details to show in the dump (see
833 TDF_* in tree-pass.h). */
836 dump_gimple_label (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
838 tree label
= gimple_label_label (gs
);
840 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
, label
);
843 dump_generic_node (buffer
, label
, spc
, flags
, false);
844 pp_character (buffer
, ':');
846 if (DECL_NONLOCAL (label
))
847 pp_string (buffer
, " [non-local]");
848 if ((flags
& TDF_EH
) && EH_LANDING_PAD_NR (label
))
849 pp_printf (buffer
, " [LP %d]", EH_LANDING_PAD_NR (label
));
852 /* Dump a GIMPLE_GOTO tuple on the pretty_printer BUFFER, SPC
853 spaces of indent. FLAGS specifies details to show in the dump (see
854 TDF_* in tree-pass.h). */
857 dump_gimple_goto (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
859 tree label
= gimple_goto_dest (gs
);
861 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
, label
);
863 dump_gimple_fmt (buffer
, spc
, flags
, "goto %T;", label
);
867 /* Dump a GIMPLE_BIND tuple on the pretty_printer BUFFER, SPC
868 spaces of indent. FLAGS specifies details to show in the dump (see
869 TDF_* in tree-pass.h). */
872 dump_gimple_bind (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
875 dump_gimple_fmt (buffer
, spc
, flags
, "%G <", gs
);
877 pp_character (buffer
, '{');
878 if (!(flags
& TDF_SLIM
))
882 for (var
= gimple_bind_vars (gs
); var
; var
= DECL_CHAIN (var
))
884 newline_and_indent (buffer
, 2);
885 print_declaration (buffer
, var
, spc
, flags
);
887 if (gimple_bind_vars (gs
))
891 dump_gimple_seq (buffer
, gimple_bind_body (gs
), spc
+ 2, flags
);
892 newline_and_indent (buffer
, spc
);
894 pp_character (buffer
, '>');
896 pp_character (buffer
, '}');
900 /* Dump a GIMPLE_TRY tuple on the pretty_printer BUFFER, SPC spaces of
901 indent. FLAGS specifies details to show in the dump (see TDF_* in
905 dump_gimple_try (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
910 if (gimple_try_kind (gs
) == GIMPLE_TRY_CATCH
)
911 type
= "GIMPLE_TRY_CATCH";
912 else if (gimple_try_kind (gs
) == GIMPLE_TRY_FINALLY
)
913 type
= "GIMPLE_TRY_FINALLY";
915 type
= "UNKNOWN GIMPLE_TRY";
916 dump_gimple_fmt (buffer
, spc
, flags
,
917 "%G <%s,%+EVAL <%S>%nCLEANUP <%S>%->", gs
, type
,
918 gimple_try_eval (gs
), gimple_try_cleanup (gs
));
922 pp_string (buffer
, "try");
923 newline_and_indent (buffer
, spc
+ 2);
924 pp_character (buffer
, '{');
927 dump_gimple_seq (buffer
, gimple_try_eval (gs
), spc
+ 4, flags
);
928 newline_and_indent (buffer
, spc
+ 2);
929 pp_character (buffer
, '}');
931 if (gimple_try_kind (gs
) == GIMPLE_TRY_CATCH
)
933 newline_and_indent (buffer
, spc
);
934 pp_string (buffer
, "catch");
935 newline_and_indent (buffer
, spc
+ 2);
936 pp_character (buffer
, '{');
938 else if (gimple_try_kind (gs
) == GIMPLE_TRY_FINALLY
)
940 newline_and_indent (buffer
, spc
);
941 pp_string (buffer
, "finally");
942 newline_and_indent (buffer
, spc
+ 2);
943 pp_character (buffer
, '{');
946 pp_string (buffer
, " <UNKNOWN GIMPLE_TRY> {");
949 dump_gimple_seq (buffer
, gimple_try_cleanup (gs
), spc
+ 4, flags
);
950 newline_and_indent (buffer
, spc
+ 2);
951 pp_character (buffer
, '}');
956 /* Dump a GIMPLE_CATCH tuple on the pretty_printer BUFFER, SPC spaces of
957 indent. FLAGS specifies details to show in the dump (see TDF_* in
961 dump_gimple_catch (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
964 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %+CATCH <%S>%->", gs
,
965 gimple_catch_types (gs
), gimple_catch_handler (gs
));
967 dump_gimple_fmt (buffer
, spc
, flags
, "catch (%T)%+{%S}",
968 gimple_catch_types (gs
), gimple_catch_handler (gs
));
972 /* Dump a GIMPLE_EH_FILTER tuple on the pretty_printer BUFFER, SPC spaces of
973 indent. FLAGS specifies details to show in the dump (see TDF_* in
977 dump_gimple_eh_filter (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
980 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %+FAILURE <%S>%->", gs
,
981 gimple_eh_filter_types (gs
),
982 gimple_eh_filter_failure (gs
));
984 dump_gimple_fmt (buffer
, spc
, flags
, "<<<eh_filter (%T)>>>%+{%+%S%-}",
985 gimple_eh_filter_types (gs
),
986 gimple_eh_filter_failure (gs
));
990 /* Dump a GIMPLE_EH_MUST_NOT_THROW tuple. */
993 dump_gimple_eh_must_not_throw (pretty_printer
*buffer
, gimple gs
,
997 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
,
998 gimple_eh_must_not_throw_fndecl (gs
));
1000 dump_gimple_fmt (buffer
, spc
, flags
, "<<<eh_must_not_throw (%T)>>>",
1001 gimple_eh_must_not_throw_fndecl (gs
));
1005 /* Dump a GIMPLE_EH_ELSE tuple on the pretty_printer BUFFER, SPC spaces of
1006 indent. FLAGS specifies details to show in the dump (see TDF_* in
1010 dump_gimple_eh_else (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1012 if (flags
& TDF_RAW
)
1013 dump_gimple_fmt (buffer
, spc
, flags
,
1014 "%G <%+N_BODY <%S>%nE_BODY <%S>%->", gs
,
1015 gimple_eh_else_n_body (gs
), gimple_eh_else_e_body (gs
));
1017 dump_gimple_fmt (buffer
, spc
, flags
,
1018 "<<<if_normal_exit>>>%+{%S}%-<<<else_eh_exit>>>%+{%S}",
1019 gimple_eh_else_n_body (gs
), gimple_eh_else_e_body (gs
));
1023 /* Dump a GIMPLE_RESX tuple on the pretty_printer BUFFER, SPC spaces of
1024 indent. FLAGS specifies details to show in the dump (see TDF_* in
1028 dump_gimple_resx (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1030 if (flags
& TDF_RAW
)
1031 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%d>", gs
,
1032 gimple_resx_region (gs
));
1034 dump_gimple_fmt (buffer
, spc
, flags
, "resx %d", gimple_resx_region (gs
));
1037 /* Dump a GIMPLE_EH_DISPATCH tuple on the pretty_printer BUFFER. */
1040 dump_gimple_eh_dispatch (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1042 if (flags
& TDF_RAW
)
1043 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%d>", gs
,
1044 gimple_eh_dispatch_region (gs
));
1046 dump_gimple_fmt (buffer
, spc
, flags
, "eh_dispatch %d",
1047 gimple_eh_dispatch_region (gs
));
1050 /* Dump a GIMPLE_DEBUG tuple on the pretty_printer BUFFER, SPC spaces
1051 of indent. FLAGS specifies details to show in the dump (see TDF_*
1055 dump_gimple_debug (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1057 switch (gs
->gsbase
.subcode
)
1059 case GIMPLE_DEBUG_BIND
:
1060 if (flags
& TDF_RAW
)
1061 dump_gimple_fmt (buffer
, spc
, flags
, "%G BIND <%T, %T>", gs
,
1062 gimple_debug_bind_get_var (gs
),
1063 gimple_debug_bind_get_value (gs
));
1065 dump_gimple_fmt (buffer
, spc
, flags
, "# DEBUG %T => %T",
1066 gimple_debug_bind_get_var (gs
),
1067 gimple_debug_bind_get_value (gs
));
1070 case GIMPLE_DEBUG_SOURCE_BIND
:
1071 if (flags
& TDF_RAW
)
1072 dump_gimple_fmt (buffer
, spc
, flags
, "%G SRCBIND <%T, %T>", gs
,
1073 gimple_debug_source_bind_get_var (gs
),
1074 gimple_debug_source_bind_get_value (gs
));
1076 dump_gimple_fmt (buffer
, spc
, flags
, "# DEBUG %T s=> %T",
1077 gimple_debug_source_bind_get_var (gs
),
1078 gimple_debug_source_bind_get_value (gs
));
1086 /* Dump a GIMPLE_OMP_FOR tuple on the pretty_printer BUFFER. */
1088 dump_gimple_omp_for (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1092 if (flags
& TDF_RAW
)
1094 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1095 gimple_omp_body (gs
));
1096 dump_omp_clauses (buffer
, gimple_omp_for_clauses (gs
), spc
, flags
);
1097 dump_gimple_fmt (buffer
, spc
, flags
, " >,");
1098 for (i
= 0; i
< gimple_omp_for_collapse (gs
); i
++)
1099 dump_gimple_fmt (buffer
, spc
, flags
,
1100 "%+%T, %T, %T, %s, %T,%n",
1101 gimple_omp_for_index (gs
, i
),
1102 gimple_omp_for_initial (gs
, i
),
1103 gimple_omp_for_final (gs
, i
),
1104 tree_code_name
[gimple_omp_for_cond (gs
, i
)],
1105 gimple_omp_for_incr (gs
, i
));
1106 dump_gimple_fmt (buffer
, spc
, flags
, "PRE_BODY <%S>%->",
1107 gimple_omp_for_pre_body (gs
));
1111 pp_string (buffer
, "#pragma omp for");
1112 dump_omp_clauses (buffer
, gimple_omp_for_clauses (gs
), spc
, flags
);
1113 for (i
= 0; i
< gimple_omp_for_collapse (gs
); i
++)
1117 newline_and_indent (buffer
, spc
);
1118 pp_string (buffer
, "for (");
1119 dump_generic_node (buffer
, gimple_omp_for_index (gs
, i
), spc
,
1121 pp_string (buffer
, " = ");
1122 dump_generic_node (buffer
, gimple_omp_for_initial (gs
, i
), spc
,
1124 pp_string (buffer
, "; ");
1126 dump_generic_node (buffer
, gimple_omp_for_index (gs
, i
), spc
,
1129 switch (gimple_omp_for_cond (gs
, i
))
1132 pp_character (buffer
, '<');
1135 pp_character (buffer
, '>');
1138 pp_string (buffer
, "<=");
1141 pp_string (buffer
, ">=");
1147 dump_generic_node (buffer
, gimple_omp_for_final (gs
, i
), spc
,
1149 pp_string (buffer
, "; ");
1151 dump_generic_node (buffer
, gimple_omp_for_index (gs
, i
), spc
,
1153 pp_string (buffer
, " = ");
1154 dump_generic_node (buffer
, gimple_omp_for_incr (gs
, i
), spc
,
1156 pp_character (buffer
, ')');
1159 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1161 newline_and_indent (buffer
, spc
+ 2);
1162 pp_character (buffer
, '{');
1163 pp_newline (buffer
);
1164 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1165 newline_and_indent (buffer
, spc
+ 2);
1166 pp_character (buffer
, '}');
1171 /* Dump a GIMPLE_OMP_CONTINUE tuple on the pretty_printer BUFFER. */
1174 dump_gimple_omp_continue (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1176 if (flags
& TDF_RAW
)
1178 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %T>", gs
,
1179 gimple_omp_continue_control_def (gs
),
1180 gimple_omp_continue_control_use (gs
));
1184 pp_string (buffer
, "#pragma omp continue (");
1185 dump_generic_node (buffer
, gimple_omp_continue_control_def (gs
),
1187 pp_character (buffer
, ',');
1189 dump_generic_node (buffer
, gimple_omp_continue_control_use (gs
),
1191 pp_character (buffer
, ')');
1195 /* Dump a GIMPLE_OMP_SINGLE tuple on the pretty_printer BUFFER. */
1198 dump_gimple_omp_single (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1200 if (flags
& TDF_RAW
)
1202 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1203 gimple_omp_body (gs
));
1204 dump_omp_clauses (buffer
, gimple_omp_single_clauses (gs
), spc
, flags
);
1205 dump_gimple_fmt (buffer
, spc
, flags
, " >");
1209 pp_string (buffer
, "#pragma omp single");
1210 dump_omp_clauses (buffer
, gimple_omp_single_clauses (gs
), spc
, flags
);
1211 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1213 newline_and_indent (buffer
, spc
+ 2);
1214 pp_character (buffer
, '{');
1215 pp_newline (buffer
);
1216 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1217 newline_and_indent (buffer
, spc
+ 2);
1218 pp_character (buffer
, '}');
1223 /* Dump a GIMPLE_OMP_SECTIONS tuple on the pretty_printer BUFFER. */
1226 dump_gimple_omp_sections (pretty_printer
*buffer
, gimple gs
, int spc
,
1229 if (flags
& TDF_RAW
)
1231 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1232 gimple_omp_body (gs
));
1233 dump_omp_clauses (buffer
, gimple_omp_sections_clauses (gs
), spc
, flags
);
1234 dump_gimple_fmt (buffer
, spc
, flags
, " >");
1238 pp_string (buffer
, "#pragma omp sections");
1239 if (gimple_omp_sections_control (gs
))
1241 pp_string (buffer
, " <");
1242 dump_generic_node (buffer
, gimple_omp_sections_control (gs
), spc
,
1244 pp_character (buffer
, '>');
1246 dump_omp_clauses (buffer
, gimple_omp_sections_clauses (gs
), spc
, flags
);
1247 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1249 newline_and_indent (buffer
, spc
+ 2);
1250 pp_character (buffer
, '{');
1251 pp_newline (buffer
);
1252 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1253 newline_and_indent (buffer
, spc
+ 2);
1254 pp_character (buffer
, '}');
1259 /* Dump a GIMPLE_OMP_{MASTER,ORDERED,SECTION} tuple on the pretty_printer
1263 dump_gimple_omp_block (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1265 if (flags
& TDF_RAW
)
1266 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S> >", gs
,
1267 gimple_omp_body (gs
));
1270 switch (gimple_code (gs
))
1272 case GIMPLE_OMP_MASTER
:
1273 pp_string (buffer
, "#pragma omp master");
1275 case GIMPLE_OMP_ORDERED
:
1276 pp_string (buffer
, "#pragma omp ordered");
1278 case GIMPLE_OMP_SECTION
:
1279 pp_string (buffer
, "#pragma omp section");
1284 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1286 newline_and_indent (buffer
, spc
+ 2);
1287 pp_character (buffer
, '{');
1288 pp_newline (buffer
);
1289 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1290 newline_and_indent (buffer
, spc
+ 2);
1291 pp_character (buffer
, '}');
1296 /* Dump a GIMPLE_OMP_CRITICAL tuple on the pretty_printer BUFFER. */
1299 dump_gimple_omp_critical (pretty_printer
*buffer
, gimple gs
, int spc
,
1302 if (flags
& TDF_RAW
)
1303 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S> >", gs
,
1304 gimple_omp_body (gs
));
1307 pp_string (buffer
, "#pragma omp critical");
1308 if (gimple_omp_critical_name (gs
))
1310 pp_string (buffer
, " (");
1311 dump_generic_node (buffer
, gimple_omp_critical_name (gs
), spc
,
1313 pp_character (buffer
, ')');
1315 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1317 newline_and_indent (buffer
, spc
+ 2);
1318 pp_character (buffer
, '{');
1319 pp_newline (buffer
);
1320 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1321 newline_and_indent (buffer
, spc
+ 2);
1322 pp_character (buffer
, '}');
1327 /* Dump a GIMPLE_OMP_RETURN tuple on the pretty_printer BUFFER. */
1330 dump_gimple_omp_return (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1332 if (flags
& TDF_RAW
)
1334 dump_gimple_fmt (buffer
, spc
, flags
, "%G <nowait=%d>", gs
,
1335 (int) gimple_omp_return_nowait_p (gs
));
1339 pp_string (buffer
, "#pragma omp return");
1340 if (gimple_omp_return_nowait_p (gs
))
1341 pp_string (buffer
, "(nowait)");
1345 /* Dump a GIMPLE_TRANSACTION tuple on the pretty_printer BUFFER. */
1348 dump_gimple_transaction (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1350 unsigned subcode
= gimple_transaction_subcode (gs
);
1352 if (flags
& TDF_RAW
)
1354 dump_gimple_fmt (buffer
, spc
, flags
,
1355 "%G [SUBCODE=%x,LABEL=%T] <%+BODY <%S> >",
1356 gs
, subcode
, gimple_transaction_label (gs
),
1357 gimple_transaction_body (gs
));
1361 if (subcode
& GTMA_IS_OUTER
)
1362 pp_string (buffer
, "__transaction_atomic [[outer]]");
1363 else if (subcode
& GTMA_IS_RELAXED
)
1364 pp_string (buffer
, "__transaction_relaxed");
1366 pp_string (buffer
, "__transaction_atomic");
1367 subcode
&= ~GTMA_DECLARATION_MASK
;
1369 if (subcode
|| gimple_transaction_label (gs
))
1371 pp_string (buffer
, " //");
1372 if (gimple_transaction_label (gs
))
1374 pp_string (buffer
, " LABEL=");
1375 dump_generic_node (buffer
, gimple_transaction_label (gs
),
1380 pp_string (buffer
, " SUBCODE=[ ");
1381 if (subcode
& GTMA_HAVE_ABORT
)
1383 pp_string (buffer
, "GTMA_HAVE_ABORT ");
1384 subcode
&= ~GTMA_HAVE_ABORT
;
1386 if (subcode
& GTMA_HAVE_LOAD
)
1388 pp_string (buffer
, "GTMA_HAVE_LOAD ");
1389 subcode
&= ~GTMA_HAVE_LOAD
;
1391 if (subcode
& GTMA_HAVE_STORE
)
1393 pp_string (buffer
, "GTMA_HAVE_STORE ");
1394 subcode
&= ~GTMA_HAVE_STORE
;
1396 if (subcode
& GTMA_MAY_ENTER_IRREVOCABLE
)
1398 pp_string (buffer
, "GTMA_MAY_ENTER_IRREVOCABLE ");
1399 subcode
&= ~GTMA_MAY_ENTER_IRREVOCABLE
;
1401 if (subcode
& GTMA_DOES_GO_IRREVOCABLE
)
1403 pp_string (buffer
, "GTMA_DOES_GO_IRREVOCABLE ");
1404 subcode
&= ~GTMA_DOES_GO_IRREVOCABLE
;
1407 pp_printf (buffer
, "0x%x ", subcode
);
1408 pp_string (buffer
, "]");
1412 if (!gimple_seq_empty_p (gimple_transaction_body (gs
)))
1414 newline_and_indent (buffer
, spc
+ 2);
1415 pp_character (buffer
, '{');
1416 pp_newline (buffer
);
1417 dump_gimple_seq (buffer
, gimple_transaction_body (gs
),
1419 newline_and_indent (buffer
, spc
+ 2);
1420 pp_character (buffer
, '}');
1425 /* Dump a GIMPLE_ASM tuple on the pretty_printer BUFFER, SPC spaces of
1426 indent. FLAGS specifies details to show in the dump (see TDF_* in
1430 dump_gimple_asm (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1432 unsigned int i
, n
, f
, fields
;
1434 if (flags
& TDF_RAW
)
1436 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+STRING <%n%s%n>", gs
,
1437 gimple_asm_string (gs
));
1439 n
= gimple_asm_noutputs (gs
);
1442 newline_and_indent (buffer
, spc
+ 2);
1443 pp_string (buffer
, "OUTPUT: ");
1444 for (i
= 0; i
< n
; i
++)
1446 dump_generic_node (buffer
, gimple_asm_output_op (gs
, i
),
1449 pp_string (buffer
, ", ");
1453 n
= gimple_asm_ninputs (gs
);
1456 newline_and_indent (buffer
, spc
+ 2);
1457 pp_string (buffer
, "INPUT: ");
1458 for (i
= 0; i
< n
; i
++)
1460 dump_generic_node (buffer
, gimple_asm_input_op (gs
, i
),
1463 pp_string (buffer
, ", ");
1467 n
= gimple_asm_nclobbers (gs
);
1470 newline_and_indent (buffer
, spc
+ 2);
1471 pp_string (buffer
, "CLOBBER: ");
1472 for (i
= 0; i
< n
; i
++)
1474 dump_generic_node (buffer
, gimple_asm_clobber_op (gs
, i
),
1477 pp_string (buffer
, ", ");
1481 n
= gimple_asm_nlabels (gs
);
1484 newline_and_indent (buffer
, spc
+ 2);
1485 pp_string (buffer
, "LABEL: ");
1486 for (i
= 0; i
< n
; i
++)
1488 dump_generic_node (buffer
, gimple_asm_label_op (gs
, i
),
1491 pp_string (buffer
, ", ");
1495 newline_and_indent (buffer
, spc
);
1496 pp_character (buffer
, '>');
1500 pp_string (buffer
, "__asm__");
1501 if (gimple_asm_volatile_p (gs
))
1502 pp_string (buffer
, " __volatile__");
1503 if (gimple_asm_nlabels (gs
))
1504 pp_string (buffer
, " goto");
1505 pp_string (buffer
, "(\"");
1506 pp_string (buffer
, gimple_asm_string (gs
));
1507 pp_string (buffer
, "\"");
1509 if (gimple_asm_nlabels (gs
))
1511 else if (gimple_asm_nclobbers (gs
))
1513 else if (gimple_asm_ninputs (gs
))
1515 else if (gimple_asm_noutputs (gs
))
1520 for (f
= 0; f
< fields
; ++f
)
1522 pp_string (buffer
, " : ");
1527 n
= gimple_asm_noutputs (gs
);
1528 for (i
= 0; i
< n
; i
++)
1530 dump_generic_node (buffer
, gimple_asm_output_op (gs
, i
),
1533 pp_string (buffer
, ", ");
1538 n
= gimple_asm_ninputs (gs
);
1539 for (i
= 0; i
< n
; i
++)
1541 dump_generic_node (buffer
, gimple_asm_input_op (gs
, i
),
1544 pp_string (buffer
, ", ");
1549 n
= gimple_asm_nclobbers (gs
);
1550 for (i
= 0; i
< n
; i
++)
1552 dump_generic_node (buffer
, gimple_asm_clobber_op (gs
, i
),
1555 pp_string (buffer
, ", ");
1560 n
= gimple_asm_nlabels (gs
);
1561 for (i
= 0; i
< n
; i
++)
1563 dump_generic_node (buffer
, gimple_asm_label_op (gs
, i
),
1566 pp_string (buffer
, ", ");
1575 pp_string (buffer
, ");");
1580 /* Dump a PHI node PHI. BUFFER, SPC and FLAGS are as in
1581 dump_gimple_stmt. */
1584 dump_gimple_phi (pretty_printer
*buffer
, gimple phi
, int spc
, int flags
)
1587 tree lhs
= gimple_phi_result (phi
);
1589 if (flags
& TDF_ALIAS
1590 && POINTER_TYPE_P (TREE_TYPE (lhs
))
1591 && SSA_NAME_PTR_INFO (lhs
))
1593 struct ptr_info_def
*pi
= SSA_NAME_PTR_INFO (lhs
);
1594 pp_string (buffer
, "PT = ");
1595 pp_points_to_solution (buffer
, &pi
->pt
);
1596 newline_and_indent (buffer
, spc
);
1598 pp_printf (buffer
, "# ALIGN = %u, MISALIGN = %u",
1599 pi
->align
, pi
->misalign
);
1600 newline_and_indent (buffer
, spc
);
1601 pp_string (buffer
, "# ");
1604 if (flags
& TDF_RAW
)
1605 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, ", phi
,
1606 gimple_phi_result (phi
));
1609 dump_generic_node (buffer
, lhs
, spc
, flags
, false);
1610 pp_string (buffer
, " = PHI <");
1612 for (i
= 0; i
< gimple_phi_num_args (phi
); i
++)
1614 if ((flags
& TDF_LINENO
) && gimple_phi_arg_has_location (phi
, i
))
1616 expanded_location xloc
;
1618 xloc
= expand_location (gimple_phi_arg_location (phi
, i
));
1619 pp_character (buffer
, '[');
1622 pp_string (buffer
, xloc
.file
);
1623 pp_string (buffer
, " : ");
1625 pp_decimal_int (buffer
, xloc
.line
);
1626 pp_string (buffer
, ":");
1627 pp_decimal_int (buffer
, xloc
.column
);
1628 pp_string (buffer
, "] ");
1630 dump_generic_node (buffer
, gimple_phi_arg_def (phi
, i
), spc
, flags
,
1632 pp_character (buffer
, '(');
1633 pp_decimal_int (buffer
, gimple_phi_arg_edge (phi
, i
)->src
->index
);
1634 pp_character (buffer
, ')');
1635 if (i
< gimple_phi_num_args (phi
) - 1)
1636 pp_string (buffer
, ", ");
1638 pp_character (buffer
, '>');
1642 /* Dump a GIMPLE_OMP_PARALLEL tuple on the pretty_printer BUFFER, SPC spaces
1643 of indent. FLAGS specifies details to show in the dump (see TDF_* in
1647 dump_gimple_omp_parallel (pretty_printer
*buffer
, gimple gs
, int spc
,
1650 if (flags
& TDF_RAW
)
1652 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1653 gimple_omp_body (gs
));
1654 dump_omp_clauses (buffer
, gimple_omp_parallel_clauses (gs
), spc
, flags
);
1655 dump_gimple_fmt (buffer
, spc
, flags
, " >, %T, %T%n>",
1656 gimple_omp_parallel_child_fn (gs
),
1657 gimple_omp_parallel_data_arg (gs
));
1662 pp_string (buffer
, "#pragma omp parallel");
1663 dump_omp_clauses (buffer
, gimple_omp_parallel_clauses (gs
), spc
, flags
);
1664 if (gimple_omp_parallel_child_fn (gs
))
1666 pp_string (buffer
, " [child fn: ");
1667 dump_generic_node (buffer
, gimple_omp_parallel_child_fn (gs
),
1669 pp_string (buffer
, " (");
1670 if (gimple_omp_parallel_data_arg (gs
))
1671 dump_generic_node (buffer
, gimple_omp_parallel_data_arg (gs
),
1674 pp_string (buffer
, "???");
1675 pp_string (buffer
, ")]");
1677 body
= gimple_omp_body (gs
);
1678 if (body
&& gimple_code (gimple_seq_first_stmt (body
)) != GIMPLE_BIND
)
1680 newline_and_indent (buffer
, spc
+ 2);
1681 pp_character (buffer
, '{');
1682 pp_newline (buffer
);
1683 dump_gimple_seq (buffer
, body
, spc
+ 4, flags
);
1684 newline_and_indent (buffer
, spc
+ 2);
1685 pp_character (buffer
, '}');
1689 pp_newline (buffer
);
1690 dump_gimple_seq (buffer
, body
, spc
+ 2, flags
);
1696 /* Dump a GIMPLE_OMP_TASK tuple on the pretty_printer BUFFER, SPC spaces
1697 of indent. FLAGS specifies details to show in the dump (see TDF_* in
1701 dump_gimple_omp_task (pretty_printer
*buffer
, gimple gs
, int spc
,
1704 if (flags
& TDF_RAW
)
1706 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1707 gimple_omp_body (gs
));
1708 dump_omp_clauses (buffer
, gimple_omp_task_clauses (gs
), spc
, flags
);
1709 dump_gimple_fmt (buffer
, spc
, flags
, " >, %T, %T, %T, %T, %T%n>",
1710 gimple_omp_task_child_fn (gs
),
1711 gimple_omp_task_data_arg (gs
),
1712 gimple_omp_task_copy_fn (gs
),
1713 gimple_omp_task_arg_size (gs
),
1714 gimple_omp_task_arg_size (gs
));
1719 pp_string (buffer
, "#pragma omp task");
1720 dump_omp_clauses (buffer
, gimple_omp_task_clauses (gs
), spc
, flags
);
1721 if (gimple_omp_task_child_fn (gs
))
1723 pp_string (buffer
, " [child fn: ");
1724 dump_generic_node (buffer
, gimple_omp_task_child_fn (gs
),
1726 pp_string (buffer
, " (");
1727 if (gimple_omp_task_data_arg (gs
))
1728 dump_generic_node (buffer
, gimple_omp_task_data_arg (gs
),
1731 pp_string (buffer
, "???");
1732 pp_string (buffer
, ")]");
1734 body
= gimple_omp_body (gs
);
1735 if (body
&& gimple_code (gimple_seq_first_stmt (body
)) != GIMPLE_BIND
)
1737 newline_and_indent (buffer
, spc
+ 2);
1738 pp_character (buffer
, '{');
1739 pp_newline (buffer
);
1740 dump_gimple_seq (buffer
, body
, spc
+ 4, flags
);
1741 newline_and_indent (buffer
, spc
+ 2);
1742 pp_character (buffer
, '}');
1746 pp_newline (buffer
);
1747 dump_gimple_seq (buffer
, body
, spc
+ 2, flags
);
1753 /* Dump a GIMPLE_OMP_ATOMIC_LOAD tuple on the pretty_printer BUFFER, SPC
1754 spaces of indent. FLAGS specifies details to show in the dump (see TDF_*
1758 dump_gimple_omp_atomic_load (pretty_printer
*buffer
, gimple gs
, int spc
,
1761 if (flags
& TDF_RAW
)
1763 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %T>", gs
,
1764 gimple_omp_atomic_load_lhs (gs
),
1765 gimple_omp_atomic_load_rhs (gs
));
1769 pp_string (buffer
, "#pragma omp atomic_load");
1770 if (gimple_omp_atomic_need_value_p (gs
))
1771 pp_string (buffer
, " [needed]");
1772 newline_and_indent (buffer
, spc
+ 2);
1773 dump_generic_node (buffer
, gimple_omp_atomic_load_lhs (gs
),
1776 pp_character (buffer
, '=');
1778 pp_character (buffer
, '*');
1779 dump_generic_node (buffer
, gimple_omp_atomic_load_rhs (gs
),
1784 /* Dump a GIMPLE_OMP_ATOMIC_STORE tuple on the pretty_printer BUFFER, SPC
1785 spaces of indent. FLAGS specifies details to show in the dump (see TDF_*
1789 dump_gimple_omp_atomic_store (pretty_printer
*buffer
, gimple gs
, int spc
,
1792 if (flags
& TDF_RAW
)
1794 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
,
1795 gimple_omp_atomic_store_val (gs
));
1799 pp_string (buffer
, "#pragma omp atomic_store ");
1800 if (gimple_omp_atomic_need_value_p (gs
))
1801 pp_string (buffer
, "[needed] ");
1802 pp_character (buffer
, '(');
1803 dump_generic_node (buffer
, gimple_omp_atomic_store_val (gs
),
1805 pp_character (buffer
, ')');
1810 /* Dump all the memory operands for statement GS. BUFFER, SPC and
1811 FLAGS are as in dump_gimple_stmt. */
1814 dump_gimple_mem_ops (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1816 tree vdef
= gimple_vdef (gs
);
1817 tree vuse
= gimple_vuse (gs
);
1819 if (!ssa_operands_active () || !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 /* Dump 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 tree-pass.h). */
1846 dump_gimple_stmt (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1851 if (flags
& TDF_STMTADDR
)
1852 pp_printf (buffer
, "<&%p> ", (void *) gs
);
1854 if ((flags
& TDF_LINENO
) && gimple_has_location (gs
))
1856 expanded_location xloc
= expand_location (gimple_location (gs
));
1857 pp_character (buffer
, '[');
1860 pp_string (buffer
, xloc
.file
);
1861 pp_string (buffer
, " : ");
1863 pp_decimal_int (buffer
, xloc
.line
);
1864 pp_string (buffer
, ":");
1865 pp_decimal_int (buffer
, xloc
.column
);
1866 pp_string (buffer
, "] ");
1871 int lp_nr
= lookup_stmt_eh_lp (gs
);
1873 pp_printf (buffer
, "[LP %d] ", lp_nr
);
1875 pp_printf (buffer
, "[MNT %d] ", -lp_nr
);
1878 if ((flags
& (TDF_VOPS
|TDF_MEMSYMS
))
1879 && gimple_has_mem_ops (gs
))
1880 dump_gimple_mem_ops (buffer
, gs
, spc
, flags
);
1882 if ((flags
& TDF_ALIAS
)
1883 && gimple_has_lhs (gs
))
1885 tree lhs
= gimple_get_lhs (gs
);
1886 if (TREE_CODE (lhs
) == SSA_NAME
1887 && POINTER_TYPE_P (TREE_TYPE (lhs
))
1888 && SSA_NAME_PTR_INFO (lhs
))
1890 struct ptr_info_def
*pi
= SSA_NAME_PTR_INFO (lhs
);
1891 pp_string (buffer
, "# PT = ");
1892 pp_points_to_solution (buffer
, &pi
->pt
);
1893 newline_and_indent (buffer
, spc
);
1896 pp_printf (buffer
, "# ALIGN = %u, MISALIGN = %u",
1897 pi
->align
, pi
->misalign
);
1898 newline_and_indent (buffer
, spc
);
1903 switch (gimple_code (gs
))
1906 dump_gimple_asm (buffer
, gs
, spc
, flags
);
1910 dump_gimple_assign (buffer
, gs
, spc
, flags
);
1914 dump_gimple_bind (buffer
, gs
, spc
, flags
);
1918 dump_gimple_call (buffer
, gs
, spc
, flags
);
1922 dump_gimple_cond (buffer
, gs
, spc
, flags
);
1926 dump_gimple_label (buffer
, gs
, spc
, flags
);
1930 dump_gimple_goto (buffer
, gs
, spc
, flags
);
1934 pp_string (buffer
, "GIMPLE_NOP");
1938 dump_gimple_return (buffer
, gs
, spc
, flags
);
1942 dump_gimple_switch (buffer
, gs
, spc
, flags
);
1946 dump_gimple_try (buffer
, gs
, spc
, flags
);
1950 dump_gimple_phi (buffer
, gs
, spc
, flags
);
1953 case GIMPLE_OMP_PARALLEL
:
1954 dump_gimple_omp_parallel (buffer
, gs
, spc
, flags
);
1957 case GIMPLE_OMP_TASK
:
1958 dump_gimple_omp_task (buffer
, gs
, spc
, flags
);
1961 case GIMPLE_OMP_ATOMIC_LOAD
:
1962 dump_gimple_omp_atomic_load (buffer
, gs
, spc
, flags
);
1966 case GIMPLE_OMP_ATOMIC_STORE
:
1967 dump_gimple_omp_atomic_store (buffer
, gs
, spc
, flags
);
1970 case GIMPLE_OMP_FOR
:
1971 dump_gimple_omp_for (buffer
, gs
, spc
, flags
);
1974 case GIMPLE_OMP_CONTINUE
:
1975 dump_gimple_omp_continue (buffer
, gs
, spc
, flags
);
1978 case GIMPLE_OMP_SINGLE
:
1979 dump_gimple_omp_single (buffer
, gs
, spc
, flags
);
1982 case GIMPLE_OMP_RETURN
:
1983 dump_gimple_omp_return (buffer
, gs
, spc
, flags
);
1986 case GIMPLE_OMP_SECTIONS
:
1987 dump_gimple_omp_sections (buffer
, gs
, spc
, flags
);
1990 case GIMPLE_OMP_SECTIONS_SWITCH
:
1991 pp_string (buffer
, "GIMPLE_SECTIONS_SWITCH");
1994 case GIMPLE_OMP_MASTER
:
1995 case GIMPLE_OMP_ORDERED
:
1996 case GIMPLE_OMP_SECTION
:
1997 dump_gimple_omp_block (buffer
, gs
, spc
, flags
);
2000 case GIMPLE_OMP_CRITICAL
:
2001 dump_gimple_omp_critical (buffer
, gs
, spc
, flags
);
2005 dump_gimple_catch (buffer
, gs
, spc
, flags
);
2008 case GIMPLE_EH_FILTER
:
2009 dump_gimple_eh_filter (buffer
, gs
, spc
, flags
);
2012 case GIMPLE_EH_MUST_NOT_THROW
:
2013 dump_gimple_eh_must_not_throw (buffer
, gs
, spc
, flags
);
2016 case GIMPLE_EH_ELSE
:
2017 dump_gimple_eh_else (buffer
, gs
, spc
, flags
);
2021 dump_gimple_resx (buffer
, gs
, spc
, flags
);
2024 case GIMPLE_EH_DISPATCH
:
2025 dump_gimple_eh_dispatch (buffer
, gs
, spc
, flags
);
2029 dump_gimple_debug (buffer
, gs
, spc
, flags
);
2032 case GIMPLE_PREDICT
:
2033 pp_string (buffer
, "// predicted ");
2034 if (gimple_predict_outcome (gs
))
2035 pp_string (buffer
, "likely by ");
2037 pp_string (buffer
, "unlikely by ");
2038 pp_string (buffer
, predictor_name (gimple_predict_predictor (gs
)));
2039 pp_string (buffer
, " predictor.");
2042 case GIMPLE_TRANSACTION
:
2043 dump_gimple_transaction (buffer
, gs
, spc
, flags
);
2050 /* If we're building a diagnostic, the formatted text will be
2051 written into BUFFER's stream by the caller; otherwise, write it
2053 if (!(flags
& TDF_DIAGNOSTIC
))
2054 pp_write_text_to_stream (buffer
);
2058 /* Dumps header of basic block BB to buffer BUFFER indented by INDENT
2059 spaces and details described by flags. */
2062 dump_bb_header (pretty_printer
*buffer
, basic_block bb
, int indent
, int flags
)
2068 if (flags
& TDF_BLOCKS
)
2071 pp_string (buffer
, "# BLOCK ");
2072 pp_decimal_int (buffer
, bb
->index
);
2075 pp_string (buffer
, " freq:");
2076 pp_decimal_int (buffer
, bb
->frequency
);
2080 pp_string (buffer
, " count:");
2081 pp_widest_integer (buffer
, bb
->count
);
2084 if (flags
& TDF_LINENO
)
2086 gimple_stmt_iterator gsi
;
2088 for (gsi
= gsi_start_bb (bb
); !gsi_end_p (gsi
); gsi_next (&gsi
))
2089 if (!is_gimple_debug (gsi_stmt (gsi
))
2090 && get_lineno (gsi_stmt (gsi
)) != UNKNOWN_LOCATION
)
2092 pp_string (buffer
, ", starting at line ");
2093 pp_decimal_int (buffer
, get_lineno (gsi_stmt (gsi
)));
2097 if (bb
->discriminator
)
2099 pp_string (buffer
, ", discriminator ");
2100 pp_decimal_int (buffer
, bb
->discriminator
);
2103 newline_and_indent (buffer
, indent
);
2105 pp_string (buffer
, "# PRED:");
2106 pp_write_text_to_stream (buffer
);
2107 FOR_EACH_EDGE (e
, ei
, bb
->preds
)
2108 if (flags
& TDF_SLIM
)
2110 pp_character (buffer
, ' ');
2111 if (e
->src
== ENTRY_BLOCK_PTR
)
2112 pp_string (buffer
, "ENTRY");
2114 pp_decimal_int (buffer
, e
->src
->index
);
2117 dump_edge_info (buffer
->buffer
->stream
, e
, 0);
2118 pp_newline (buffer
);
2122 stmt
= first_stmt (bb
);
2123 if (!stmt
|| gimple_code (stmt
) != GIMPLE_LABEL
)
2125 INDENT (indent
- 2);
2126 pp_string (buffer
, "<bb ");
2127 pp_decimal_int (buffer
, bb
->index
);
2128 pp_string (buffer
, ">:");
2129 pp_newline (buffer
);
2132 pp_write_text_to_stream (buffer
);
2134 check_bb_profile (bb
, buffer
->buffer
->stream
);
2138 /* Dumps end of basic block BB to buffer BUFFER indented by INDENT
2142 dump_bb_end (pretty_printer
*buffer
, basic_block bb
, int indent
, int flags
)
2148 pp_string (buffer
, "# SUCC:");
2149 pp_write_text_to_stream (buffer
);
2150 FOR_EACH_EDGE (e
, ei
, bb
->succs
)
2151 if (flags
& TDF_SLIM
)
2153 pp_character (buffer
, ' ');
2154 if (e
->dest
== EXIT_BLOCK_PTR
)
2155 pp_string (buffer
, "EXIT");
2157 pp_decimal_int (buffer
, e
->dest
->index
);
2160 dump_edge_info (buffer
->buffer
->stream
, e
, 1);
2161 pp_newline (buffer
);
2165 /* Dump PHI nodes of basic block BB to BUFFER with details described
2166 by FLAGS and indented by INDENT spaces. */
2169 dump_phi_nodes (pretty_printer
*buffer
, basic_block bb
, int indent
, int flags
)
2171 gimple_stmt_iterator i
;
2173 for (i
= gsi_start_phis (bb
); !gsi_end_p (i
); gsi_next (&i
))
2175 gimple phi
= gsi_stmt (i
);
2176 if (is_gimple_reg (gimple_phi_result (phi
)) || (flags
& TDF_VOPS
))
2179 pp_string (buffer
, "# ");
2180 dump_gimple_phi (buffer
, phi
, indent
, flags
);
2181 pp_newline (buffer
);
2187 /* Dump jump to basic block BB that is represented implicitly in the cfg
2191 pp_cfg_jump (pretty_printer
*buffer
, basic_block bb
)
2195 stmt
= first_stmt (bb
);
2197 pp_string (buffer
, "goto <bb ");
2198 pp_decimal_int (buffer
, bb
->index
);
2199 pp_character (buffer
, '>');
2200 if (stmt
&& gimple_code (stmt
) == GIMPLE_LABEL
)
2202 pp_string (buffer
, " (");
2203 dump_generic_node (buffer
, gimple_label_label (stmt
), 0, 0, false);
2204 pp_character (buffer
, ')');
2205 pp_semicolon (buffer
);
2208 pp_semicolon (buffer
);
2212 /* Dump edges represented implicitly in basic block BB to BUFFER, indented
2213 by INDENT spaces, with details given by FLAGS. */
2216 dump_implicit_edges (pretty_printer
*buffer
, basic_block bb
, int indent
,
2222 stmt
= last_stmt (bb
);
2224 if (stmt
&& gimple_code (stmt
) == GIMPLE_COND
)
2226 edge true_edge
, false_edge
;
2228 /* When we are emitting the code or changing CFG, it is possible that
2229 the edges are not yet created. When we are using debug_bb in such
2230 a situation, we do not want it to crash. */
2231 if (EDGE_COUNT (bb
->succs
) != 2)
2233 extract_true_false_edges_from_block (bb
, &true_edge
, &false_edge
);
2235 INDENT (indent
+ 2);
2236 pp_cfg_jump (buffer
, true_edge
->dest
);
2237 newline_and_indent (buffer
, indent
);
2238 pp_string (buffer
, "else");
2239 newline_and_indent (buffer
, indent
+ 2);
2240 pp_cfg_jump (buffer
, false_edge
->dest
);
2241 pp_newline (buffer
);
2245 /* If there is a fallthru edge, we may need to add an artificial
2246 goto to the dump. */
2247 e
= find_fallthru_edge (bb
->succs
);
2249 if (e
&& e
->dest
!= bb
->next_bb
)
2253 if ((flags
& TDF_LINENO
)
2254 && e
->goto_locus
!= UNKNOWN_LOCATION
2257 expanded_location goto_xloc
;
2258 goto_xloc
= expand_location (e
->goto_locus
);
2259 pp_character (buffer
, '[');
2262 pp_string (buffer
, goto_xloc
.file
);
2263 pp_string (buffer
, " : ");
2265 pp_decimal_int (buffer
, goto_xloc
.line
);
2266 pp_string (buffer
, " : ");
2267 pp_decimal_int (buffer
, goto_xloc
.column
);
2268 pp_string (buffer
, "] ");
2271 pp_cfg_jump (buffer
, e
->dest
);
2272 pp_newline (buffer
);
2277 /* Dumps basic block BB to buffer BUFFER with details described by FLAGS and
2278 indented by INDENT spaces. */
2281 gimple_dump_bb_buff (pretty_printer
*buffer
, basic_block bb
, int indent
,
2284 gimple_stmt_iterator gsi
;
2286 int label_indent
= indent
- 2;
2288 if (label_indent
< 0)
2291 dump_bb_header (buffer
, bb
, indent
, flags
);
2292 dump_phi_nodes (buffer
, bb
, indent
, flags
);
2294 for (gsi
= gsi_start_bb (bb
); !gsi_end_p (gsi
); gsi_next (&gsi
))
2298 stmt
= gsi_stmt (gsi
);
2300 curr_indent
= gimple_code (stmt
) == GIMPLE_LABEL
? label_indent
: indent
;
2302 INDENT (curr_indent
);
2303 dump_gimple_stmt (buffer
, stmt
, curr_indent
, flags
);
2304 pp_newline (buffer
);
2305 dump_histograms_for_stmt (cfun
, buffer
->buffer
->stream
, stmt
);
2308 dump_implicit_edges (buffer
, bb
, indent
, flags
);
2310 if (flags
& TDF_BLOCKS
)
2311 dump_bb_end (buffer
, bb
, indent
, flags
);
2315 /* Dumps basic block BB to FILE with details described by FLAGS and
2316 indented by INDENT spaces. */
2319 gimple_dump_bb (basic_block bb
, FILE *file
, int indent
, int flags
)
2321 maybe_init_pretty_print (file
);
2322 gimple_dump_bb_buff (&buffer
, bb
, indent
, flags
);