GCC Middle and Back End API Reference
tree-pretty-print.c File Reference

Functions

static const char * op_symbol (const_tree)
static void pretty_print_string (pretty_printer *, const char *)
static void newline_and_indent (pretty_printer *, int)
static void maybe_init_pretty_print (FILE *)
static void print_struct_decl (pretty_printer *, const_tree, int, int)
static void do_niy (pretty_printer *, const_tree)
static void do_niy ()
DEBUG_FUNCTION void debug_generic_expr ()
DEBUG_FUNCTION void debug_generic_stmt ()
DEBUG_FUNCTION void debug_tree_chain ()
void print_generic_decl ()
void print_generic_stmt ()
void print_generic_stmt_indented ()
void print_generic_expr ()
static void dump_decl_name ()
static void dump_function_name ()
static void dump_function_declaration (pretty_printer *buffer, tree node, int spc, int flags)
static void dump_array_domain ()
static void dump_omp_clause ()
void dump_omp_clauses ()
static void dump_location ()
static void dump_block_node ()
int dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, bool is_stmt)
void print_declaration ()
static void print_struct_decl ()
int op_code_prio ()
int op_prio ()
const char * op_symbol_code ()
static const char * op_symbol ()
void print_call_name ()
static void pretty_print_string ()
static void maybe_init_pretty_print ()
static void newline_and_indent ()
void percent_K_format ()
void pp_tree_identifier ()
void dump_function_header ()

Variables

static pretty_printer buffer
static int initialized = 0

Function Documentation

DEBUG_FUNCTION void debug_tree_chain ( )
Debugging function to print out a chain of trees .   

References pointer_set_create(), pointer_set_destroy(), pointer_set_insert(), and print_generic_expr().

static void do_niy ( pretty_printer ,
const_tree   
)
static
static void do_niy ( )
static
Try to print something for an unknown tree code.   

References dump_generic_node(), len, newline_and_indent(), pp_string(), and tree_code_name.

static void dump_array_domain ( )
static
Dump the domain associated with an array.   

References dump_generic_node(), host_integerp(), integer_zerop(), and pp_string().

Referenced by dump_generic_node(), and print_declaration().

static void dump_block_node ( )
static
Dump lexical block BLOCK.  BUFFER, SPC and FLAGS are as in
   dump_generic_node.   

References dump_generic_node(), dump_location(), newline_and_indent(), pp_printf(), pp_string(), and vec_safe_length().

Referenced by dump_generic_node().

static void dump_decl_name ( )
static
Dump the name of a _DECL node and its DECL_UID if TDF_UID is set
   in FLAGS.   

References pp_printf(), pp_string(), and pp_tree_identifier().

Referenced by dump_function_name(), dump_generic_node(), and print_declaration().

static void dump_function_declaration ( pretty_printer buffer,
tree  node,
int  spc,
int  flags 
)
static
Dump a function declaration.  NODE is the FUNCTION_TYPE.  BUFFER, SPC and
   FLAGS are as in dump_generic_node.   

References dump_generic_node(), and pp_string().

Referenced by dump_generic_node(), and print_declaration().

void dump_function_header ( )
static void dump_function_name ( )
static
Like the above, but used for pretty printing function calls.   

References lang_hooks::decl_printable_name, dump_decl_name(), and pp_string().

Referenced by print_call_name().

int dump_generic_node ( pretty_printer buffer,
tree  node,
int  spc,
int  flags,
bool  is_stmt 
)
Dump the node NODE on the pretty_printer BUFFER, SPC spaces of
   indent.  FLAGS specifies details to show in the dump (see TDF_* in
   dumpfile.h).  If IS_STMT is true, the object printed is considered
   to be a statement and it is terminated by ';' if appropriate.   

References array_ref_element_size(), array_ref_low_bound(), component_ref_field_offset(), dump_array_domain(), dump_block_node(), dump_decl_name(), dump_function_declaration(), dump_generic_node(), dump_location(), dump_omp_clause(), dump_omp_clauses(), exact_log2(), first, fixed_to_decimal(), host_integerp(), HOST_WIDE_INT, HOST_WIDE_INT_PRINT_DOUBLE_HEX, integer_zerop(), len, more_call_expr_args_p(), newline_and_indent(), op_prio(), op_symbol(), pp_character(), pp_newline(), pp_printf(), pp_string(), pp_tree_identifier(), predictor_name(), pretty_print_string(), print_call_name(), print_declaration(), print_struct_decl(), real_to_decimal(), si, tcc_declaration, tcc_type, tree_code_name, tree_int_cst_sgn(), tree_to_double_int(), tsi_end_p(), tsi_next(), tsi_start(), tsi_stmt(), type(), TYPE_QUAL_CONST, TYPE_QUAL_RESTRICT, TYPE_QUAL_VOLATILE, and vec_safe_length().

Referenced by default_tree_printer(), do_niy(), dump_array_domain(), dump_binary_rhs(), dump_block_node(), dump_function_declaration(), dump_generic_node(), dump_gimple_asm(), dump_gimple_assign(), dump_gimple_call(), dump_gimple_call_args(), dump_gimple_cond(), dump_gimple_fmt(), dump_gimple_label(), dump_gimple_mem_ops(), dump_gimple_omp_atomic_load(), dump_gimple_omp_atomic_store(), dump_gimple_omp_continue(), dump_gimple_omp_critical(), dump_gimple_omp_for(), dump_gimple_omp_parallel(), dump_gimple_omp_sections(), dump_gimple_omp_task(), dump_gimple_phi(), dump_gimple_return(), dump_gimple_switch(), dump_gimple_transaction(), dump_omp_clause(), dump_ternary_rhs(), dump_unary_rhs(), pp_cfg_jump(), print_call_name(), print_declaration(), print_generic_expr(), print_generic_stmt(), print_generic_stmt_indented(), and print_struct_decl().

static void dump_location ( )
static
Dump location LOC to BUFFER.   

References expand_location(), and pp_string().

Referenced by dump_block_node(), and dump_generic_node().

void dump_omp_clauses ( )
Dump the list of OpenMP clauses.  BUFFER, SPC and FLAGS are as in
   dump_generic_node.   

References dump_omp_clause().

Referenced by dump_generic_node(), dump_gimple_omp_for(), dump_gimple_omp_parallel(), dump_gimple_omp_sections(), dump_gimple_omp_single(), and dump_gimple_omp_task().

static void maybe_init_pretty_print ( FILE *  )
static
static void maybe_init_pretty_print ( )
static
static void newline_and_indent ( pretty_printer ,
int   
)
static
static void newline_and_indent ( )
static

References pp_newline().

int op_code_prio ( )
Return the priority of the operator CODE.

   From lowest to highest precedence with either left-to-right (L-R)
   or right-to-left (R-L) associativity]:

     1  [L-R] ,
     2  [R-L] = += -= *= /= %= &= ^= |= <<= >>=
     3  [R-L] ?:
     4  [L-R] ||
     5  [L-R] &&
     6  [L-R] |
     7  [L-R] ^
     8  [L-R] &
     9  [L-R] == !=
    10  [L-R] < <= > >=
    11  [L-R] << >>
    12  [L-R] + -
    13  [L-R] * / %
    14  [R-L] ! ~ ++ -- + - * & (type) sizeof
    15  [L-R] fn() [] -> .

   unary +, - and * have higher precedence than the corresponding binary
   operators.   
int op_prio ( )
Return the priority of the operator OP.   

References op_code_prio(), and op_prio().

static const char* op_symbol ( const_tree  )
static
@verbatim Pretty formatting of GENERIC trees in C syntax.

Copyright (C) 2001-2013 Free Software Foundation, Inc. Adapted from c-pretty-print.c by Diego Novillo dnovi.nosp@m.llo@.nosp@m.redha.nosp@m.t.co.nosp@m.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/.

Local functions, macros and variables.   

Referenced by dump_generic_node().

static const char* op_symbol ( )
static
Return the symbol associated with operator OP.   

References op_symbol_code().

const char* op_symbol_code ( )
Return the symbol associated with operator CODE.   
void percent_K_format ( )
Handle a %K format for TEXT.  Separate from default_tree_printer so
   it can also be used in front ends.
   %K: a statement, from which EXPR_LOCATION and TREE_BLOCK will be recorded.

References text_info::args_ptr, and text_info::locus.

Referenced by default_tree_printer().

void pp_tree_identifier ( )
Print the identifier ID to PRETTY-PRINTER.   

References identifier_to_locale(), pp_append_text(), and strlen().

Referenced by asan_add_global(), asan_emit_stack_protection(), dump_decl_name(), and dump_generic_node().

static void pretty_print_string ( pretty_printer ,
const char *   
)
static

Referenced by dump_generic_node().

static void pretty_print_string ( )
static
Parses the string STR and replaces new-lines by '\n', tabs by '\t', ...   

References pp_character(), and pp_string().

void print_call_name ( )
Prints the name of a call.  NODE is the CALL_EXPR_FN of a CALL_EXPR or
   the gimple_call_fn of a GIMPLE_CALL.   

References dump_function_name(), dump_generic_node(), integer_zerop(), and pp_string().

Referenced by dump_generic_node(), and dump_gimple_call().

void print_declaration ( )
void print_generic_decl ( )
Prints declaration DECL to the FILE with details specified by FLAGS.   

References maybe_init_pretty_print(), pp_write_text_to_stream(), and print_declaration().

Referenced by dump_enumerated_decls(), dump_function_to_file(), and dump_scope_block().

void print_generic_expr ( )
Print a single expression T on file FILE.  FLAGS specifies details to show
   in the dump.  See TDF_* in dumpfile.h.   

References dump_generic_node(), maybe_init_pretty_print(), and pp_flush().

Referenced by add_to_evolution(), analyze_access_subtree(), analyze_all_variable_accesses(), analyze_evolution_in_loop(), analyze_initial_condition(), analyze_overlapping_iterations(), analyze_scalar_evolution(), attempt_builtin_powi(), attempt_coalesce(), browse_tree(), canonicalize_loop_induction_variables(), ccp_fold_stmt(), ccp_visit_phi_node(), cgraph_materialize_all_clones(), cgraph_resolve_speculation(), chrec_apply(), collect_object_sizes_for(), compute_builtin_object_size(), copy_rename_partition_coalesce(), cprop_operand(), create_access_replacement(), create_canonical_iv(), create_data_ref(), debug_generic_expr(), debug_rename_elt(), debug_ter(), debug_tree_chain(), debug_var_infos_r(), decide_one_param_reduction(), disqualify_candidate(), dump_access(), dump_affine_function(), dump_affine_iv(), dump_all_value_ranges(), dump_asserts_for(), dump_cand(), dump_candidate(), dump_chain(), dump_coalesce_list(), dump_condition(), dump_copy_of(), dump_currdefs(), dump_defs_stack(), dump_dref(), dump_eh_tree(), dump_function_to_file(), dump_generic_expr(), dump_generic_expr_loc(), dump_immediate_uses_for(), dump_incr_vec(), dump_iv(), dump_lattice_value(), dump_live_info(), dump_mem_address(), dump_mem_details(), dump_names_replaced_by(), dump_odr_type(), dump_ops_vector(), dump_points_to_info_for(), dump_possible_polymorphic_call_targets(), dump_replaceable_exprs(), dump_stack_var_partition(), dump_subscript(), dump_tm_memopt_set(), dump_tree_via_hooks(), dump_update_ssa(), dump_use(), dump_value_range(), dump_var_map(), dump_variable(), eliminate_bb(), eliminate_duplicate_pair(), eliminate_not_pairs(), eliminate_plus_minus_pair(), eliminate_redundant_comparison(), eliminate_redundant_computations(), eliminate_useless_phis(), execute_sm(), expand_call_inline(), expansion_failed(), fail_abnormal_edge_coalesce(), find_induction_variables(), find_interesting_uses(), find_param_candidates(), fold_predicate_in(), forward_propagate_into_cond(), forward_propagate_into_gimple_cond(), gather_chrec_stats(), gather_mem_refs_stmt(), gather_memory_references_ref(), get_rank(), get_replacement_map(), get_representative_for(), get_scalar_evolution(), gimple_divmod_fixed_value_transform(), gimple_ic_transform(), gimple_verify_flow_info(), gimplify_expr(), ifcombine_ifandif(), insert_phi_nodes_for(), insert_value_copy_on_edge(), instantiate_scev(), ipa_dump_agg_replacement_values(), ipa_dump_param(), ipa_dump_param_adjustments(), ipa_print_node_jump_functions_for_edge(), ipcp_transform_function(), lookup_avail_expr(), mark_operand_necessary(), maybe_add_sra_candidate(), maybe_optimize_var(), movement_possibility(), number_of_iterations_cond(), number_of_latch_executions(), phiprop_insert_phi(), print_aff(), print_expr_hash_elt(), print_exprs(), print_ipcp_constant_value(), print_loop(), print_mem_expr(), print_pre_expr(), print_scc(), print_scop_params(), propagate_rhs_into_lhs(), record_const_or_copy_1(), record_equivalences_from_stmt(), record_estimate(), record_nonwrapping_iv(), register_edge_assert_for_2(), register_ssa_partition_check(), reject(), rename_ssa_copies(), replace_removed_params_ssa_names(), restore_vars_to_original_value(), rewrite_trees(), run_scc_vn(), set_scalar_evolution(), set_ssa_val_to(), sra_ipa_modify_expr(), ssa_base_cand_dump_callback(), tm_log_emit(), tm_memopt_accumulate_memops(), tree_function_versioning(), tree_nrv(), try_create_reduction_list(), undistribute_ops_list(), update_range_test(), update_ssa(), value_replacement(), verify_def(), verify_imm_links(), verify_live_on_entry(), verify_use(), visit_reference_op_load(), visit_reference_op_store(), visit_use(), vrp_var_may_overflow(), vrp_visit_assignment_or_call(), vrp_visit_cond_stmt(), vrp_visit_phi_node(), and vrp_visit_switch_stmt().

void print_generic_stmt ( )
void print_generic_stmt_indented ( )
Print tree T, and its successors, on file FILE.  FLAGS specifies details
   to show in the dump.  See TDF_* in dumpfile.h.  The output is indented by
   INDENT spaces.   

References dump_generic_node(), indent, maybe_init_pretty_print(), and pp_newline_and_flush().

Referenced by dump_function_to_file().

static void print_struct_decl ( pretty_printer ,
const_tree  ,
int  ,
int   
)
static

Referenced by dump_generic_node().

static void print_struct_decl ( )
static
Prints a structure: name, fields, and methods.
   FIXME: Still incomplete.   

References dump_generic_node(), pp_newline(), pp_string(), and print_declaration().


Variable Documentation

int initialized = 0
static

Referenced by maybe_init_pretty_print().