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 preceded 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_WIDEN_MULT_EVEN_EXPR
:
346 case VEC_WIDEN_MULT_ODD_EXPR
:
347 case VEC_PACK_TRUNC_EXPR
:
348 case VEC_PACK_SAT_EXPR
:
349 case VEC_PACK_FIX_TRUNC_EXPR
:
350 case VEC_WIDEN_LSHIFT_HI_EXPR
:
351 case VEC_WIDEN_LSHIFT_LO_EXPR
:
352 for (p
= tree_code_name
[(int) code
]; *p
; p
++)
353 pp_character (buffer
, TOUPPER (*p
));
354 pp_string (buffer
, " <");
355 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
356 pp_string (buffer
, ", ");
357 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
358 pp_character (buffer
, '>');
362 if (op_prio (gimple_assign_rhs1 (gs
)) <= op_code_prio (code
))
364 pp_character (buffer
, '(');
365 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
,
367 pp_character (buffer
, ')');
370 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
372 pp_string (buffer
, op_symbol_code (gimple_assign_rhs_code (gs
)));
374 if (op_prio (gimple_assign_rhs2 (gs
)) <= op_code_prio (code
))
376 pp_character (buffer
, '(');
377 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
,
379 pp_character (buffer
, ')');
382 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
386 /* Helper for dump_gimple_assign. Print the ternary RHS of the
387 assignment GS. BUFFER, SPC and FLAGS are as in dump_gimple_stmt. */
390 dump_ternary_rhs (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
393 enum tree_code code
= gimple_assign_rhs_code (gs
);
396 case WIDEN_MULT_PLUS_EXPR
:
397 case WIDEN_MULT_MINUS_EXPR
:
398 for (p
= tree_code_name
[(int) code
]; *p
; p
++)
399 pp_character (buffer
, TOUPPER (*p
));
400 pp_string (buffer
, " <");
401 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
402 pp_string (buffer
, ", ");
403 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
404 pp_string (buffer
, ", ");
405 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
406 pp_character (buffer
, '>');
410 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
411 pp_string (buffer
, " * ");
412 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
413 pp_string (buffer
, " + ");
414 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
418 pp_string (buffer
, "DOT_PROD_EXPR <");
419 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
420 pp_string (buffer
, ", ");
421 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
422 pp_string (buffer
, ", ");
423 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
424 pp_string (buffer
, ">");
428 pp_string (buffer
, "VEC_PERM_EXPR <");
429 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
430 pp_string (buffer
, ", ");
431 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
432 pp_string (buffer
, ", ");
433 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
434 pp_string (buffer
, ">");
437 case REALIGN_LOAD_EXPR
:
438 pp_string (buffer
, "REALIGN_LOAD <");
439 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
440 pp_string (buffer
, ", ");
441 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
442 pp_string (buffer
, ", ");
443 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
444 pp_string (buffer
, ">");
448 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
449 pp_string (buffer
, " ? ");
450 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
451 pp_string (buffer
, " : ");
452 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
456 pp_string (buffer
, "VEC_COND_EXPR <");
457 dump_generic_node (buffer
, gimple_assign_rhs1 (gs
), spc
, flags
, false);
458 pp_string (buffer
, ", ");
459 dump_generic_node (buffer
, gimple_assign_rhs2 (gs
), spc
, flags
, false);
460 pp_string (buffer
, ", ");
461 dump_generic_node (buffer
, gimple_assign_rhs3 (gs
), spc
, flags
, false);
462 pp_string (buffer
, ">");
471 /* Dump the gimple assignment GS. BUFFER, SPC and FLAGS are as in
475 dump_gimple_assign (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
480 if (gimple_num_ops (gs
) == 2)
482 else if (gimple_num_ops (gs
) == 3)
483 last
= gimple_assign_rhs2 (gs
);
487 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%s, %T, %T, %T>", gs
,
488 tree_code_name
[gimple_assign_rhs_code (gs
)],
489 gimple_assign_lhs (gs
), gimple_assign_rhs1 (gs
), last
);
493 if (!(flags
& TDF_RHS_ONLY
))
495 dump_generic_node (buffer
, gimple_assign_lhs (gs
), spc
, flags
, false);
497 pp_character (buffer
, '=');
499 if (gimple_assign_nontemporal_move_p (gs
))
500 pp_string (buffer
, "{nt}");
502 if (gimple_has_volatile_ops (gs
))
503 pp_string (buffer
, "{v}");
508 if (gimple_num_ops (gs
) == 2)
509 dump_unary_rhs (buffer
, gs
, spc
, flags
);
510 else if (gimple_num_ops (gs
) == 3)
511 dump_binary_rhs (buffer
, gs
, spc
, flags
);
512 else if (gimple_num_ops (gs
) == 4)
513 dump_ternary_rhs (buffer
, gs
, spc
, flags
);
516 if (!(flags
& TDF_RHS_ONLY
))
517 pp_semicolon(buffer
);
522 /* Dump the return statement GS. BUFFER, SPC and FLAGS are as in
526 dump_gimple_return (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
530 t
= gimple_return_retval (gs
);
532 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
, t
);
535 pp_string (buffer
, "return");
539 dump_generic_node (buffer
, t
, spc
, flags
, false);
541 pp_semicolon (buffer
);
546 /* Dump the call arguments for a gimple call. BUFFER, FLAGS are as in
550 dump_gimple_call_args (pretty_printer
*buffer
, gimple gs
, int flags
)
554 for (i
= 0; i
< gimple_call_num_args (gs
); i
++)
556 dump_generic_node (buffer
, gimple_call_arg (gs
, i
), 0, flags
, false);
557 if (i
< gimple_call_num_args (gs
) - 1)
558 pp_string (buffer
, ", ");
561 if (gimple_call_va_arg_pack_p (gs
))
563 if (gimple_call_num_args (gs
) > 0)
565 pp_character (buffer
, ',');
569 pp_string (buffer
, "__builtin_va_arg_pack ()");
573 /* Dump the points-to solution *PT to BUFFER. */
576 pp_points_to_solution (pretty_printer
*buffer
, struct pt_solution
*pt
)
580 pp_string (buffer
, "anything ");
584 pp_string (buffer
, "nonlocal ");
586 pp_string (buffer
, "escaped ");
588 pp_string (buffer
, "unit-escaped ");
590 pp_string (buffer
, "null ");
592 && !bitmap_empty_p (pt
->vars
))
596 pp_string (buffer
, "{ ");
597 EXECUTE_IF_SET_IN_BITMAP (pt
->vars
, 0, i
, bi
)
599 tree var
= referenced_var_lookup (cfun
, i
);
602 dump_generic_node (buffer
, var
, 0, dump_flags
, false);
603 if (DECL_PT_UID (var
) != DECL_UID (var
))
605 pp_string (buffer
, "ptD.");
606 pp_decimal_int (buffer
, DECL_PT_UID (var
));
611 pp_string (buffer
, "D.");
612 pp_decimal_int (buffer
, i
);
614 pp_character (buffer
, ' ');
616 pp_character (buffer
, '}');
617 if (pt
->vars_contains_global
)
618 pp_string (buffer
, " (glob)");
622 /* Dump the call statement GS. BUFFER, SPC and FLAGS are as in
626 dump_gimple_call (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
628 tree lhs
= gimple_call_lhs (gs
);
629 tree fn
= gimple_call_fn (gs
);
631 if (flags
& TDF_ALIAS
)
633 struct pt_solution
*pt
;
634 pt
= gimple_call_use_set (gs
);
635 if (!pt_solution_empty_p (pt
))
637 pp_string (buffer
, "# USE = ");
638 pp_points_to_solution (buffer
, pt
);
639 newline_and_indent (buffer
, spc
);
641 pt
= gimple_call_clobber_set (gs
);
642 if (!pt_solution_empty_p (pt
))
644 pp_string (buffer
, "# CLB = ");
645 pp_points_to_solution (buffer
, pt
);
646 newline_and_indent (buffer
, spc
);
652 if (gimple_call_internal_p (gs
))
653 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%s, %T", gs
,
654 internal_fn_name (gimple_call_internal_fn (gs
)), lhs
);
656 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %T", gs
, fn
, lhs
);
657 if (gimple_call_num_args (gs
) > 0)
659 pp_string (buffer
, ", ");
660 dump_gimple_call_args (buffer
, gs
, flags
);
662 pp_character (buffer
, '>');
666 if (lhs
&& !(flags
& TDF_RHS_ONLY
))
668 dump_generic_node (buffer
, lhs
, spc
, flags
, false);
669 pp_string (buffer
, " =");
671 if (gimple_has_volatile_ops (gs
))
672 pp_string (buffer
, "{v}");
676 if (gimple_call_internal_p (gs
))
677 pp_string (buffer
, internal_fn_name (gimple_call_internal_fn (gs
)));
679 print_call_name (buffer
, fn
, flags
);
680 pp_string (buffer
, " (");
681 dump_gimple_call_args (buffer
, gs
, flags
);
682 pp_character (buffer
, ')');
683 if (!(flags
& TDF_RHS_ONLY
))
684 pp_semicolon (buffer
);
687 if (gimple_call_chain (gs
))
689 pp_string (buffer
, " [static-chain: ");
690 dump_generic_node (buffer
, gimple_call_chain (gs
), spc
, flags
, false);
691 pp_character (buffer
, ']');
694 if (gimple_call_return_slot_opt_p (gs
))
695 pp_string (buffer
, " [return slot optimization]");
696 if (gimple_call_tail_p (gs
))
697 pp_string (buffer
, " [tail call]");
702 /* Dump the arguments of _ITM_beginTransaction sanely. */
703 if (TREE_CODE (fn
) == ADDR_EXPR
)
704 fn
= TREE_OPERAND (fn
, 0);
705 if (TREE_CODE (fn
) == FUNCTION_DECL
&& decl_is_tm_clone (fn
))
706 pp_string (buffer
, " [tm-clone]");
707 if (TREE_CODE (fn
) == FUNCTION_DECL
708 && DECL_BUILT_IN_CLASS (fn
) == BUILT_IN_NORMAL
709 && DECL_FUNCTION_CODE (fn
) == BUILT_IN_TM_START
710 && gimple_call_num_args (gs
) > 0)
712 tree t
= gimple_call_arg (gs
, 0);
713 unsigned HOST_WIDE_INT props
;
714 gcc_assert (TREE_CODE (t
) == INTEGER_CST
);
716 pp_string (buffer
, " [ ");
718 /* Get the transaction code properties. */
719 props
= TREE_INT_CST_LOW (t
);
721 if (props
& PR_INSTRUMENTEDCODE
)
722 pp_string (buffer
, "instrumentedCode ");
723 if (props
& PR_UNINSTRUMENTEDCODE
)
724 pp_string (buffer
, "uninstrumentedCode ");
725 if (props
& PR_HASNOXMMUPDATE
)
726 pp_string (buffer
, "hasNoXMMUpdate ");
727 if (props
& PR_HASNOABORT
)
728 pp_string (buffer
, "hasNoAbort ");
729 if (props
& PR_HASNOIRREVOCABLE
)
730 pp_string (buffer
, "hasNoIrrevocable ");
731 if (props
& PR_DOESGOIRREVOCABLE
)
732 pp_string (buffer
, "doesGoIrrevocable ");
733 if (props
& PR_HASNOSIMPLEREADS
)
734 pp_string (buffer
, "hasNoSimpleReads ");
735 if (props
& PR_AWBARRIERSOMITTED
)
736 pp_string (buffer
, "awBarriersOmitted ");
737 if (props
& PR_RARBARRIERSOMITTED
)
738 pp_string (buffer
, "RaRBarriersOmitted ");
739 if (props
& PR_UNDOLOGCODE
)
740 pp_string (buffer
, "undoLogCode ");
741 if (props
& PR_PREFERUNINSTRUMENTED
)
742 pp_string (buffer
, "preferUninstrumented ");
743 if (props
& PR_EXCEPTIONBLOCK
)
744 pp_string (buffer
, "exceptionBlock ");
745 if (props
& PR_HASELSE
)
746 pp_string (buffer
, "hasElse ");
747 if (props
& PR_READONLY
)
748 pp_string (buffer
, "readOnly ");
750 pp_string (buffer
, "]");
755 /* Dump the switch statement GS. BUFFER, SPC and FLAGS are as in
759 dump_gimple_switch (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
763 GIMPLE_CHECK (gs
, GIMPLE_SWITCH
);
765 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, ", gs
,
766 gimple_switch_index (gs
));
769 pp_string (buffer
, "switch (");
770 dump_generic_node (buffer
, gimple_switch_index (gs
), spc
, flags
, true);
771 pp_string (buffer
, ") <");
774 for (i
= 0; i
< gimple_switch_num_labels (gs
); i
++)
776 tree case_label
= gimple_switch_label (gs
, i
);
777 if (case_label
== NULL_TREE
)
780 dump_generic_node (buffer
, case_label
, spc
, flags
, false);
781 pp_character (buffer
, ' ');
782 dump_generic_node (buffer
, CASE_LABEL (case_label
), spc
, flags
, false);
783 if (i
< gimple_switch_num_labels (gs
) - 1)
784 pp_string (buffer
, ", ");
786 pp_character (buffer
, '>');
790 /* Dump the gimple conditional GS. BUFFER, SPC and FLAGS are as in
794 dump_gimple_cond (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
797 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%s, %T, %T, %T, %T>", gs
,
798 tree_code_name
[gimple_cond_code (gs
)],
799 gimple_cond_lhs (gs
), gimple_cond_rhs (gs
),
800 gimple_cond_true_label (gs
), gimple_cond_false_label (gs
));
803 if (!(flags
& TDF_RHS_ONLY
))
804 pp_string (buffer
, "if (");
805 dump_generic_node (buffer
, gimple_cond_lhs (gs
), spc
, flags
, false);
807 pp_string (buffer
, op_symbol_code (gimple_cond_code (gs
)));
809 dump_generic_node (buffer
, gimple_cond_rhs (gs
), spc
, flags
, false);
810 if (!(flags
& TDF_RHS_ONLY
))
812 pp_character (buffer
, ')');
814 if (gimple_cond_true_label (gs
))
816 pp_string (buffer
, " goto ");
817 dump_generic_node (buffer
, gimple_cond_true_label (gs
),
819 pp_semicolon (buffer
);
821 if (gimple_cond_false_label (gs
))
823 pp_string (buffer
, " else goto ");
824 dump_generic_node (buffer
, gimple_cond_false_label (gs
),
826 pp_semicolon (buffer
);
833 /* Dump a GIMPLE_LABEL tuple on the pretty_printer BUFFER, SPC
834 spaces of indent. FLAGS specifies details to show in the dump (see
835 TDF_* in tree-pass.h). */
838 dump_gimple_label (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
840 tree label
= gimple_label_label (gs
);
842 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
, label
);
845 dump_generic_node (buffer
, label
, spc
, flags
, false);
846 pp_character (buffer
, ':');
848 if (DECL_NONLOCAL (label
))
849 pp_string (buffer
, " [non-local]");
850 if ((flags
& TDF_EH
) && EH_LANDING_PAD_NR (label
))
851 pp_printf (buffer
, " [LP %d]", EH_LANDING_PAD_NR (label
));
854 /* Dump a GIMPLE_GOTO tuple on the pretty_printer BUFFER, SPC
855 spaces of indent. FLAGS specifies details to show in the dump (see
856 TDF_* in tree-pass.h). */
859 dump_gimple_goto (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
861 tree label
= gimple_goto_dest (gs
);
863 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
, label
);
865 dump_gimple_fmt (buffer
, spc
, flags
, "goto %T;", label
);
869 /* Dump a GIMPLE_BIND tuple on the pretty_printer BUFFER, SPC
870 spaces of indent. FLAGS specifies details to show in the dump (see
871 TDF_* in tree-pass.h). */
874 dump_gimple_bind (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
877 dump_gimple_fmt (buffer
, spc
, flags
, "%G <", gs
);
879 pp_character (buffer
, '{');
880 if (!(flags
& TDF_SLIM
))
884 for (var
= gimple_bind_vars (gs
); var
; var
= DECL_CHAIN (var
))
886 newline_and_indent (buffer
, 2);
887 print_declaration (buffer
, var
, spc
, flags
);
889 if (gimple_bind_vars (gs
))
893 dump_gimple_seq (buffer
, gimple_bind_body (gs
), spc
+ 2, flags
);
894 newline_and_indent (buffer
, spc
);
896 pp_character (buffer
, '>');
898 pp_character (buffer
, '}');
902 /* Dump a GIMPLE_TRY tuple on the pretty_printer BUFFER, SPC spaces of
903 indent. FLAGS specifies details to show in the dump (see TDF_* in
907 dump_gimple_try (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
912 if (gimple_try_kind (gs
) == GIMPLE_TRY_CATCH
)
913 type
= "GIMPLE_TRY_CATCH";
914 else if (gimple_try_kind (gs
) == GIMPLE_TRY_FINALLY
)
915 type
= "GIMPLE_TRY_FINALLY";
917 type
= "UNKNOWN GIMPLE_TRY";
918 dump_gimple_fmt (buffer
, spc
, flags
,
919 "%G <%s,%+EVAL <%S>%nCLEANUP <%S>%->", gs
, type
,
920 gimple_try_eval (gs
), gimple_try_cleanup (gs
));
924 pp_string (buffer
, "try");
925 newline_and_indent (buffer
, spc
+ 2);
926 pp_character (buffer
, '{');
929 dump_gimple_seq (buffer
, gimple_try_eval (gs
), spc
+ 4, flags
);
930 newline_and_indent (buffer
, spc
+ 2);
931 pp_character (buffer
, '}');
933 if (gimple_try_kind (gs
) == GIMPLE_TRY_CATCH
)
935 newline_and_indent (buffer
, spc
);
936 pp_string (buffer
, "catch");
937 newline_and_indent (buffer
, spc
+ 2);
938 pp_character (buffer
, '{');
940 else if (gimple_try_kind (gs
) == GIMPLE_TRY_FINALLY
)
942 newline_and_indent (buffer
, spc
);
943 pp_string (buffer
, "finally");
944 newline_and_indent (buffer
, spc
+ 2);
945 pp_character (buffer
, '{');
948 pp_string (buffer
, " <UNKNOWN GIMPLE_TRY> {");
951 dump_gimple_seq (buffer
, gimple_try_cleanup (gs
), spc
+ 4, flags
);
952 newline_and_indent (buffer
, spc
+ 2);
953 pp_character (buffer
, '}');
958 /* Dump a GIMPLE_CATCH tuple on the pretty_printer BUFFER, SPC spaces of
959 indent. FLAGS specifies details to show in the dump (see TDF_* in
963 dump_gimple_catch (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
966 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %+CATCH <%S>%->", gs
,
967 gimple_catch_types (gs
), gimple_catch_handler (gs
));
969 dump_gimple_fmt (buffer
, spc
, flags
, "catch (%T)%+{%S}",
970 gimple_catch_types (gs
), gimple_catch_handler (gs
));
974 /* Dump a GIMPLE_EH_FILTER tuple on the pretty_printer BUFFER, SPC spaces of
975 indent. FLAGS specifies details to show in the dump (see TDF_* in
979 dump_gimple_eh_filter (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
982 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %+FAILURE <%S>%->", gs
,
983 gimple_eh_filter_types (gs
),
984 gimple_eh_filter_failure (gs
));
986 dump_gimple_fmt (buffer
, spc
, flags
, "<<<eh_filter (%T)>>>%+{%+%S%-}",
987 gimple_eh_filter_types (gs
),
988 gimple_eh_filter_failure (gs
));
992 /* Dump a GIMPLE_EH_MUST_NOT_THROW tuple. */
995 dump_gimple_eh_must_not_throw (pretty_printer
*buffer
, gimple gs
,
999 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
,
1000 gimple_eh_must_not_throw_fndecl (gs
));
1002 dump_gimple_fmt (buffer
, spc
, flags
, "<<<eh_must_not_throw (%T)>>>",
1003 gimple_eh_must_not_throw_fndecl (gs
));
1007 /* Dump a GIMPLE_EH_ELSE tuple on the pretty_printer BUFFER, SPC spaces of
1008 indent. FLAGS specifies details to show in the dump (see TDF_* in
1012 dump_gimple_eh_else (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1014 if (flags
& TDF_RAW
)
1015 dump_gimple_fmt (buffer
, spc
, flags
,
1016 "%G <%+N_BODY <%S>%nE_BODY <%S>%->", gs
,
1017 gimple_eh_else_n_body (gs
), gimple_eh_else_e_body (gs
));
1019 dump_gimple_fmt (buffer
, spc
, flags
,
1020 "<<<if_normal_exit>>>%+{%S}%-<<<else_eh_exit>>>%+{%S}",
1021 gimple_eh_else_n_body (gs
), gimple_eh_else_e_body (gs
));
1025 /* Dump a GIMPLE_RESX tuple on the pretty_printer BUFFER, SPC spaces of
1026 indent. FLAGS specifies details to show in the dump (see TDF_* in
1030 dump_gimple_resx (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1032 if (flags
& TDF_RAW
)
1033 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%d>", gs
,
1034 gimple_resx_region (gs
));
1036 dump_gimple_fmt (buffer
, spc
, flags
, "resx %d", gimple_resx_region (gs
));
1039 /* Dump a GIMPLE_EH_DISPATCH tuple on the pretty_printer BUFFER. */
1042 dump_gimple_eh_dispatch (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1044 if (flags
& TDF_RAW
)
1045 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%d>", gs
,
1046 gimple_eh_dispatch_region (gs
));
1048 dump_gimple_fmt (buffer
, spc
, flags
, "eh_dispatch %d",
1049 gimple_eh_dispatch_region (gs
));
1052 /* Dump a GIMPLE_DEBUG tuple on the pretty_printer BUFFER, SPC spaces
1053 of indent. FLAGS specifies details to show in the dump (see TDF_*
1057 dump_gimple_debug (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1059 switch (gs
->gsbase
.subcode
)
1061 case GIMPLE_DEBUG_BIND
:
1062 if (flags
& TDF_RAW
)
1063 dump_gimple_fmt (buffer
, spc
, flags
, "%G BIND <%T, %T>", gs
,
1064 gimple_debug_bind_get_var (gs
),
1065 gimple_debug_bind_get_value (gs
));
1067 dump_gimple_fmt (buffer
, spc
, flags
, "# DEBUG %T => %T",
1068 gimple_debug_bind_get_var (gs
),
1069 gimple_debug_bind_get_value (gs
));
1072 case GIMPLE_DEBUG_SOURCE_BIND
:
1073 if (flags
& TDF_RAW
)
1074 dump_gimple_fmt (buffer
, spc
, flags
, "%G SRCBIND <%T, %T>", gs
,
1075 gimple_debug_source_bind_get_var (gs
),
1076 gimple_debug_source_bind_get_value (gs
));
1078 dump_gimple_fmt (buffer
, spc
, flags
, "# DEBUG %T s=> %T",
1079 gimple_debug_source_bind_get_var (gs
),
1080 gimple_debug_source_bind_get_value (gs
));
1088 /* Dump a GIMPLE_OMP_FOR tuple on the pretty_printer BUFFER. */
1090 dump_gimple_omp_for (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1094 if (flags
& TDF_RAW
)
1096 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1097 gimple_omp_body (gs
));
1098 dump_omp_clauses (buffer
, gimple_omp_for_clauses (gs
), spc
, flags
);
1099 dump_gimple_fmt (buffer
, spc
, flags
, " >,");
1100 for (i
= 0; i
< gimple_omp_for_collapse (gs
); i
++)
1101 dump_gimple_fmt (buffer
, spc
, flags
,
1102 "%+%T, %T, %T, %s, %T,%n",
1103 gimple_omp_for_index (gs
, i
),
1104 gimple_omp_for_initial (gs
, i
),
1105 gimple_omp_for_final (gs
, i
),
1106 tree_code_name
[gimple_omp_for_cond (gs
, i
)],
1107 gimple_omp_for_incr (gs
, i
));
1108 dump_gimple_fmt (buffer
, spc
, flags
, "PRE_BODY <%S>%->",
1109 gimple_omp_for_pre_body (gs
));
1113 pp_string (buffer
, "#pragma omp for");
1114 dump_omp_clauses (buffer
, gimple_omp_for_clauses (gs
), spc
, flags
);
1115 for (i
= 0; i
< gimple_omp_for_collapse (gs
); i
++)
1119 newline_and_indent (buffer
, spc
);
1120 pp_string (buffer
, "for (");
1121 dump_generic_node (buffer
, gimple_omp_for_index (gs
, i
), spc
,
1123 pp_string (buffer
, " = ");
1124 dump_generic_node (buffer
, gimple_omp_for_initial (gs
, i
), spc
,
1126 pp_string (buffer
, "; ");
1128 dump_generic_node (buffer
, gimple_omp_for_index (gs
, i
), spc
,
1131 switch (gimple_omp_for_cond (gs
, i
))
1134 pp_character (buffer
, '<');
1137 pp_character (buffer
, '>');
1140 pp_string (buffer
, "<=");
1143 pp_string (buffer
, ">=");
1149 dump_generic_node (buffer
, gimple_omp_for_final (gs
, i
), spc
,
1151 pp_string (buffer
, "; ");
1153 dump_generic_node (buffer
, gimple_omp_for_index (gs
, i
), spc
,
1155 pp_string (buffer
, " = ");
1156 dump_generic_node (buffer
, gimple_omp_for_incr (gs
, i
), spc
,
1158 pp_character (buffer
, ')');
1161 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1163 newline_and_indent (buffer
, spc
+ 2);
1164 pp_character (buffer
, '{');
1165 pp_newline (buffer
);
1166 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1167 newline_and_indent (buffer
, spc
+ 2);
1168 pp_character (buffer
, '}');
1173 /* Dump a GIMPLE_OMP_CONTINUE tuple on the pretty_printer BUFFER. */
1176 dump_gimple_omp_continue (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1178 if (flags
& TDF_RAW
)
1180 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %T>", gs
,
1181 gimple_omp_continue_control_def (gs
),
1182 gimple_omp_continue_control_use (gs
));
1186 pp_string (buffer
, "#pragma omp continue (");
1187 dump_generic_node (buffer
, gimple_omp_continue_control_def (gs
),
1189 pp_character (buffer
, ',');
1191 dump_generic_node (buffer
, gimple_omp_continue_control_use (gs
),
1193 pp_character (buffer
, ')');
1197 /* Dump a GIMPLE_OMP_SINGLE tuple on the pretty_printer BUFFER. */
1200 dump_gimple_omp_single (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1202 if (flags
& TDF_RAW
)
1204 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1205 gimple_omp_body (gs
));
1206 dump_omp_clauses (buffer
, gimple_omp_single_clauses (gs
), spc
, flags
);
1207 dump_gimple_fmt (buffer
, spc
, flags
, " >");
1211 pp_string (buffer
, "#pragma omp single");
1212 dump_omp_clauses (buffer
, gimple_omp_single_clauses (gs
), spc
, flags
);
1213 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1215 newline_and_indent (buffer
, spc
+ 2);
1216 pp_character (buffer
, '{');
1217 pp_newline (buffer
);
1218 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1219 newline_and_indent (buffer
, spc
+ 2);
1220 pp_character (buffer
, '}');
1225 /* Dump a GIMPLE_OMP_SECTIONS tuple on the pretty_printer BUFFER. */
1228 dump_gimple_omp_sections (pretty_printer
*buffer
, gimple gs
, int spc
,
1231 if (flags
& TDF_RAW
)
1233 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1234 gimple_omp_body (gs
));
1235 dump_omp_clauses (buffer
, gimple_omp_sections_clauses (gs
), spc
, flags
);
1236 dump_gimple_fmt (buffer
, spc
, flags
, " >");
1240 pp_string (buffer
, "#pragma omp sections");
1241 if (gimple_omp_sections_control (gs
))
1243 pp_string (buffer
, " <");
1244 dump_generic_node (buffer
, gimple_omp_sections_control (gs
), spc
,
1246 pp_character (buffer
, '>');
1248 dump_omp_clauses (buffer
, gimple_omp_sections_clauses (gs
), spc
, flags
);
1249 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1251 newline_and_indent (buffer
, spc
+ 2);
1252 pp_character (buffer
, '{');
1253 pp_newline (buffer
);
1254 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1255 newline_and_indent (buffer
, spc
+ 2);
1256 pp_character (buffer
, '}');
1261 /* Dump a GIMPLE_OMP_{MASTER,ORDERED,SECTION} tuple on the pretty_printer
1265 dump_gimple_omp_block (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1267 if (flags
& TDF_RAW
)
1268 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S> >", gs
,
1269 gimple_omp_body (gs
));
1272 switch (gimple_code (gs
))
1274 case GIMPLE_OMP_MASTER
:
1275 pp_string (buffer
, "#pragma omp master");
1277 case GIMPLE_OMP_ORDERED
:
1278 pp_string (buffer
, "#pragma omp ordered");
1280 case GIMPLE_OMP_SECTION
:
1281 pp_string (buffer
, "#pragma omp section");
1286 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1288 newline_and_indent (buffer
, spc
+ 2);
1289 pp_character (buffer
, '{');
1290 pp_newline (buffer
);
1291 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1292 newline_and_indent (buffer
, spc
+ 2);
1293 pp_character (buffer
, '}');
1298 /* Dump a GIMPLE_OMP_CRITICAL tuple on the pretty_printer BUFFER. */
1301 dump_gimple_omp_critical (pretty_printer
*buffer
, gimple gs
, int spc
,
1304 if (flags
& TDF_RAW
)
1305 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S> >", gs
,
1306 gimple_omp_body (gs
));
1309 pp_string (buffer
, "#pragma omp critical");
1310 if (gimple_omp_critical_name (gs
))
1312 pp_string (buffer
, " (");
1313 dump_generic_node (buffer
, gimple_omp_critical_name (gs
), spc
,
1315 pp_character (buffer
, ')');
1317 if (!gimple_seq_empty_p (gimple_omp_body (gs
)))
1319 newline_and_indent (buffer
, spc
+ 2);
1320 pp_character (buffer
, '{');
1321 pp_newline (buffer
);
1322 dump_gimple_seq (buffer
, gimple_omp_body (gs
), spc
+ 4, flags
);
1323 newline_and_indent (buffer
, spc
+ 2);
1324 pp_character (buffer
, '}');
1329 /* Dump a GIMPLE_OMP_RETURN tuple on the pretty_printer BUFFER. */
1332 dump_gimple_omp_return (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1334 if (flags
& TDF_RAW
)
1336 dump_gimple_fmt (buffer
, spc
, flags
, "%G <nowait=%d>", gs
,
1337 (int) gimple_omp_return_nowait_p (gs
));
1341 pp_string (buffer
, "#pragma omp return");
1342 if (gimple_omp_return_nowait_p (gs
))
1343 pp_string (buffer
, "(nowait)");
1347 /* Dump a GIMPLE_TRANSACTION tuple on the pretty_printer BUFFER. */
1350 dump_gimple_transaction (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1352 unsigned subcode
= gimple_transaction_subcode (gs
);
1354 if (flags
& TDF_RAW
)
1356 dump_gimple_fmt (buffer
, spc
, flags
,
1357 "%G [SUBCODE=%x,LABEL=%T] <%+BODY <%S> >",
1358 gs
, subcode
, gimple_transaction_label (gs
),
1359 gimple_transaction_body (gs
));
1363 if (subcode
& GTMA_IS_OUTER
)
1364 pp_string (buffer
, "__transaction_atomic [[outer]]");
1365 else if (subcode
& GTMA_IS_RELAXED
)
1366 pp_string (buffer
, "__transaction_relaxed");
1368 pp_string (buffer
, "__transaction_atomic");
1369 subcode
&= ~GTMA_DECLARATION_MASK
;
1371 if (subcode
|| gimple_transaction_label (gs
))
1373 pp_string (buffer
, " //");
1374 if (gimple_transaction_label (gs
))
1376 pp_string (buffer
, " LABEL=");
1377 dump_generic_node (buffer
, gimple_transaction_label (gs
),
1382 pp_string (buffer
, " SUBCODE=[ ");
1383 if (subcode
& GTMA_HAVE_ABORT
)
1385 pp_string (buffer
, "GTMA_HAVE_ABORT ");
1386 subcode
&= ~GTMA_HAVE_ABORT
;
1388 if (subcode
& GTMA_HAVE_LOAD
)
1390 pp_string (buffer
, "GTMA_HAVE_LOAD ");
1391 subcode
&= ~GTMA_HAVE_LOAD
;
1393 if (subcode
& GTMA_HAVE_STORE
)
1395 pp_string (buffer
, "GTMA_HAVE_STORE ");
1396 subcode
&= ~GTMA_HAVE_STORE
;
1398 if (subcode
& GTMA_MAY_ENTER_IRREVOCABLE
)
1400 pp_string (buffer
, "GTMA_MAY_ENTER_IRREVOCABLE ");
1401 subcode
&= ~GTMA_MAY_ENTER_IRREVOCABLE
;
1403 if (subcode
& GTMA_DOES_GO_IRREVOCABLE
)
1405 pp_string (buffer
, "GTMA_DOES_GO_IRREVOCABLE ");
1406 subcode
&= ~GTMA_DOES_GO_IRREVOCABLE
;
1409 pp_printf (buffer
, "0x%x ", subcode
);
1410 pp_string (buffer
, "]");
1414 if (!gimple_seq_empty_p (gimple_transaction_body (gs
)))
1416 newline_and_indent (buffer
, spc
+ 2);
1417 pp_character (buffer
, '{');
1418 pp_newline (buffer
);
1419 dump_gimple_seq (buffer
, gimple_transaction_body (gs
),
1421 newline_and_indent (buffer
, spc
+ 2);
1422 pp_character (buffer
, '}');
1427 /* Dump a GIMPLE_ASM tuple on the pretty_printer BUFFER, SPC spaces of
1428 indent. FLAGS specifies details to show in the dump (see TDF_* in
1432 dump_gimple_asm (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1434 unsigned int i
, n
, f
, fields
;
1436 if (flags
& TDF_RAW
)
1438 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+STRING <%n%s%n>", gs
,
1439 gimple_asm_string (gs
));
1441 n
= gimple_asm_noutputs (gs
);
1444 newline_and_indent (buffer
, spc
+ 2);
1445 pp_string (buffer
, "OUTPUT: ");
1446 for (i
= 0; i
< n
; i
++)
1448 dump_generic_node (buffer
, gimple_asm_output_op (gs
, i
),
1451 pp_string (buffer
, ", ");
1455 n
= gimple_asm_ninputs (gs
);
1458 newline_and_indent (buffer
, spc
+ 2);
1459 pp_string (buffer
, "INPUT: ");
1460 for (i
= 0; i
< n
; i
++)
1462 dump_generic_node (buffer
, gimple_asm_input_op (gs
, i
),
1465 pp_string (buffer
, ", ");
1469 n
= gimple_asm_nclobbers (gs
);
1472 newline_and_indent (buffer
, spc
+ 2);
1473 pp_string (buffer
, "CLOBBER: ");
1474 for (i
= 0; i
< n
; i
++)
1476 dump_generic_node (buffer
, gimple_asm_clobber_op (gs
, i
),
1479 pp_string (buffer
, ", ");
1483 n
= gimple_asm_nlabels (gs
);
1486 newline_and_indent (buffer
, spc
+ 2);
1487 pp_string (buffer
, "LABEL: ");
1488 for (i
= 0; i
< n
; i
++)
1490 dump_generic_node (buffer
, gimple_asm_label_op (gs
, i
),
1493 pp_string (buffer
, ", ");
1497 newline_and_indent (buffer
, spc
);
1498 pp_character (buffer
, '>');
1502 pp_string (buffer
, "__asm__");
1503 if (gimple_asm_volatile_p (gs
))
1504 pp_string (buffer
, " __volatile__");
1505 if (gimple_asm_nlabels (gs
))
1506 pp_string (buffer
, " goto");
1507 pp_string (buffer
, "(\"");
1508 pp_string (buffer
, gimple_asm_string (gs
));
1509 pp_string (buffer
, "\"");
1511 if (gimple_asm_nlabels (gs
))
1513 else if (gimple_asm_nclobbers (gs
))
1515 else if (gimple_asm_ninputs (gs
))
1517 else if (gimple_asm_noutputs (gs
))
1522 for (f
= 0; f
< fields
; ++f
)
1524 pp_string (buffer
, " : ");
1529 n
= gimple_asm_noutputs (gs
);
1530 for (i
= 0; i
< n
; i
++)
1532 dump_generic_node (buffer
, gimple_asm_output_op (gs
, i
),
1535 pp_string (buffer
, ", ");
1540 n
= gimple_asm_ninputs (gs
);
1541 for (i
= 0; i
< n
; i
++)
1543 dump_generic_node (buffer
, gimple_asm_input_op (gs
, i
),
1546 pp_string (buffer
, ", ");
1551 n
= gimple_asm_nclobbers (gs
);
1552 for (i
= 0; i
< n
; i
++)
1554 dump_generic_node (buffer
, gimple_asm_clobber_op (gs
, i
),
1557 pp_string (buffer
, ", ");
1562 n
= gimple_asm_nlabels (gs
);
1563 for (i
= 0; i
< n
; i
++)
1565 dump_generic_node (buffer
, gimple_asm_label_op (gs
, i
),
1568 pp_string (buffer
, ", ");
1577 pp_string (buffer
, ");");
1582 /* Dump a PHI node PHI. BUFFER, SPC and FLAGS are as in
1583 dump_gimple_stmt. */
1586 dump_gimple_phi (pretty_printer
*buffer
, gimple phi
, int spc
, int flags
)
1589 tree lhs
= gimple_phi_result (phi
);
1591 if (flags
& TDF_ALIAS
1592 && POINTER_TYPE_P (TREE_TYPE (lhs
))
1593 && SSA_NAME_PTR_INFO (lhs
))
1595 unsigned int align
, misalign
;
1596 struct ptr_info_def
*pi
= SSA_NAME_PTR_INFO (lhs
);
1597 pp_string (buffer
, "PT = ");
1598 pp_points_to_solution (buffer
, &pi
->pt
);
1599 newline_and_indent (buffer
, spc
);
1600 if (get_ptr_info_alignment (pi
, &align
, &misalign
))
1602 pp_printf (buffer
, "# ALIGN = %u, MISALIGN = %u", align
, misalign
);
1603 newline_and_indent (buffer
, spc
);
1605 pp_string (buffer
, "# ");
1608 if (flags
& TDF_RAW
)
1609 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, ", phi
,
1610 gimple_phi_result (phi
));
1613 dump_generic_node (buffer
, lhs
, spc
, flags
, false);
1614 pp_string (buffer
, " = PHI <");
1616 for (i
= 0; i
< gimple_phi_num_args (phi
); i
++)
1618 if ((flags
& TDF_LINENO
) && gimple_phi_arg_has_location (phi
, i
))
1620 expanded_location xloc
;
1622 xloc
= expand_location (gimple_phi_arg_location (phi
, i
));
1623 pp_character (buffer
, '[');
1626 pp_string (buffer
, xloc
.file
);
1627 pp_string (buffer
, " : ");
1629 pp_decimal_int (buffer
, xloc
.line
);
1630 pp_string (buffer
, ":");
1631 pp_decimal_int (buffer
, xloc
.column
);
1632 pp_string (buffer
, "] ");
1634 dump_generic_node (buffer
, gimple_phi_arg_def (phi
, i
), spc
, flags
,
1636 pp_character (buffer
, '(');
1637 pp_decimal_int (buffer
, gimple_phi_arg_edge (phi
, i
)->src
->index
);
1638 pp_character (buffer
, ')');
1639 if (i
< gimple_phi_num_args (phi
) - 1)
1640 pp_string (buffer
, ", ");
1642 pp_character (buffer
, '>');
1646 /* Dump a GIMPLE_OMP_PARALLEL tuple on the pretty_printer BUFFER, SPC spaces
1647 of indent. FLAGS specifies details to show in the dump (see TDF_* in
1651 dump_gimple_omp_parallel (pretty_printer
*buffer
, gimple gs
, int spc
,
1654 if (flags
& TDF_RAW
)
1656 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1657 gimple_omp_body (gs
));
1658 dump_omp_clauses (buffer
, gimple_omp_parallel_clauses (gs
), spc
, flags
);
1659 dump_gimple_fmt (buffer
, spc
, flags
, " >, %T, %T%n>",
1660 gimple_omp_parallel_child_fn (gs
),
1661 gimple_omp_parallel_data_arg (gs
));
1666 pp_string (buffer
, "#pragma omp parallel");
1667 dump_omp_clauses (buffer
, gimple_omp_parallel_clauses (gs
), spc
, flags
);
1668 if (gimple_omp_parallel_child_fn (gs
))
1670 pp_string (buffer
, " [child fn: ");
1671 dump_generic_node (buffer
, gimple_omp_parallel_child_fn (gs
),
1673 pp_string (buffer
, " (");
1674 if (gimple_omp_parallel_data_arg (gs
))
1675 dump_generic_node (buffer
, gimple_omp_parallel_data_arg (gs
),
1678 pp_string (buffer
, "???");
1679 pp_string (buffer
, ")]");
1681 body
= gimple_omp_body (gs
);
1682 if (body
&& gimple_code (gimple_seq_first_stmt (body
)) != GIMPLE_BIND
)
1684 newline_and_indent (buffer
, spc
+ 2);
1685 pp_character (buffer
, '{');
1686 pp_newline (buffer
);
1687 dump_gimple_seq (buffer
, body
, spc
+ 4, flags
);
1688 newline_and_indent (buffer
, spc
+ 2);
1689 pp_character (buffer
, '}');
1693 pp_newline (buffer
);
1694 dump_gimple_seq (buffer
, body
, spc
+ 2, flags
);
1700 /* Dump a GIMPLE_OMP_TASK tuple on the pretty_printer BUFFER, SPC spaces
1701 of indent. FLAGS specifies details to show in the dump (see TDF_* in
1705 dump_gimple_omp_task (pretty_printer
*buffer
, gimple gs
, int spc
,
1708 if (flags
& TDF_RAW
)
1710 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%+BODY <%S>%nCLAUSES <", gs
,
1711 gimple_omp_body (gs
));
1712 dump_omp_clauses (buffer
, gimple_omp_task_clauses (gs
), spc
, flags
);
1713 dump_gimple_fmt (buffer
, spc
, flags
, " >, %T, %T, %T, %T, %T%n>",
1714 gimple_omp_task_child_fn (gs
),
1715 gimple_omp_task_data_arg (gs
),
1716 gimple_omp_task_copy_fn (gs
),
1717 gimple_omp_task_arg_size (gs
),
1718 gimple_omp_task_arg_size (gs
));
1723 pp_string (buffer
, "#pragma omp task");
1724 dump_omp_clauses (buffer
, gimple_omp_task_clauses (gs
), spc
, flags
);
1725 if (gimple_omp_task_child_fn (gs
))
1727 pp_string (buffer
, " [child fn: ");
1728 dump_generic_node (buffer
, gimple_omp_task_child_fn (gs
),
1730 pp_string (buffer
, " (");
1731 if (gimple_omp_task_data_arg (gs
))
1732 dump_generic_node (buffer
, gimple_omp_task_data_arg (gs
),
1735 pp_string (buffer
, "???");
1736 pp_string (buffer
, ")]");
1738 body
= gimple_omp_body (gs
);
1739 if (body
&& gimple_code (gimple_seq_first_stmt (body
)) != GIMPLE_BIND
)
1741 newline_and_indent (buffer
, spc
+ 2);
1742 pp_character (buffer
, '{');
1743 pp_newline (buffer
);
1744 dump_gimple_seq (buffer
, body
, spc
+ 4, flags
);
1745 newline_and_indent (buffer
, spc
+ 2);
1746 pp_character (buffer
, '}');
1750 pp_newline (buffer
);
1751 dump_gimple_seq (buffer
, body
, spc
+ 2, flags
);
1757 /* Dump a GIMPLE_OMP_ATOMIC_LOAD tuple on the pretty_printer BUFFER, SPC
1758 spaces of indent. FLAGS specifies details to show in the dump (see TDF_*
1762 dump_gimple_omp_atomic_load (pretty_printer
*buffer
, gimple gs
, int spc
,
1765 if (flags
& TDF_RAW
)
1767 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T, %T>", gs
,
1768 gimple_omp_atomic_load_lhs (gs
),
1769 gimple_omp_atomic_load_rhs (gs
));
1773 pp_string (buffer
, "#pragma omp atomic_load");
1774 if (gimple_omp_atomic_need_value_p (gs
))
1775 pp_string (buffer
, " [needed]");
1776 newline_and_indent (buffer
, spc
+ 2);
1777 dump_generic_node (buffer
, gimple_omp_atomic_load_lhs (gs
),
1780 pp_character (buffer
, '=');
1782 pp_character (buffer
, '*');
1783 dump_generic_node (buffer
, gimple_omp_atomic_load_rhs (gs
),
1788 /* Dump a GIMPLE_OMP_ATOMIC_STORE tuple on the pretty_printer BUFFER, SPC
1789 spaces of indent. FLAGS specifies details to show in the dump (see TDF_*
1793 dump_gimple_omp_atomic_store (pretty_printer
*buffer
, gimple gs
, int spc
,
1796 if (flags
& TDF_RAW
)
1798 dump_gimple_fmt (buffer
, spc
, flags
, "%G <%T>", gs
,
1799 gimple_omp_atomic_store_val (gs
));
1803 pp_string (buffer
, "#pragma omp atomic_store ");
1804 if (gimple_omp_atomic_need_value_p (gs
))
1805 pp_string (buffer
, "[needed] ");
1806 pp_character (buffer
, '(');
1807 dump_generic_node (buffer
, gimple_omp_atomic_store_val (gs
),
1809 pp_character (buffer
, ')');
1814 /* Dump all the memory operands for statement GS. BUFFER, SPC and
1815 FLAGS are as in dump_gimple_stmt. */
1818 dump_gimple_mem_ops (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1820 tree vdef
= gimple_vdef (gs
);
1821 tree vuse
= gimple_vuse (gs
);
1823 if (!ssa_operands_active () || !gimple_references_memory_p (gs
))
1826 if (vdef
!= NULL_TREE
)
1828 pp_string (buffer
, "# ");
1829 dump_generic_node (buffer
, vdef
, spc
+ 2, flags
, false);
1830 pp_string (buffer
, " = VDEF <");
1831 dump_generic_node (buffer
, vuse
, spc
+ 2, flags
, false);
1832 pp_character (buffer
, '>');
1833 newline_and_indent (buffer
, spc
);
1835 else if (vuse
!= NULL_TREE
)
1837 pp_string (buffer
, "# VUSE <");
1838 dump_generic_node (buffer
, vuse
, spc
+ 2, flags
, false);
1839 pp_character (buffer
, '>');
1840 newline_and_indent (buffer
, spc
);
1845 /* Dump the gimple statement GS on the pretty printer BUFFER, SPC
1846 spaces of indent. FLAGS specifies details to show in the dump (see
1847 TDF_* in tree-pass.h). */
1850 dump_gimple_stmt (pretty_printer
*buffer
, gimple gs
, int spc
, int flags
)
1855 if (flags
& TDF_STMTADDR
)
1856 pp_printf (buffer
, "<&%p> ", (void *) gs
);
1858 if ((flags
& TDF_LINENO
) && gimple_has_location (gs
))
1860 expanded_location xloc
= expand_location (gimple_location (gs
));
1861 pp_character (buffer
, '[');
1864 pp_string (buffer
, xloc
.file
);
1865 pp_string (buffer
, " : ");
1867 pp_decimal_int (buffer
, xloc
.line
);
1868 pp_string (buffer
, ":");
1869 pp_decimal_int (buffer
, xloc
.column
);
1870 pp_string (buffer
, "] ");
1875 int lp_nr
= lookup_stmt_eh_lp (gs
);
1877 pp_printf (buffer
, "[LP %d] ", lp_nr
);
1879 pp_printf (buffer
, "[MNT %d] ", -lp_nr
);
1882 if ((flags
& (TDF_VOPS
|TDF_MEMSYMS
))
1883 && gimple_has_mem_ops (gs
))
1884 dump_gimple_mem_ops (buffer
, gs
, spc
, flags
);
1886 if ((flags
& TDF_ALIAS
)
1887 && gimple_has_lhs (gs
))
1889 tree lhs
= gimple_get_lhs (gs
);
1890 if (TREE_CODE (lhs
) == SSA_NAME
1891 && POINTER_TYPE_P (TREE_TYPE (lhs
))
1892 && SSA_NAME_PTR_INFO (lhs
))
1894 unsigned int align
, misalign
;
1895 struct ptr_info_def
*pi
= SSA_NAME_PTR_INFO (lhs
);
1896 pp_string (buffer
, "# PT = ");
1897 pp_points_to_solution (buffer
, &pi
->pt
);
1898 newline_and_indent (buffer
, spc
);
1899 if (get_ptr_info_alignment (pi
, &align
, &misalign
))
1901 pp_printf (buffer
, "# ALIGN = %u, MISALIGN = %u",
1903 newline_and_indent (buffer
, spc
);
1908 switch (gimple_code (gs
))
1911 dump_gimple_asm (buffer
, gs
, spc
, flags
);
1915 dump_gimple_assign (buffer
, gs
, spc
, flags
);
1919 dump_gimple_bind (buffer
, gs
, spc
, flags
);
1923 dump_gimple_call (buffer
, gs
, spc
, flags
);
1927 dump_gimple_cond (buffer
, gs
, spc
, flags
);
1931 dump_gimple_label (buffer
, gs
, spc
, flags
);
1935 dump_gimple_goto (buffer
, gs
, spc
, flags
);
1939 pp_string (buffer
, "GIMPLE_NOP");
1943 dump_gimple_return (buffer
, gs
, spc
, flags
);
1947 dump_gimple_switch (buffer
, gs
, spc
, flags
);
1951 dump_gimple_try (buffer
, gs
, spc
, flags
);
1955 dump_gimple_phi (buffer
, gs
, spc
, flags
);
1958 case GIMPLE_OMP_PARALLEL
:
1959 dump_gimple_omp_parallel (buffer
, gs
, spc
, flags
);
1962 case GIMPLE_OMP_TASK
:
1963 dump_gimple_omp_task (buffer
, gs
, spc
, flags
);
1966 case GIMPLE_OMP_ATOMIC_LOAD
:
1967 dump_gimple_omp_atomic_load (buffer
, gs
, spc
, flags
);
1971 case GIMPLE_OMP_ATOMIC_STORE
:
1972 dump_gimple_omp_atomic_store (buffer
, gs
, spc
, flags
);
1975 case GIMPLE_OMP_FOR
:
1976 dump_gimple_omp_for (buffer
, gs
, spc
, flags
);
1979 case GIMPLE_OMP_CONTINUE
:
1980 dump_gimple_omp_continue (buffer
, gs
, spc
, flags
);
1983 case GIMPLE_OMP_SINGLE
:
1984 dump_gimple_omp_single (buffer
, gs
, spc
, flags
);
1987 case GIMPLE_OMP_RETURN
:
1988 dump_gimple_omp_return (buffer
, gs
, spc
, flags
);
1991 case GIMPLE_OMP_SECTIONS
:
1992 dump_gimple_omp_sections (buffer
, gs
, spc
, flags
);
1995 case GIMPLE_OMP_SECTIONS_SWITCH
:
1996 pp_string (buffer
, "GIMPLE_SECTIONS_SWITCH");
1999 case GIMPLE_OMP_MASTER
:
2000 case GIMPLE_OMP_ORDERED
:
2001 case GIMPLE_OMP_SECTION
:
2002 dump_gimple_omp_block (buffer
, gs
, spc
, flags
);
2005 case GIMPLE_OMP_CRITICAL
:
2006 dump_gimple_omp_critical (buffer
, gs
, spc
, flags
);
2010 dump_gimple_catch (buffer
, gs
, spc
, flags
);
2013 case GIMPLE_EH_FILTER
:
2014 dump_gimple_eh_filter (buffer
, gs
, spc
, flags
);
2017 case GIMPLE_EH_MUST_NOT_THROW
:
2018 dump_gimple_eh_must_not_throw (buffer
, gs
, spc
, flags
);
2021 case GIMPLE_EH_ELSE
:
2022 dump_gimple_eh_else (buffer
, gs
, spc
, flags
);
2026 dump_gimple_resx (buffer
, gs
, spc
, flags
);
2029 case GIMPLE_EH_DISPATCH
:
2030 dump_gimple_eh_dispatch (buffer
, gs
, spc
, flags
);
2034 dump_gimple_debug (buffer
, gs
, spc
, flags
);
2037 case GIMPLE_PREDICT
:
2038 pp_string (buffer
, "// predicted ");
2039 if (gimple_predict_outcome (gs
))
2040 pp_string (buffer
, "likely by ");
2042 pp_string (buffer
, "unlikely by ");
2043 pp_string (buffer
, predictor_name (gimple_predict_predictor (gs
)));
2044 pp_string (buffer
, " predictor.");
2047 case GIMPLE_TRANSACTION
:
2048 dump_gimple_transaction (buffer
, gs
, spc
, flags
);
2055 /* If we're building a diagnostic, the formatted text will be
2056 written into BUFFER's stream by the caller; otherwise, write it
2058 if (!(flags
& TDF_DIAGNOSTIC
))
2059 pp_write_text_to_stream (buffer
);
2063 /* Dumps header of basic block BB to buffer BUFFER indented by INDENT
2064 spaces and details described by flags. */
2067 dump_bb_header (pretty_printer
*buffer
, basic_block bb
, int indent
, int flags
)
2073 if (flags
& TDF_BLOCKS
)
2076 pp_string (buffer
, "# BLOCK ");
2077 pp_decimal_int (buffer
, bb
->index
);
2080 pp_string (buffer
, " freq:");
2081 pp_decimal_int (buffer
, bb
->frequency
);
2085 pp_string (buffer
, " count:");
2086 pp_widest_integer (buffer
, bb
->count
);
2089 if (flags
& TDF_LINENO
)
2091 gimple_stmt_iterator gsi
;
2093 for (gsi
= gsi_start_bb (bb
); !gsi_end_p (gsi
); gsi_next (&gsi
))
2094 if (!is_gimple_debug (gsi_stmt (gsi
))
2095 && get_lineno (gsi_stmt (gsi
)) != UNKNOWN_LOCATION
)
2097 pp_string (buffer
, ", starting at line ");
2098 pp_decimal_int (buffer
, get_lineno (gsi_stmt (gsi
)));
2102 if (bb
->discriminator
)
2104 pp_string (buffer
, ", discriminator ");
2105 pp_decimal_int (buffer
, bb
->discriminator
);
2108 newline_and_indent (buffer
, indent
);
2110 pp_string (buffer
, "# PRED:");
2111 pp_write_text_to_stream (buffer
);
2112 FOR_EACH_EDGE (e
, ei
, bb
->preds
)
2113 if (flags
& TDF_SLIM
)
2115 pp_character (buffer
, ' ');
2116 if (e
->src
== ENTRY_BLOCK_PTR
)
2117 pp_string (buffer
, "ENTRY");
2119 pp_decimal_int (buffer
, e
->src
->index
);
2122 dump_edge_info (buffer
->buffer
->stream
, e
, 0);
2123 pp_newline (buffer
);
2127 stmt
= first_stmt (bb
);
2128 if (!stmt
|| gimple_code (stmt
) != GIMPLE_LABEL
)
2130 INDENT (indent
- 2);
2131 pp_string (buffer
, "<bb ");
2132 pp_decimal_int (buffer
, bb
->index
);
2133 pp_string (buffer
, ">:");
2134 pp_newline (buffer
);
2137 pp_write_text_to_stream (buffer
);
2139 check_bb_profile (bb
, buffer
->buffer
->stream
);
2143 /* Dumps end of basic block BB to buffer BUFFER indented by INDENT
2147 dump_bb_end (pretty_printer
*buffer
, basic_block bb
, int indent
, int flags
)
2153 pp_string (buffer
, "# SUCC:");
2154 pp_write_text_to_stream (buffer
);
2155 FOR_EACH_EDGE (e
, ei
, bb
->succs
)
2156 if (flags
& TDF_SLIM
)
2158 pp_character (buffer
, ' ');
2159 if (e
->dest
== EXIT_BLOCK_PTR
)
2160 pp_string (buffer
, "EXIT");
2162 pp_decimal_int (buffer
, e
->dest
->index
);
2165 dump_edge_info (buffer
->buffer
->stream
, e
, 1);
2166 pp_newline (buffer
);
2170 /* Dump PHI nodes of basic block BB to BUFFER with details described
2171 by FLAGS and indented by INDENT spaces. */
2174 dump_phi_nodes (pretty_printer
*buffer
, basic_block bb
, int indent
, int flags
)
2176 gimple_stmt_iterator i
;
2178 for (i
= gsi_start_phis (bb
); !gsi_end_p (i
); gsi_next (&i
))
2180 gimple phi
= gsi_stmt (i
);
2181 if (is_gimple_reg (gimple_phi_result (phi
)) || (flags
& TDF_VOPS
))
2184 pp_string (buffer
, "# ");
2185 dump_gimple_phi (buffer
, phi
, indent
, flags
);
2186 pp_newline (buffer
);
2192 /* Dump jump to basic block BB that is represented implicitly in the cfg
2196 pp_cfg_jump (pretty_printer
*buffer
, basic_block bb
)
2200 stmt
= first_stmt (bb
);
2202 pp_string (buffer
, "goto <bb ");
2203 pp_decimal_int (buffer
, bb
->index
);
2204 pp_character (buffer
, '>');
2205 if (stmt
&& gimple_code (stmt
) == GIMPLE_LABEL
)
2207 pp_string (buffer
, " (");
2208 dump_generic_node (buffer
, gimple_label_label (stmt
), 0, 0, false);
2209 pp_character (buffer
, ')');
2210 pp_semicolon (buffer
);
2213 pp_semicolon (buffer
);
2217 /* Dump edges represented implicitly in basic block BB to BUFFER, indented
2218 by INDENT spaces, with details given by FLAGS. */
2221 dump_implicit_edges (pretty_printer
*buffer
, basic_block bb
, int indent
,
2227 stmt
= last_stmt (bb
);
2229 if (stmt
&& gimple_code (stmt
) == GIMPLE_COND
)
2231 edge true_edge
, false_edge
;
2233 /* When we are emitting the code or changing CFG, it is possible that
2234 the edges are not yet created. When we are using debug_bb in such
2235 a situation, we do not want it to crash. */
2236 if (EDGE_COUNT (bb
->succs
) != 2)
2238 extract_true_false_edges_from_block (bb
, &true_edge
, &false_edge
);
2240 INDENT (indent
+ 2);
2241 pp_cfg_jump (buffer
, true_edge
->dest
);
2242 newline_and_indent (buffer
, indent
);
2243 pp_string (buffer
, "else");
2244 newline_and_indent (buffer
, indent
+ 2);
2245 pp_cfg_jump (buffer
, false_edge
->dest
);
2246 pp_newline (buffer
);
2250 /* If there is a fallthru edge, we may need to add an artificial
2251 goto to the dump. */
2252 e
= find_fallthru_edge (bb
->succs
);
2254 if (e
&& e
->dest
!= bb
->next_bb
)
2258 if ((flags
& TDF_LINENO
)
2259 && e
->goto_locus
!= UNKNOWN_LOCATION
2262 expanded_location goto_xloc
;
2263 goto_xloc
= expand_location (e
->goto_locus
);
2264 pp_character (buffer
, '[');
2267 pp_string (buffer
, goto_xloc
.file
);
2268 pp_string (buffer
, " : ");
2270 pp_decimal_int (buffer
, goto_xloc
.line
);
2271 pp_string (buffer
, " : ");
2272 pp_decimal_int (buffer
, goto_xloc
.column
);
2273 pp_string (buffer
, "] ");
2276 pp_cfg_jump (buffer
, e
->dest
);
2277 pp_newline (buffer
);
2282 /* Dumps basic block BB to buffer BUFFER with details described by FLAGS and
2283 indented by INDENT spaces. */
2286 gimple_dump_bb_buff (pretty_printer
*buffer
, basic_block bb
, int indent
,
2289 gimple_stmt_iterator gsi
;
2291 int label_indent
= indent
- 2;
2293 if (label_indent
< 0)
2296 dump_bb_header (buffer
, bb
, indent
, flags
);
2297 dump_phi_nodes (buffer
, bb
, indent
, flags
);
2299 for (gsi
= gsi_start_bb (bb
); !gsi_end_p (gsi
); gsi_next (&gsi
))
2303 stmt
= gsi_stmt (gsi
);
2305 curr_indent
= gimple_code (stmt
) == GIMPLE_LABEL
? label_indent
: indent
;
2307 INDENT (curr_indent
);
2308 dump_gimple_stmt (buffer
, stmt
, curr_indent
, flags
);
2309 pp_newline (buffer
);
2310 dump_histograms_for_stmt (cfun
, buffer
->buffer
->stream
, stmt
);
2313 dump_implicit_edges (buffer
, bb
, indent
, flags
);
2315 if (flags
& TDF_BLOCKS
)
2316 dump_bb_end (buffer
, bb
, indent
, flags
);
2320 /* Dumps basic block BB to FILE with details described by FLAGS and
2321 indented by INDENT spaces. */
2324 gimple_dump_bb (basic_block bb
, FILE *file
, int indent
, int flags
)
2326 maybe_init_pretty_print (file
);
2327 gimple_dump_bb_buff (&buffer
, bb
, indent
, flags
);