GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
#include "diagnostic.h"
#include "gimple-pretty-print.h"
#include "hashtab.h"
#include "bitmap.h"
#include "gimple.h"
#include "gimple-ssa.h"
#include "cgraph.h"
#include "tree-cfg.h"
#include "tree-ssanames.h"
#include "dumpfile.h"
#include "value-prof.h"
#include "trans-mem.h"
Macros | |
#define | INDENT(SPACE) do { int i; for (i = 0; i < SPACE; i++) pp_space (buffer); } while (0) |
#define | GIMPLE_NIY do_niy (buffer,gs) |
Pretty formatting of GIMPLE statements and expressions. Copyright (C) 2001-2013 Free Software Foundation, Inc. Contributed by Aldy Hernandez aldyh and Diego Novillo @red hat.c omdnovi llo@ googl e.co m
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/.
Referenced by pp_cfg_jump().
DEBUG_FUNCTION void debug | ( | ) |
References debug.
DEBUG_FUNCTION void debug_gimple_seq | ( | ) |
Print the GIMPLE sequence SEQ on stderr.
DEBUG_FUNCTION void debug_gimple_stmt | ( | ) |
Print the GIMPLE statement GS on stderr.
References buffer, pretty_printer::buffer, pp_needs_newline, and output_buffer::stream.
Referenced by gimple_move_stmt_histograms().
|
static |
Try to print on BUFFER a default message for the unrecognized gimple statement GS.
|
static |
Helper for dump_gimple_assign. Print the binary RHS of the assignment GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.
|
static |
Dump a GIMPLE_ASM tuple on the pretty_printer BUFFER, SPC spaces of indent. FLAGS specifies details to show in the dump (see TDF_* in dumpfile.h).
|
static |
Dump the gimple assignment GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.
|
static |
Dumps end of basic block BB to buffer BUFFER indented by INDENT spaces.
There is currently no GIMPLE-specific basic block info to dump.
References last_stmt().
|
static |
Dumps header of basic block BB to OUTF indented by INDENT spaces and details described by flags.
|
static |
Dump a GIMPLE_BIND tuple on the pretty_printer BUFFER, SPC spaces of indent. FLAGS specifies details to show in the dump (see TDF_* in dumpfile.h).
|
static |
Dump the call statement GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.
Dump the arguments of _ITM_beginTransaction sanely.
Get the transaction code properties.
|
static |
Dump the call arguments for a gimple call. BUFFER, FLAGS are as in dump_gimple_call.
|
static |
Dump a GIMPLE_CATCH tuple on the pretty_printer BUFFER, SPC spaces of indent. FLAGS specifies details to show in the dump (see TDF_* in dumpfile.h).
References dump_gimple_fmt(), and gimple_eh_must_not_throw_fndecl().
|
static |
Dump the gimple conditional GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.
|
static |
Dump a GIMPLE_DEBUG tuple on the pretty_printer BUFFER, SPC spaces of indent. FLAGS specifies details to show in the dump (see TDF_* in dumpfile.h).
References dump_gimple_fmt(), dump_omp_clauses(), gcc_unreachable, get_tree_code_name(), GF_OMP_FOR_KIND_DISTRIBUTE, GF_OMP_FOR_KIND_FOR, GF_OMP_FOR_KIND_SIMD, gimple_omp_body(), gimple_omp_for_clauses(), gimple_omp_for_collapse(), gimple_omp_for_cond(), gimple_omp_for_final(), gimple_omp_for_incr(), gimple_omp_for_index(), gimple_omp_for_initial(), and gimple_omp_for_kind().
|
static |
Dump a GIMPLE_EH_DISPATCH tuple on the pretty_printer BUFFER.
|
static |
Dump a GIMPLE_EH_ELSE tuple on the pretty_printer BUFFER, SPC spaces of indent. FLAGS specifies details to show in the dump (see TDF_* in dumpfile.h).
References dump_gimple_fmt(), and gimple_eh_dispatch_region().
|
static |
Dump a GIMPLE_EH_FILTER tuple on the pretty_printer BUFFER, SPC spaces of indent. FLAGS specifies details to show in the dump (see TDF_* in dumpfile.h).
References dump_gimple_fmt(), gimple_eh_else_e_body(), and gimple_eh_else_n_body().
|
static |
Dump a GIMPLE_EH_MUST_NOT_THROW tuple.
References dump_gimple_fmt(), and gimple_resx_region().
|
static |
A simple helper to pretty-print some of the gimple tuples in the printf style. The format modifiers are preceded by '' and are: 'G' - outputs a string corresponding to the code of the given gimple, 'S' - outputs a gimple_seq with indent of spc + 2, 'T' - outputs the tree t, 'd' - outputs an int as a decimal, 's' - outputs a string, 'n' - outputs a newline, 'x' - outputs an int as hexadecimal, '+' - increases indent by 2 then outputs a newline, '-' - decreases indent by 2 then outputs a newline.
References dump_generic_node(), dump_gimple_seq(), g, gcc_unreachable, gimple_code_name, newline_and_indent(), NULL_TREE, pp_decimal_int, pp_newline(), pp_scalar, and pp_string().
Referenced by dump_gimple_catch(), dump_gimple_debug(), dump_gimple_eh_else(), dump_gimple_eh_filter(), dump_gimple_eh_must_not_throw(), dump_gimple_omp_block(), dump_gimple_omp_parallel(), and dump_ssaname_info().
|
static |
Dump a GIMPLE_GOTO tuple on the pretty_printer BUFFER, SPC spaces of indent. FLAGS specifies details to show in the dump (see TDF_* in dumpfile.h).
References newline_and_indent(), and print_declaration().
|
static |
Dump a GIMPLE_LABEL tuple on the pretty_printer BUFFER, SPC spaces of indent. FLAGS specifies details to show in the dump (see TDF_* in dumpfils.h).
|
static |
Dump all the memory operands for statement GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.
|
static |
Dump a GIMPLE_OMP_ATOMIC_LOAD tuple on the pretty_printer BUFFER, SPC spaces of indent. FLAGS specifies details to show in the dump (see TDF_* in dumpfile.h).
|
static |
Dump a GIMPLE_OMP_ATOMIC_STORE tuple on the pretty_printer BUFFER, SPC spaces of indent. FLAGS specifies details to show in the dump (see TDF_* in dumpfile.h).
|
static |
Dump a GIMPLE_OMP_{MASTER,TASKGROUP,ORDERED,SECTION} tuple on the pretty_printer BUFFER.
References dump_generic_node(), dump_gimple_fmt(), dump_gimple_seq(), gimple_omp_body(), gimple_omp_critical_name(), gimple_seq_empty_p(), newline_and_indent(), pp_left_brace, pp_newline(), pp_right_brace, pp_right_paren, and pp_string().
|
static |
Dump a GIMPLE_OMP_CONTINUE tuple on the pretty_printer BUFFER.
|
static |
Dump a GIMPLE_OMP_CRITICAL tuple on the pretty_printer BUFFER.
|
static |
Dump a GIMPLE_OMP_FOR tuple on the pretty_printer BUFFER.
|
static |
Dump a GIMPLE_OMP_PARALLEL tuple on the pretty_printer BUFFER, SPC spaces of indent. FLAGS specifies details to show in the dump (see TDF_* in dumpfile.h).
References dump_generic_node(), dump_gimple_fmt(), dump_gimple_seq(), dump_omp_clauses(), gimple_omp_body(), gimple_omp_task_arg_size(), gimple_omp_task_child_fn(), gimple_omp_task_clauses(), gimple_omp_task_copy_fn(), gimple_omp_task_data_arg(), gimple_seq_first_stmt(), newline_and_indent(), pp_left_brace, pp_newline(), pp_right_brace, and pp_string().
|
static |
Dump a GIMPLE_OMP_RETURN tuple on the pretty_printer BUFFER.
References dump_generic_node(), gimple_transaction_label(), GTMA_DECLARATION_MASK, GTMA_HAVE_ABORT, GTMA_HAVE_LOAD, GTMA_IS_OUTER, GTMA_IS_RELAXED, and pp_string().
|
static |
Dump a GIMPLE_OMP_SECTIONS tuple on the pretty_printer BUFFER.
|
static |
Dump a GIMPLE_OMP_SINGLE tuple on the pretty_printer BUFFER.
|
static |
Dump a GIMPLE_OMP_TARGET tuple on the pretty_printer BUFFER.
References dump_gimple_seq(), gimple_omp_body(), newline_and_indent(), pp_character(), and pp_newline().
|
static |
Dump a GIMPLE_OMP_TASK tuple on the pretty_printer BUFFER, SPC spaces of indent. FLAGS specifies details to show in the dump (see TDF_* in dumpfile.h).
|
static |
Dump a GIMPLE_OMP_TEAMS tuple on the pretty_printer BUFFER.
References dump_generic_node(), dump_gimple_seq(), dump_omp_clauses(), gimple_omp_body(), gimple_omp_sections_clauses(), gimple_omp_sections_control(), gimple_seq_empty_p(), newline_and_indent(), pp_greater, pp_left_brace, pp_newline(), pp_right_brace, and pp_string().
|
static |
Dump a PHI node PHI. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1. The caller is responsible for calling pp_flush on BUFFER to finalize pretty printer. If COMMENT is true, print this after #.
|
static |
Dump a GIMPLE_RESX tuple on the pretty_printer BUFFER, SPC spaces of indent. FLAGS specifies details to show in the dump (see TDF_* in dumpfile.h).
|
static |
Dump the return statement GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.
|
static |
Print the GIMPLE sequence SEQ on BUFFER using SPC indentation spaces and FLAGS as in pp_gimple_stmt_1. The caller is responsible for calling pp_flush on BUFFER to finalize the pretty printer.
Referenced by dump_gimple_fmt(), dump_gimple_omp_block(), dump_gimple_omp_parallel(), dump_gimple_omp_target(), and dump_gimple_omp_teams().
|
static |
Dump the switch statement GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.
|
static |
Dump a GIMPLE_TRANSACTION tuple on the pretty_printer BUFFER.
References pp_string().
|
static |
Dump a GIMPLE_TRY tuple on the pretty_printer BUFFER, SPC spaces of indent. FLAGS specifies details to show in the dump (see TDF_* in dumpfile.h).
References newline_and_indent(), pp_left_brace, and pp_string().
|
static |
Dump edges represented implicitly in basic block BB to BUFFER, indented by INDENT spaces, with details given by FLAGS.
When we are emitting the code or changing CFG, it is possible that the edges are not yet created. When we are using debug_bb in such a situation, we do not want it to crash.
If there is a fallthru edge, we may need to add an artificial goto to the dump.
|
static |
Dump PHI nodes of basic block BB to BUFFER with details described by FLAGS and indented by INDENT spaces.
|
static |
Dump ptr_info and range_info for NODE on pretty_printer BUFFER with SPC spaces of indent.
References dump_generic_node(), dump_gimple_fmt(), expand_location(), gimple_phi_arg_def(), gimple_phi_arg_edge(), gimple_phi_arg_has_location(), gimple_phi_arg_location(), gimple_phi_num_args(), gimple_phi_result(), pp_colon, pp_decimal_int, pp_left_bracket, pp_left_paren, pp_right_paren, pp_string(), and TDF_LINENO.
|
static |
Helper for dump_gimple_assign. Print the ternary RHS of the assignment GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.
|
static |
Helper for dump_gimple_assign. Print the unary RHS of the assignment GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.
void gimple_dump_bb | ( | ) |
Dumps basic block BB to FILE with details described by FLAGS and indented by INDENT spaces.
|
static |
Dumps basic block BB to buffer BUFFER with details described by FLAGS and indented by INDENT spaces.
void gimple_dump_bb_for_graph | ( | ) |
Dumps basic block BB to pretty-printer PP with default dump flags and no indentation, for use as a label of a DOT graph record-node. ??? Should just use gimple_dump_bb_buff here, except that value profiling histogram dumping doesn't know about pretty-printers.
|
static |
Emit a newline and SPC indentation spaces to BUFFER.
Referenced by dump_block_node(), dump_gimple_fmt(), dump_gimple_goto(), dump_gimple_omp_block(), dump_gimple_omp_parallel(), dump_gimple_omp_target(), dump_gimple_omp_teams(), and dump_gimple_try().
|
static |
Dump jump to basic block BB that is represented implicitly in the cfg to BUFFER.
References edge_def::dest, expand_location(), edge_def::goto_locus, INDENT, pp_decimal_int, pp_left_bracket, pp_newline(), pp_string(), and UNKNOWN_LOCATION.
void pp_gimple_stmt_1 | ( | ) |
Print the gimple statement GS on the pretty printer BUFFER, SPC spaces of indent. FLAGS specifies details to show in the dump (see TDF_* in dumpfile.h). The caller is responsible for calling pp_flush on BUFFER to finalize the pretty printer.
Referenced by debug_rdg().
|
static |
Dump the points-to solution *PT to BUFFER.
References EXECUTE_IF_SET_IN_BITMAP, pp_decimal_int, pp_right_brace, pp_space, pp_string(), pt_solution::vars, and pt_solution::vars_contains_global.
void print_gimple_expr | ( | ) |
Print GIMPLE statement G to FILE using SPC indentation spaces and FLAGS as in pp_gimple_stmt_1. Print only the right-hand side of the statement.
Referenced by dom_opt_dom_walker::after_dom_children(), eliminate_avail(), forward_propagate_addr_expr(), simplify_binary_expression(), and test_for_singularity().
void print_gimple_seq | ( | ) |
Print GIMPLE sequence SEQ to FILE using SPC indentation spaces and FLAGS as in pp_gimple_stmt_1.
References TDF_MEMSYMS, and TDF_VOPS.
Referenced by move_sese_region_to_fn().
void print_gimple_stmt | ( | ) |
Print GIMPLE statement G to FILE using SPC indentation spaces and FLAGS as in pp_gimple_stmt_1.
Referenced by analyze_evolution_in_loop(), bb_with_exit_edge_p(), break_up_subtract(), build_new_reduction(), check_store(), collect_phi_def_edges(), copy_prop_visit_cond_stmt(), debug_data_reference(), dse_optimize_stmt(), dump_gimple_stmt(), dump_live_info(), dump_names_replaced_by(), eliminate_dom_walker::eliminate_dom_walker(), eliminate_phi(), eliminate_useless_phis(), find_uninit_use(), forward_edge_to_pdom(), get_required_cycles(), gimple_mod_pow2_value_transform(), ifcvt_memrefs_wont_trap(), is_phi_for_stmt(), is_use_properly_guarded(), linearize_expr(), lookup_avail_expr(), mark_all_reaching_defs_necessary(), ncd_for_two_cands(), optimize_unreachable(), process_switch(), register_new_update_set(), remove_exits_and_undefined_stmts(), rewrite_use_compare(), try_improve_iv_set(), and vrp_evaluate_conditional().