GCC Middle and Back End API Reference
gimple-pretty-print.c File 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"
Include dependency graph for gimple-pretty-print.c:

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)

Functions

static void do_niy ()
static void newline_and_indent ()
DEBUG_FUNCTION void debug_gimple_stmt ()
void print_gimple_stmt ()
DEBUG_FUNCTION void debug ()
void print_gimple_expr ()
static void dump_gimple_seq ()
void print_gimple_seq ()
DEBUG_FUNCTION void debug_gimple_seq ()
static void dump_gimple_fmt (pretty_printer *buffer, int spc, int flags, const char *fmt,...)
static void dump_unary_rhs ()
static void dump_binary_rhs ()
static void dump_ternary_rhs ()
static void dump_gimple_assign ()
static void dump_gimple_return ()
static void dump_gimple_call_args ()
static void pp_points_to_solution ()
static void dump_gimple_call ()
static void dump_gimple_switch ()
static void dump_gimple_cond ()
static void dump_gimple_label ()
static void dump_gimple_goto ()
static void dump_gimple_bind ()
static void dump_gimple_try ()
static void dump_gimple_catch ()
static void dump_gimple_eh_filter ()
static void dump_gimple_eh_must_not_throw (pretty_printer *buffer, gimple gs, int spc, int flags)
static void dump_gimple_eh_else ()
static void dump_gimple_resx ()
static void dump_gimple_eh_dispatch ()
static void dump_gimple_debug ()
static void dump_gimple_omp_for ()
static void dump_gimple_omp_continue ()
static void dump_gimple_omp_single ()
static void dump_gimple_omp_target ()
static void dump_gimple_omp_teams ()
static void dump_gimple_omp_sections (pretty_printer *buffer, gimple gs, int spc, int flags)
static void dump_gimple_omp_block ()
static void dump_gimple_omp_critical (pretty_printer *buffer, gimple gs, int spc, int flags)
static void dump_gimple_omp_return ()
static void dump_gimple_transaction ()
static void dump_gimple_asm ()
static void dump_ssaname_info ()
static void dump_gimple_phi (pretty_printer *buffer, gimple phi, int spc, bool comment, int flags)
static void dump_gimple_omp_parallel (pretty_printer *buffer, gimple gs, int spc, int flags)
static void dump_gimple_omp_task (pretty_printer *buffer, gimple gs, int spc, int flags)
static void dump_gimple_omp_atomic_load (pretty_printer *buffer, gimple gs, int spc, int flags)
static void dump_gimple_omp_atomic_store (pretty_printer *buffer, gimple gs, int spc, int flags)
static void dump_gimple_mem_ops ()
void pp_gimple_stmt_1 ()
static void dump_gimple_bb_header ()
static void dump_gimple_bb_footer (FILE *outf, basic_block bb, int indent, int flags)
static void dump_phi_nodes ()
static void pp_cfg_jump ()
static void dump_implicit_edges (pretty_printer *buffer, basic_block bb, int indent, int flags)
static void gimple_dump_bb_buff (pretty_printer *buffer, basic_block bb, int indent, int flags)
void gimple_dump_bb ()
void gimple_dump_bb_for_graph ()

Macro Definition Documentation

#define GIMPLE_NIY   do_niy (buffer,gs)
#define INDENT (   SPACE)    do { int i; for (i = 0; i < SPACE; i++) pp_space (buffer); } while (0)

Pretty formatting of GIMPLE statements and expressions. Copyright (C) 2001-2013 Free Software Foundation, Inc. Contributed by Aldy Hernandez aldyh.nosp@m.@red.nosp@m.hat.c.nosp@m.om and Diego Novillo dnovi.nosp@m.llo@.nosp@m.googl.nosp@m.e.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/.

Referenced by pp_cfg_jump().


Function Documentation

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 void do_niy ( )
static

Try to print on BUFFER a default message for the unrecognized gimple statement GS.

static void dump_binary_rhs ( )
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 void dump_gimple_asm ( )
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 void dump_gimple_assign ( )
static

Dump the gimple assignment GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.

static void dump_gimple_bb_footer ( FILE *  outf,
basic_block  bb,
int  indent,
int  flags 
)
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 void dump_gimple_bb_header ( )
static

Dumps header of basic block BB to OUTF indented by INDENT spaces and details described by flags.

static void dump_gimple_bind ( )
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 void dump_gimple_call ( )
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 void dump_gimple_call_args ( )
static

Dump the call arguments for a gimple call. BUFFER, FLAGS are as in dump_gimple_call.

static void dump_gimple_catch ( )
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 void dump_gimple_cond ( )
static

Dump the gimple conditional GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.

static void dump_gimple_eh_dispatch ( )
static

Dump a GIMPLE_EH_DISPATCH tuple on the pretty_printer BUFFER.

static void dump_gimple_eh_else ( )
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 void dump_gimple_eh_filter ( )
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 void dump_gimple_eh_must_not_throw ( pretty_printer buffer,
gimple  gs,
int  spc,
int  flags 
)
static

Dump a GIMPLE_EH_MUST_NOT_THROW tuple.

References dump_gimple_fmt(), and gimple_resx_region().

static void dump_gimple_fmt ( pretty_printer buffer,
int  spc,
int  flags,
const char *  fmt,
  ... 
)
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 void dump_gimple_goto ( )
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 void dump_gimple_label ( )
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 void dump_gimple_mem_ops ( )
static

Dump all the memory operands for statement GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.

static void dump_gimple_omp_atomic_load ( pretty_printer buffer,
gimple  gs,
int  spc,
int  flags 
)
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 void dump_gimple_omp_atomic_store ( pretty_printer buffer,
gimple  gs,
int  spc,
int  flags 
)
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 void dump_gimple_omp_block ( )
static
static void dump_gimple_omp_continue ( )
static

Dump a GIMPLE_OMP_CONTINUE tuple on the pretty_printer BUFFER.

static void dump_gimple_omp_critical ( pretty_printer buffer,
gimple  gs,
int  spc,
int  flags 
)
static

Dump a GIMPLE_OMP_CRITICAL tuple on the pretty_printer BUFFER.

static void dump_gimple_omp_for ( )
static

Dump a GIMPLE_OMP_FOR tuple on the pretty_printer BUFFER.

static void dump_gimple_omp_parallel ( pretty_printer buffer,
gimple  gs,
int  spc,
int  flags 
)
static
static void dump_gimple_omp_return ( )
static
static void dump_gimple_omp_sections ( pretty_printer buffer,
gimple  gs,
int  spc,
int  flags 
)
static

Dump a GIMPLE_OMP_SECTIONS tuple on the pretty_printer BUFFER.

static void dump_gimple_omp_single ( )
static

Dump a GIMPLE_OMP_SINGLE tuple on the pretty_printer BUFFER.

static void dump_gimple_omp_target ( )
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 void dump_gimple_omp_task ( pretty_printer buffer,
gimple  gs,
int  spc,
int  flags 
)
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 void dump_gimple_phi ( pretty_printer buffer,
gimple  phi,
int  spc,
bool  comment,
int  flags 
)
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 void dump_gimple_resx ( )
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 void dump_gimple_return ( )
static

Dump the return statement GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.

static void dump_gimple_seq ( )
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 void dump_gimple_switch ( )
static

Dump the switch statement GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.

static void dump_gimple_transaction ( )
static

Dump a GIMPLE_TRANSACTION tuple on the pretty_printer BUFFER.

References pp_string().

static void dump_gimple_try ( )
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 void dump_implicit_edges ( pretty_printer buffer,
basic_block  bb,
int  indent,
int  flags 
)
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 void dump_phi_nodes ( )
static

Dump PHI nodes of basic block BB to BUFFER with details described by FLAGS and indented by INDENT spaces.

static void dump_ternary_rhs ( )
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 void dump_unary_rhs ( )
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 void gimple_dump_bb_buff ( pretty_printer buffer,
basic_block  bb,
int  indent,
int  flags 
)
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 void newline_and_indent ( )
static
static void pp_cfg_jump ( )
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 void pp_points_to_solution ( )
static
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().