This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Illegible dumps with dump_cfg_function_to_file
Hello,
> > OK, but IMHO the right way is what dump_cfg_function_to_file does, since
> > it is infrastructure independent. dump_function_to_file is only useful
> > before we switch to cfg based representation.
> >
> The point still stands. Let's not have 2 function dumpers. Just one
> that is smart enough to tell whether to use the CFG based representation
> or the original tree linkage. The pretty printer already knows how to
> dump basic block information, PHIs and VOPs. It's not necessary to
> duplicate that.
>
> Let's just move the bb traversal code from dump_cfg_function_to_file
> into dump_function_to_file and add smarts to dump_function_to_file to
> determine when to switch between dumping DECL_SAVED_TREE(fndecl) and
> traversing the basic blocks.
OK, here it is the patch to do it. I have also made a few other
tree/bb dumping functions to use this common code and fixed several
problems with the dumps (missing/superfluous semicolons after
statements, redundant information in dumps).
Zdenek
* basic-block.h (brief_dump_cfg): Declare.
* cfg.c (dump_cfg_bb_info, brief_dump_cfg): New.
* diagnostic.h (dump_generic_node): Declaration changed.
(print_generic_stmt_indented): Declare.
* gimple-low.c (expand_var_p): New.
(expand_used_vars): Use it.
* tree-cfg.c (struct cfg_stats_d): Remove num_failed_bind_expr_merges
field.
(remove_bb): Only dump whole block with TDF_DETAILS.
(tree_dump_bb): Use dump_generic_bb.
(dump_tree_cfg): Use brief_dump_cfg and dump_function_to_file.
(dump_cfg_function_to_file): Merged into dump_function_to_file,
removed.
(dump_cfg_stats): Do not dump cfg_stats.num_failed_bind_expr_merges.
(dump_function_to_file): Moved from tree-dump.c, merged with
dump_cfg_function_to_file.
* tree-dump.c (dump_function_to_file): Removed.
* tree-flow.h (dump_cfg_function_to_file): Declaration removed.
(dump_generic_bb, expand_var_p): Declare.
* tree-must-alias.c (tree_compute_must_alias): Replace
dump_cfg_function_to_file by dump_function_to_file.
* tree-ssa-ccp.c (tree_ssa_ccp): Ditto.
* tree-ssa-copyprop.c (tree_ssa_copyprop): Ditto.
* tree-ssa-dce.c (tree_ssa_dce): Ditto.
* tree-ssa-dom.c (tree_ssa_dominator_optimize_1): Ditto.
* tree-ssa-pre.c (tree_perform_ssapre): Ditto.
* tree-ssa.c (rewrite_into_ssa, rewrite_out_of_ssa): Ditto.
* tree-tailcall.c (tree_optimize_tail_calls): Ditto.
* tree-pretty-print.c (print_declaration, print_generic_decl): Don't
use flags argument, change spacing.
(dump_block_info): Removed.
(dump_generic_bb_buff, dump_generic_bb, print_generic_stmt_indented,
dump_bb_header, dump_bb_end, dump_phi_nodes): New functions.
(dump_vops): Change spacing, don't dump phi nodes.
(do_niy, print_generic_stmt, print_generic_expr, print_declaration,
print_struct_decl, print_call_name): Add argument to
the dump_generic_node calls.
(last_bb): Removed.
(dump_generic_node): Print semicolons at end of statements correctly.
Don't print bb related stuff.
(maybe_init_pretty_print): Don't initialize last_bb.
Index: basic-block.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/basic-block.h,v
retrieving revision 1.153.2.32
diff -c -3 -p -r1.153.2.32 basic-block.h
*** basic-block.h 1 Nov 2003 20:27:15 -0000 1.153.2.32
--- basic-block.h 8 Nov 2003 16:34:10 -0000
*************** extern int dfs_enumerate_from (basic_blo
*** 381,386 ****
--- 381,387 ----
bool (*)(basic_block, void *),
basic_block *, int, void *);
extern void dump_edge_info (FILE *, edge, int);
+ extern void brief_dump_cfg (FILE *);
extern void clear_edges (void);
extern void mark_critical_edges (void);
extern rtx first_insn_after_basic_block_note (basic_block);
Index: cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfg.c,v
retrieving revision 1.34.2.14
diff -c -3 -p -r1.34.2.14 cfg.c
*** cfg.c 14 Oct 2003 17:31:31 -0000 1.34.2.14
--- cfg.c 8 Nov 2003 16:34:10 -0000
*************** debug_bb_n (int n)
*** 1014,1016 ****
--- 1014,1068 ----
dump_bb (bb, stderr, 0);
return bb;
}
+
+ /* Dumps cfg related information about basic block BB to FILE. */
+
+ static void
+ dump_cfg_bb_info (FILE *file, basic_block bb)
+ {
+ unsigned i;
+ bool first = true;
+ static const char * const bb_bitnames[] =
+ {
+ "dirty", "new", "reachable", "visited", "irreducible_loop", "superblock"
+ };
+ const unsigned n_bitnames = sizeof (bb_bitnames) / sizeof (char *);
+ edge e;
+
+ fprintf (file, "Basic block %d", bb->index);
+ for (i = 0; i < n_bitnames; i++)
+ if (bb->flags & (1 << i))
+ {
+ if (first)
+ fprintf (file, " (");
+ else
+ fprintf (file, ", ");
+ first = false;
+ fprintf (file, bb_bitnames[i]);
+ }
+ if (!first)
+ fprintf (file, ")");
+ fprintf (file, "\n");
+
+ fprintf (file, "Predecessors: ");
+ for (e = bb->pred; e; e = e->pred_next)
+ dump_edge_info (file, e, 0);
+
+ fprintf (file, "\nSuccessors: ");
+ for (e = bb->succ; e; e = e->succ_next)
+ dump_edge_info (file, e, 1);
+ fprintf (file, "\n\n");
+ }
+
+ /* Dumps a brief description of cfg to FILE. */
+
+ void
+ brief_dump_cfg (FILE *file)
+ {
+ basic_block bb;
+
+ FOR_EACH_BB (bb)
+ {
+ dump_cfg_bb_info (file, bb);
+ }
+ }
Index: diagnostic.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/diagnostic.h,v
retrieving revision 1.44.2.23
diff -c -3 -p -r1.44.2.23 diagnostic.h
*** diagnostic.h 5 Nov 2003 16:28:06 -0000 1.44.2.23
--- diagnostic.h 8 Nov 2003 16:34:11 -0000
*************** extern char *file_name_as_prefix (const
*** 185,192 ****
extern void debug_output_buffer (pretty_printer *);
/* In tree-pretty-print.c */
! extern int dump_generic_node (pretty_printer *, tree, int, int);
extern void print_generic_stmt (FILE *, tree, int);
extern void print_generic_expr (FILE *, tree, int);
extern void print_generic_decl (FILE *, tree, int);
--- 185,193 ----
extern void debug_output_buffer (pretty_printer *);
/* In tree-pretty-print.c */
! extern int dump_generic_node (pretty_printer *, tree, int, int, bool);
extern void print_generic_stmt (FILE *, tree, int);
+ extern void print_generic_stmt_indented (FILE *, tree, int, int);
extern void print_generic_expr (FILE *, tree, int);
extern void print_generic_decl (FILE *, tree, int);
Index: gimple-low.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/gimple-low.c,v
retrieving revision 1.1.4.7
diff -c -3 -p -r1.1.4.7 gimple-low.c
*** gimple-low.c 8 Nov 2003 09:49:19 -0000 1.1.4.7
--- gimple-low.c 8 Nov 2003 16:34:11 -0000
*************** lower_cond_expr (tree_stmt_iterator *tsi
*** 257,262 ****
--- 257,288 ----
tsi_link_after (tsi, end_label, TSI_CONTINUE_LINKING);
}
+ /* Check whether to expand a variable VAR. */
+
+ bool
+ expand_var_p (tree var)
+ {
+ struct var_ann_d *ann;
+
+ if (TREE_CODE (var) != VAR_DECL)
+ return true;
+
+ ann = var_ann (var);
+
+ /* Remove all unused, unaliased temporaries. Also remove unused, unaliased
+ local variables during highly optimizing compilations. */
+ ann = var_ann (var);
+ if (ann
+ && ! ann->may_aliases
+ && ! ann->used
+ && ! ann->has_hidden_use
+ && ! TREE_ADDRESSABLE (var)
+ && (DECL_ARTIFICIAL (var) || optimize >= 2))
+ return false;
+
+ return true;
+ }
+
/* Expand those variables in the unexpanded_var_list that are used. */
void
*************** expand_used_vars (void)
*** 270,293 ****
{
var = TREE_VALUE (cell);
! if (TREE_CODE (var) == VAR_DECL)
! {
! struct var_ann_d *ann = var_ann (var);
!
! /* Remove all unused, unaliased temporaries. Also remove
! unused, unaliased local variables during highly
! optimizing compilations. */
! ann = var_ann (var);
! if (ann
! && ! ann->may_aliases
! && ! ann->used
! && ! ann->has_hidden_use
! && ! TREE_ADDRESSABLE (var)
! && (DECL_ARTIFICIAL (var) || optimize >= 2))
! continue;
! }
!
! expand_var (var);
}
cfun->unexpanded_var_list = NULL_TREE;
--- 296,303 ----
{
var = TREE_VALUE (cell);
! if (expand_var_p (var))
! expand_var (var);
}
cfun->unexpanded_var_list = NULL_TREE;
Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-cfg.c,v
retrieving revision 1.1.4.199
diff -c -3 -p -r1.1.4.199 tree-cfg.c
*** tree-cfg.c 8 Nov 2003 09:49:19 -0000 1.1.4.199
--- tree-cfg.c 8 Nov 2003 16:34:15 -0000
*************** static varray_type label_to_block_map;
*** 63,69 ****
struct cfg_stats_d
{
long num_merged_labels;
- long num_failed_bind_expr_merges;
};
static dominance_info pdom_info = NULL;
--- 63,68 ----
*************** remove_bb (basic_block bb)
*** 1343,1350 ****
if (dump_file)
{
fprintf (dump_file, "Removing basic block %d\n", bb->index);
! dump_bb (bb, dump_file, 0);
! fprintf (dump_file, "\n");
dump_end (TDI_cfg, dump_file);
dump_file = NULL;
}
--- 1342,1352 ----
if (dump_file)
{
fprintf (dump_file, "Removing basic block %d\n", bb->index);
! if (dump_flags & TDF_DETAILS)
! {
! dump_bb (bb, dump_file, 0);
! fprintf (dump_file, "\n");
! }
dump_end (TDI_cfg, dump_file);
dump_file = NULL;
}
*************** insert_bb_before (basic_block new_bb, ba
*** 2002,2033 ****
void
tree_dump_bb (basic_block bb, FILE *outf, int indent)
{
! char *s_indent;
! block_stmt_iterator si;
! tree phi;
!
! s_indent = (char *) alloca ((size_t) indent + 1);
! memset ((void *) s_indent, ' ', (size_t) indent);
! s_indent[indent] = '\0';
!
! if (bb->tree_annotations)
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
! {
! fprintf (outf, "%s# ", s_indent);
! print_generic_stmt (outf, phi, 0);
! }
!
! for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
! {
! fprintf (outf, "%s%d ", s_indent, get_lineno (bsi_stmt (si)));
! print_generic_stmt (outf, bsi_stmt (si),
! (TREE_CODE (bsi_stmt (si)) == BIND_EXPR
! ? TDF_SLIM
! : 0));
! }
}
-
/* Dump a basic block on stderr. */
void
--- 2004,2012 ----
void
tree_dump_bb (basic_block bb, FILE *outf, int indent)
{
! dump_generic_bb (outf, bb, indent, TDF_VOPS);
}
/* Dump a basic block on stderr. */
void
*************** debug_tree_cfg (int flags)
*** 2065,2072 ****
void
dump_tree_cfg (FILE *file, int flags)
{
- basic_block bb;
-
if (flags & TDF_DETAILS)
{
const char *funcname
--- 2044,2049 ----
*************** dump_tree_cfg (FILE *file, int flags)
*** 2074,2169 ****
fputc ('\n', file);
fprintf (file, ";; Function %s\n\n", funcname);
! fprintf (file, ";; \n%d basic blocks, %d edges, last basic block %d.\n",
n_basic_blocks, n_edges, last_basic_block);
! FOR_EACH_BB (bb)
! {
! dump_bb (bb, file, 0);
! fputc ('\n', file);
! }
}
if (flags & TDF_STATS)
dump_cfg_stats (file);
! if (n_basic_blocks > 0)
! dump_cfg_function_to_file (current_function_decl, file, flags|TDF_BLOCKS);
! }
!
! /* Dumps function FN to FILE, with details given by FLAGS. Function body is
! taken from cfg. */
!
! void
! dump_cfg_function_to_file (tree fn, FILE *file, int flags)
! {
! basic_block bb;
! tree arg, phi;
! block_stmt_iterator si;
! edge e;
! int show_bb_headers = flags & TDF_BLOCKS;
!
! flags &= ~TDF_BLOCKS;
!
! fprintf (file, "\n;; Function %s",
! (*lang_hooks.decl_printable_name) (fn, 2));
! fprintf (file, " (%s)\n",
! IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fn)));
! fprintf (file, "\n");
!
! fprintf (file, "%s (", (*lang_hooks.decl_printable_name) (fn, 2));
!
! arg = DECL_ARGUMENTS (fn);
! while (arg)
! {
! print_generic_expr (file, arg, 0);
! if (TREE_CHAIN (arg))
! fprintf (file, ", ");
! arg = TREE_CHAIN (arg);
! }
! fprintf (file, ")\n");
!
! fprintf (file, "{\n");
! if (cfun->unexpanded_var_list)
! {
! for (arg = cfun->unexpanded_var_list; arg; arg = TREE_CHAIN (arg))
! print_generic_decl (file, TREE_VALUE (arg), flags | TDF_SLIM);
! fprintf (file, "\n");
! }
!
! FOR_EACH_BB (bb)
! {
! if (show_bb_headers)
! {
! fprintf (file, "# BLOCK %d\n ", bb->index);
! fprintf (file, "# PRED");
! for (e = bb->pred; e; e = e->pred_next)
! dump_edge_info (file, e, 0);
! putc ('\n', file);
! }
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
! {
! fprintf (file, "\t# ");
! print_generic_stmt (file, phi, flags);
! fprintf (file, "\n");
! }
!
! for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
! {
! fprintf (file, "%d\t", get_lineno (bsi_stmt (si)));
! print_generic_stmt (file, bsi_stmt (si), flags);
! fprintf (file, "\n");
! }
!
! if (show_bb_headers)
! {
! fprintf (file, "# SUCC");
! for (e = bb->succ; e; e = e->succ_next)
! dump_edge_info (file, e, 1);
! fprintf (file, "\n\n");
! }
! }
! fprintf (file, "}\n\n");
}
/* Dump CFG statistics on FILE. */
--- 2051,2067 ----
fputc ('\n', file);
fprintf (file, ";; Function %s\n\n", funcname);
! fprintf (file, ";; \n%d basic blocks, %d edges, last basic block %d.\n\n",
n_basic_blocks, n_edges, last_basic_block);
! brief_dump_cfg (file);
! fprintf (file, "\n");
}
if (flags & TDF_STATS)
dump_cfg_stats (file);
! dump_function_to_file (current_function_decl, file, flags | TDF_BLOCKS);
}
/* Dump CFG statistics on FILE. */
*************** dump_cfg_stats (FILE *file)
*** 2222,2232 ****
fprintf (file, "Coalesced label blocks: %ld (Max so far: %ld)\n",
cfg_stats.num_merged_labels, max_num_merged_labels);
-
- fprintf (file, "Number of unnecessary blocks created due to lexical scopes: %ld (%.0f%%)\n",
- cfg_stats.num_failed_bind_expr_merges,
- PERCENT (cfg_stats.num_failed_bind_expr_merges, n_basic_blocks));
-
fprintf (file, "\n");
}
--- 2120,2125 ----
*************** tree_redirect_edge_and_branch_force (edg
*** 4014,4019 ****
--- 3907,4028 ----
if (!e)
abort ();
return e->src == old ? NULL : old;
+ }
+
+ /* Dump FUNCTION_DECL FN to file FILE using FLAGS (see TDF_* in tree.h) */
+
+ void
+ dump_function_to_file (tree fn, FILE *file, int flags)
+ {
+ tree arg, vars, var;
+ bool ignore_topmost_bind = false, any_var = false;
+ basic_block bb;
+ tree chain;
+
+ fprintf (file, "\n;; Function %s",
+ (*lang_hooks.decl_printable_name) (fn, 2));
+ fprintf (file, " (%s)\n",
+ IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fn)));
+ fprintf (file, "\n");
+
+ fprintf (file, "%s (", (*lang_hooks.decl_printable_name) (fn, 2));
+
+ arg = DECL_ARGUMENTS (fn);
+ while (arg)
+ {
+ print_generic_expr (file, arg, 0);
+ if (TREE_CHAIN (arg))
+ fprintf (file, ", ");
+ arg = TREE_CHAIN (arg);
+ }
+ fprintf (file, ")\n");
+
+ if (flags & TDF_RAW)
+ {
+ dump_node (fn, TDF_SLIM | flags, file);
+ return;
+ }
+
+ /* When gimple is lowered, the variables are no longer available in the
+ bind_exprs, so display them separately. */
+ if (cfun->unexpanded_var_list)
+ {
+ if (TREE_CODE (DECL_SAVED_TREE (fn)) == BIND_EXPR
+ && BIND_EXPR_VARS (DECL_SAVED_TREE (fn)))
+ abort ();
+
+ ignore_topmost_bind = true;
+
+ fprintf (file, "{\n");
+ for (vars = cfun->unexpanded_var_list; vars; vars = TREE_CHAIN (vars))
+ {
+ var = TREE_VALUE (vars);
+
+ print_generic_decl (file, var, flags);
+ if (flags & TDF_DETAILS)
+ {
+ /* Mention if the variable will be eliminated. Only valid in
+ the TDI_optimized dump, but still useful, and we cannot
+ recognize it here; so just mention it if details are requested,
+ and hope it won't be too missleading. */
+ if (!expand_var_p (var))
+ fprintf (file, " # removed");
+ }
+ fprintf (file, "\n");
+
+ any_var = true;
+ }
+ }
+
+ if (basic_block_info)
+ {
+ /* Make a cfg based dump. */
+ if (!ignore_topmost_bind)
+ fprintf (file, "{\n");
+
+ if (any_var && n_basic_blocks)
+ fprintf (file, "\n");
+
+ FOR_EACH_BB (bb)
+ {
+ dump_generic_bb (file, bb, 2, flags);
+ }
+
+ fprintf (file, "}\n");
+ }
+ else
+ {
+ int indent;
+
+ /* Make a tree based dump. */
+ chain = DECL_SAVED_TREE (fn);
+
+ if (TREE_CODE (chain) == BIND_EXPR)
+ {
+ if (ignore_topmost_bind)
+ {
+ chain = BIND_EXPR_BODY (chain);
+ indent = 2;
+ }
+ else
+ indent = 0;
+ }
+ else
+ {
+ if (!ignore_topmost_bind)
+ fprintf (file, "{\n");
+ indent = 2;
+ }
+
+ if (any_var)
+ fprintf (file, "\n");
+
+ print_generic_stmt_indented (file, chain, flags, indent);
+ if (ignore_topmost_bind)
+ fprintf (file, "}\n");
+ }
+
+ fprintf (file, "\n\n");
}
/* FIXME These need to be filled in with appropriate pointers. But this
Index: tree-dump.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-dump.c,v
retrieving revision 1.6.2.48
diff -c -3 -p -r1.6.2.48 tree-dump.c
*** tree-dump.c 6 Nov 2003 15:08:48 -0000 1.6.2.48
--- tree-dump.c 8 Nov 2003 16:34:16 -0000
*************** dump_function (enum tree_dump_index phas
*** 846,886 ****
dump_end (phase, stream);
}
}
-
-
- /* Dump FUNCTION_DECL FN to file STREAM using FLAGS (see TDF_* in tree.h) */
-
- void
- dump_function_to_file (tree fn, FILE *stream, int flags)
- {
- tree arg;
-
- fprintf (stream, "\n;; Function %s",
- (*lang_hooks.decl_printable_name) (fn, 2));
- fprintf (stream, " (%s)\n",
- IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fn)));
- fprintf (stream, "\n");
-
- fprintf (stream, "%s (", (*lang_hooks.decl_printable_name) (fn, 2));
-
- arg = DECL_ARGUMENTS (fn);
- while (arg)
- {
- print_generic_expr (stream, arg, 0);
- if (TREE_CHAIN (arg))
- fprintf (stream, ", ");
- arg = TREE_CHAIN (arg);
- }
- fprintf (stream, ")\n");
-
- if (flags & TDF_RAW)
- dump_node (fn, TDF_SLIM | flags, stream);
- else
- {
- fprintf (stream, "{\n");
- print_generic_stmt (stream, DECL_SAVED_TREE (fn), flags);
- fprintf (stream, "\n}");
- }
-
- fprintf (stream, "\n\n");
- }
--- 846,848 ----
Index: tree-flow.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-flow.h,v
retrieving revision 1.1.4.142
diff -c -3 -p -r1.1.4.142 tree-flow.h
*** tree-flow.h 8 Nov 2003 09:49:19 -0000 1.1.4.142
--- tree-flow.h 8 Nov 2003 16:34:17 -0000
*************** extern bool cleanup_cond_expr_graph (bas
*** 461,467 ****
extern bool cleanup_switch_expr_graph (basic_block, block_stmt_iterator);
extern void tree_optimize_tail_calls (void);
extern basic_block tree_block_forwards_to (basic_block bb);
! extern void dump_cfg_function_to_file (tree, FILE *, int);
/* In tree-dfa.c */
void find_referenced_vars (tree);
--- 461,469 ----
extern bool cleanup_switch_expr_graph (basic_block, block_stmt_iterator);
extern void tree_optimize_tail_calls (void);
extern basic_block tree_block_forwards_to (basic_block bb);
!
! /* In tree-pretty-print.c. */
! extern void dump_generic_bb (FILE *, basic_block, int, int);
/* In tree-dfa.c */
void find_referenced_vars (tree);
*************** extern void mark_new_vars_to_rename (tre
*** 506,511 ****
--- 508,514 ----
/* In gimple-low.c */
void lower_function_body (tree *);
+ bool expand_var_p (tree);
void expand_used_vars (void);
void record_vars (tree);
Index: tree-must-alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-must-alias.c,v
retrieving revision 1.1.2.7
diff -c -3 -p -r1.1.2.7 tree-must-alias.c
*** tree-must-alias.c 5 Nov 2003 13:39:23 -0000 1.1.2.7
--- tree-must-alias.c 8 Nov 2003 16:34:17 -0000
*************** tree_compute_must_alias (tree fndecl, sb
*** 111,117 ****
if (dump_file && (dump_flags & TDF_DETAILS))
dump_referenced_vars (dump_file);
! dump_cfg_function_to_file (fndecl, dump_file, dump_flags);
dump_end (phase, dump_file);
}
--- 111,117 ----
if (dump_file && (dump_flags & TDF_DETAILS))
dump_referenced_vars (dump_file);
! dump_function_to_file (fndecl, dump_file, dump_flags);
dump_end (phase, dump_file);
}
Index: tree-pretty-print.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-pretty-print.c,v
retrieving revision 1.1.2.56
diff -c -3 -p -r1.1.2.56 tree-pretty-print.c
*** tree-pretty-print.c 5 Nov 2003 16:28:10 -0000 1.1.2.56
--- tree-pretty-print.c 8 Nov 2003 16:34:18 -0000
*************** static void pretty_print_string (pretty_
*** 39,49 ****
static void print_call_name (pretty_printer *, tree);
static void newline_and_indent (pretty_printer *, int);
static void maybe_init_pretty_print (FILE *);
! static void print_declaration (pretty_printer *, tree, int, int);
static void print_struct_decl (pretty_printer *, tree, int);
- static void dump_block_info (pretty_printer *, basic_block, int, int);
static void do_niy (pretty_printer *, tree);
static void dump_vops (pretty_printer *, tree, int);
#define INDENT(SPACE) do { \
int i; for (i = 0; i<SPACE; i++) pp_space (buffer); } while (0)
--- 39,49 ----
static void print_call_name (pretty_printer *, tree);
static void newline_and_indent (pretty_printer *, int);
static void maybe_init_pretty_print (FILE *);
! static void print_declaration (pretty_printer *, tree, int);
static void print_struct_decl (pretty_printer *, tree, int);
static void do_niy (pretty_printer *, tree);
static void dump_vops (pretty_printer *, tree, int);
+ static void dump_generic_bb_buff (pretty_printer *, basic_block, int, int);
#define INDENT(SPACE) do { \
int i; for (i = 0; i<SPACE; i++) pp_space (buffer); } while (0)
*************** static void dump_vops (pretty_printer *,
*** 59,65 ****
static pretty_printer buffer;
static int initialized = 0;
- static basic_block last_bb;
static bool dumping_stmts;
/* Try to print something for an unknown tree code. */
--- 59,64 ----
*************** do_niy (pretty_printer *buffer, tree nod
*** 78,84 ****
for (i = 0; i < len; ++i)
{
newline_and_indent (buffer, 2);
! dump_generic_node (buffer, TREE_OPERAND (node, i), 2, 0);
}
}
--- 77,83 ----
for (i = 0; i < len; ++i)
{
newline_and_indent (buffer, 2);
! dump_generic_node (buffer, TREE_OPERAND (node, i), 2, 0, false);
}
}
*************** debug_generic_stmt (tree t)
*** 101,112 ****
/* Prints declaration DECL to the FILE with details specified by FLAGS. */
void
! print_generic_decl (FILE *file, tree decl, int flags)
{
maybe_init_pretty_print (file);
dumping_stmts = true;
! print_declaration (&buffer, decl, 2, flags);
! pp_flush (&buffer);
}
/* Print tree T, and its successors, on file FILE. FLAGS specifies details
--- 100,111 ----
/* Prints declaration DECL to the FILE with details specified by FLAGS. */
void
! print_generic_decl (FILE *file, tree decl, int flags ATTRIBUTE_UNUSED)
{
maybe_init_pretty_print (file);
dumping_stmts = true;
! print_declaration (&buffer, decl, 2);
! pp_write_text_to_stream (&buffer);
}
/* Print tree T, and its successors, on file FILE. FLAGS specifies details
*************** print_generic_stmt (FILE *file, tree t,
*** 117,126 ****
{
maybe_init_pretty_print (file);
dumping_stmts = true;
! dump_generic_node (&buffer, t, 0, flags);
pp_flush (&buffer);
}
/* Print a single expression T on file FILE. FLAGS specifies details to show
in the dump. See TDF_* in tree.h. */
--- 116,142 ----
{
maybe_init_pretty_print (file);
dumping_stmts = true;
! dump_generic_node (&buffer, t, 0, flags, true);
pp_flush (&buffer);
}
+ /* Print tree T, and its successors, on file FILE. FLAGS specifies details
+ to show in the dump. See TDF_* in tree.h. The output is indented by
+ INDENT spaces. */
+
+ void
+ print_generic_stmt_indented (FILE *file, tree t, int flags, int indent)
+ {
+ int i;
+
+ maybe_init_pretty_print (file);
+ dumping_stmts = true;
+
+ for (i = 0; i < indent; i++)
+ pp_space (&buffer);
+ dump_generic_node (&buffer, t, indent, flags, true);
+ pp_flush (&buffer);
+ }
/* Print a single expression T on file FILE. FLAGS specifies details to show
in the dump. See TDF_* in tree.h. */
*************** print_generic_expr (FILE *file, tree t,
*** 130,167 ****
{
maybe_init_pretty_print (file);
dumping_stmts = false;
! dump_generic_node (&buffer, t, 0, flags);
}
/* Dump the node NODE on the pretty_printer BUFFER, SPC spaces of indent.
! FLAGS specifies details to show in the dump (see TDF_* in tree.h). */
int
! dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags)
{
tree type;
tree op0, op1;
const char* str;
tree_stmt_iterator si;
if (node == NULL_TREE)
return spc;
! if (TREE_CODE (node) != ERROR_MARK
! && is_gimple_stmt (node))
! {
! basic_block curr_bb = bb_for_stmt (node);
!
! if ((flags & TDF_BLOCKS) && curr_bb && curr_bb != last_bb)
! dump_block_info (buffer, curr_bb, spc, flags);
!
! if ((flags & TDF_VOPS) && stmt_ann (node))
! dump_vops (buffer, node, spc);
! if (curr_bb && curr_bb != last_bb)
! last_bb = curr_bb;
! }
if (dumping_stmts
&& (flags & TDF_LINENO)
--- 146,180 ----
{
maybe_init_pretty_print (file);
dumping_stmts = false;
! dump_generic_node (&buffer, t, 0, flags, false);
}
/* Dump the node NODE on the pretty_printer BUFFER, SPC spaces of indent.
! FLAGS specifies details to show in the dump (see TDF_* in tree.h). If
! IS_STMT is true, the object printed is considered to be a statement
! and it is terminated by ';' if appropriate. */
int
! dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
! bool is_stmt)
{
tree type;
tree op0, op1;
const char* str;
tree_stmt_iterator si;
+ bool is_expr;
if (node == NULL_TREE)
return spc;
! is_expr = EXPR_P (node);
! if (TREE_CODE (node) != ERROR_MARK
! && is_gimple_stmt (node)
! && (flags & TDF_VOPS)
! && stmt_ann (node))
! dump_vops (buffer, node, spc);
if (dumping_stmts
&& (flags & TDF_LINENO)
*************** dump_generic_node (pretty_printer *buffe
*** 192,201 ****
{
if (TREE_PURPOSE (node))
{
! dump_generic_node (buffer, TREE_PURPOSE (node), spc, flags);
pp_space (buffer);
}
! dump_generic_node (buffer, TREE_VALUE (node), spc, flags);
node = TREE_CHAIN (node);
if (node && TREE_CODE (node) == TREE_LIST)
{
--- 205,214 ----
{
if (TREE_PURPOSE (node))
{
! dump_generic_node (buffer, TREE_PURPOSE (node), spc, flags, false);
pp_space (buffer);
}
! dump_generic_node (buffer, TREE_VALUE (node), spc, flags, false);
node = TREE_CHAIN (node);
if (node && TREE_CODE (node) == TREE_LIST)
{
*************** dump_generic_node (pretty_printer *buffe
*** 206,212 ****
break;
case TREE_VEC:
! dump_generic_node (buffer, BINFO_TYPE (node), spc, flags);
break;
case BLOCK:
--- 219,225 ----
break;
case TREE_VEC:
! dump_generic_node (buffer, BINFO_TYPE (node), spc, flags, false);
break;
case BLOCK:
*************** dump_generic_node (pretty_printer *buffe
*** 268,274 ****
if (TREE_CODE (TREE_TYPE (node)) == FUNCTION_TYPE)
{
tree fnode = TREE_TYPE (node);
! dump_generic_node (buffer, TREE_TYPE (fnode), spc, flags);
pp_space (buffer);
pp_character (buffer, '(');
pp_string (buffer, str);
--- 281,287 ----
if (TREE_CODE (TREE_TYPE (node)) == FUNCTION_TYPE)
{
tree fnode = TREE_TYPE (node);
! dump_generic_node (buffer, TREE_TYPE (fnode), spc, flags, false);
pp_space (buffer);
pp_character (buffer, '(');
pp_string (buffer, str);
*************** dump_generic_node (pretty_printer *buffe
*** 286,292 ****
tree tmp = TYPE_ARG_TYPES (fnode);
while (tmp && TREE_CHAIN (tmp) && tmp != error_mark_node)
{
! dump_generic_node (buffer, TREE_VALUE (tmp), spc, flags);
tmp = TREE_CHAIN (tmp);
if (TREE_CHAIN (tmp) && TREE_CODE (TREE_CHAIN (tmp)) == TREE_LIST)
{
--- 299,305 ----
tree tmp = TYPE_ARG_TYPES (fnode);
while (tmp && TREE_CHAIN (tmp) && tmp != error_mark_node)
{
! dump_generic_node (buffer, TREE_VALUE (tmp), spc, flags, false);
tmp = TREE_CHAIN (tmp);
if (TREE_CHAIN (tmp) && TREE_CODE (TREE_CHAIN (tmp)) == TREE_LIST)
{
*************** dump_generic_node (pretty_printer *buffe
*** 301,307 ****
{
unsigned int quals = TYPE_QUALS (node);
! dump_generic_node (buffer, TREE_TYPE (node), spc, flags);
pp_space (buffer);
pp_string (buffer, str);
--- 314,320 ----
{
unsigned int quals = TYPE_QUALS (node);
! dump_generic_node (buffer, TREE_TYPE (node), spc, flags, false);
pp_space (buffer);
pp_string (buffer, str);
*************** dump_generic_node (pretty_printer *buffe
*** 333,339 ****
tree tmp;
/* Print the array type. */
! dump_generic_node (buffer, TREE_TYPE (node), spc, flags);
/* Print the dimensions. */
tmp = node;
--- 346,352 ----
tree tmp;
/* Print the array type. */
! dump_generic_node (buffer, TREE_TYPE (node), spc, flags, false);
/* Print the dimensions. */
tmp = node;
*************** dump_generic_node (pretty_printer *buffe
*** 348,354 ****
TREE_INT_CST_LOW (TYPE_SIZE (tmp)) /
TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (tmp))));
else if (TREE_CODE (size) == MULT_EXPR)
! dump_generic_node (buffer, TREE_OPERAND (size, 0), spc, flags);
/* else punt. */
}
pp_character (buffer, ']');
--- 361,367 ----
TREE_INT_CST_LOW (TYPE_SIZE (tmp)) /
TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (tmp))));
else if (TREE_CODE (size) == MULT_EXPR)
! dump_generic_node (buffer, TREE_OPERAND (size, 0), spc, flags, false);
/* else punt. */
}
pp_character (buffer, ']');
*************** dump_generic_node (pretty_printer *buffe
*** 370,376 ****
pp_string (buffer, "union ");
if (TYPE_NAME (node))
! dump_generic_node (buffer, TYPE_NAME (node), spc, flags);
else
print_struct_decl (buffer, node, spc);
break;
--- 383,389 ----
pp_string (buffer, "union ");
if (TYPE_NAME (node))
! dump_generic_node (buffer, TYPE_NAME (node), spc, flags, false);
else
print_struct_decl (buffer, node, spc);
break;
*************** dump_generic_node (pretty_printer *buffe
*** 470,478 ****
case COMPLEX_CST:
pp_string (buffer, "__complex__ (");
! dump_generic_node (buffer, TREE_REALPART (node), spc, flags);
pp_string (buffer, ", ");
! dump_generic_node (buffer, TREE_IMAGPART (node), spc, flags);
pp_string (buffer, ")");
break;
--- 483,491 ----
case COMPLEX_CST:
pp_string (buffer, "__complex__ (");
! dump_generic_node (buffer, TREE_REALPART (node), spc, flags, false);
pp_string (buffer, ", ");
! dump_generic_node (buffer, TREE_IMAGPART (node), spc, flags, false);
pp_string (buffer, ")");
break;
*************** dump_generic_node (pretty_printer *buffe
*** 488,494 ****
pp_string (buffer, "{ ");
for (elt = TREE_VECTOR_CST_ELTS (node); elt; elt = TREE_CHAIN (elt))
{
! dump_generic_node (buffer, TREE_VALUE (elt), spc, flags);
if (TREE_CHAIN (elt))
pp_string (buffer, ", ");
}
--- 501,507 ----
pp_string (buffer, "{ ");
for (elt = TREE_VECTOR_CST_ELTS (node); elt; elt = TREE_CHAIN (elt))
{
! dump_generic_node (buffer, TREE_VALUE (elt), spc, flags, false);
if (TREE_CHAIN (elt))
pp_string (buffer, ", ");
}
*************** dump_generic_node (pretty_printer *buffe
*** 534,545 ****
/* The type is a c++ class: all structures have at least
4 methods. */
pp_string (buffer, "class ");
! dump_generic_node (buffer, TREE_TYPE (node), spc, flags);
}
else
{
pp_string (buffer, "struct ");
! dump_generic_node (buffer, TREE_TYPE (node), spc, flags);
pp_character (buffer, ';');
pp_newline (buffer);
}
--- 547,558 ----
/* The type is a c++ class: all structures have at least
4 methods. */
pp_string (buffer, "class ");
! dump_generic_node (buffer, TREE_TYPE (node), spc, flags, false);
}
else
{
pp_string (buffer, "struct ");
! dump_generic_node (buffer, TREE_TYPE (node), spc, flags, false);
pp_character (buffer, ';');
pp_newline (buffer);
}
*************** dump_generic_node (pretty_printer *buffe
*** 582,601 ****
}
if (op_prio (op0) < op_prio (node))
pp_character (buffer, '(');
! dump_generic_node (buffer, op0, spc, flags);
if (op_prio (op0) < op_prio (node))
pp_character (buffer, ')');
pp_string (buffer, str);
! dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags);
break;
case BIT_FIELD_REF:
pp_string (buffer, "BIT_FIELD_REF <");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
pp_string (buffer, ", ");
! dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags);
pp_string (buffer, ", ");
! dump_generic_node (buffer, TREE_OPERAND (node, 2), spc, flags);
pp_string (buffer, ">");
break;
--- 595,614 ----
}
if (op_prio (op0) < op_prio (node))
pp_character (buffer, '(');
! dump_generic_node (buffer, op0, spc, flags, false);
if (op_prio (op0) < op_prio (node))
pp_character (buffer, ')');
pp_string (buffer, str);
! dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false);
break;
case BIT_FIELD_REF:
pp_string (buffer, "BIT_FIELD_REF <");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
pp_string (buffer, ", ");
! dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false);
pp_string (buffer, ", ");
! dump_generic_node (buffer, TREE_OPERAND (node, 2), spc, flags, false);
pp_string (buffer, ">");
break;
*************** dump_generic_node (pretty_printer *buffe
*** 607,617 ****
op0 = TREE_OPERAND (node, 0);
if (op_prio (op0) < op_prio (node))
pp_character (buffer, '(');
! dump_generic_node (buffer, op0, spc, flags);
if (op_prio (op0) < op_prio (node))
pp_character (buffer, ')');
pp_character (buffer, '[');
! dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags);
pp_character (buffer, ']');
break;
--- 620,630 ----
op0 = TREE_OPERAND (node, 0);
if (op_prio (op0) < op_prio (node))
pp_character (buffer, '(');
! dump_generic_node (buffer, op0, spc, flags, false);
if (op_prio (op0) < op_prio (node))
pp_character (buffer, ')');
pp_character (buffer, '[');
! dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false);
pp_character (buffer, ']');
break;
*************** dump_generic_node (pretty_printer *buffe
*** 634,640 ****
if (TREE_PURPOSE (lnode) && is_struct_init)
{
pp_character (buffer, '.');
! dump_generic_node (buffer, TREE_PURPOSE (lnode), spc, flags);
pp_string (buffer, "=");
}
val = TREE_VALUE (lnode);
--- 647,653 ----
if (TREE_PURPOSE (lnode) && is_struct_init)
{
pp_character (buffer, '.');
! dump_generic_node (buffer, TREE_PURPOSE (lnode), spc, flags, false);
pp_string (buffer, "=");
}
val = TREE_VALUE (lnode);
*************** dump_generic_node (pretty_printer *buffe
*** 650,656 ****
}
else
{
! dump_generic_node (buffer, TREE_VALUE (lnode), spc, flags);
}
lnode = TREE_CHAIN (lnode);
if (lnode && TREE_CODE (lnode) == TREE_LIST)
--- 663,669 ----
}
else
{
! dump_generic_node (buffer, TREE_VALUE (lnode), spc, flags, false);
}
lnode = TREE_CHAIN (lnode);
if (lnode && TREE_CODE (lnode) == TREE_LIST)
*************** dump_generic_node (pretty_printer *buffe
*** 666,688 ****
case COMPOUND_EXPR:
if (dumping_stmts)
{
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
if (flags & TDF_SLIM)
break;
- pp_character (buffer, ';');
for (si = tsi_start (&TREE_OPERAND (node, 1));
!tsi_end_p (si);
tsi_next (&si))
{
newline_and_indent (buffer, spc);
! dump_generic_node (buffer, tsi_stmt (si), spc, flags);
! pp_character (buffer, ';');
}
}
else
{
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
for (si = tsi_start (&TREE_OPERAND (node, 1));
!tsi_end_p (si);
--- 679,700 ----
case COMPOUND_EXPR:
if (dumping_stmts)
{
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, true);
if (flags & TDF_SLIM)
break;
for (si = tsi_start (&TREE_OPERAND (node, 1));
!tsi_end_p (si);
tsi_next (&si))
{
newline_and_indent (buffer, spc);
! dump_generic_node (buffer, tsi_stmt (si), spc, flags, true);
}
+ is_expr = false;
}
else
{
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
for (si = tsi_start (&TREE_OPERAND (node, 1));
!tsi_end_p (si);
*************** dump_generic_node (pretty_printer *buffe
*** 690,713 ****
{
pp_character (buffer, ',');
pp_space (buffer);
! dump_generic_node (buffer, tsi_stmt (si), spc, flags);
}
}
break;
case MODIFY_EXPR:
case INIT_EXPR:
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
pp_space (buffer);
pp_character (buffer, '=');
pp_space (buffer);
! dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags);
break;
case TARGET_EXPR:
! dump_generic_node (buffer, TYPE_NAME (TREE_TYPE (node)), spc, flags);
pp_character (buffer, '(');
! dump_generic_node (buffer, TARGET_EXPR_INITIAL (node), spc, flags);
pp_character (buffer, ')');
break;
--- 702,725 ----
{
pp_character (buffer, ',');
pp_space (buffer);
! dump_generic_node (buffer, tsi_stmt (si), spc, flags, false);
}
}
break;
case MODIFY_EXPR:
case INIT_EXPR:
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
pp_space (buffer);
pp_character (buffer, '=');
pp_space (buffer);
! dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false);
break;
case TARGET_EXPR:
! dump_generic_node (buffer, TYPE_NAME (TREE_TYPE (node)), spc, flags, false);
pp_character (buffer, '(');
! dump_generic_node (buffer, TARGET_EXPR_INITIAL (node), spc, flags, false);
pp_character (buffer, ')');
break;
*************** dump_generic_node (pretty_printer *buffe
*** 715,721 ****
if (TREE_TYPE (node) == void_type_node)
{
pp_string (buffer, "if (");
! dump_generic_node (buffer, COND_EXPR_COND (node), spc, flags);
pp_character (buffer, ')');
if (!(flags & TDF_SLIM))
{
--- 727,733 ----
if (TREE_TYPE (node) == void_type_node)
{
pp_string (buffer, "if (");
! dump_generic_node (buffer, COND_EXPR_COND (node), spc, flags, false);
pp_character (buffer, ')');
if (!(flags & TDF_SLIM))
{
*************** dump_generic_node (pretty_printer *buffe
*** 726,732 ****
pp_character (buffer, '{');
newline_and_indent (buffer, spc+4);
dump_generic_node (buffer, COND_EXPR_THEN (node), spc+4,
! flags);
newline_and_indent (buffer, spc+2);
pp_character (buffer, '}');
}
--- 738,744 ----
pp_character (buffer, '{');
newline_and_indent (buffer, spc+4);
dump_generic_node (buffer, COND_EXPR_THEN (node), spc+4,
! flags, true);
newline_and_indent (buffer, spc+2);
pp_character (buffer, '}');
}
*************** dump_generic_node (pretty_printer *buffe
*** 740,762 ****
pp_character (buffer, '{');
newline_and_indent (buffer, spc+4);
dump_generic_node (buffer, COND_EXPR_ELSE (node), spc+4,
! flags);
newline_and_indent (buffer, spc+2);
pp_character (buffer, '}');
}
}
}
else
{
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
pp_space (buffer);
pp_character (buffer, '?');
pp_space (buffer);
! dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags);
pp_space (buffer);
pp_character (buffer, ':');
pp_space (buffer);
! dump_generic_node (buffer, TREE_OPERAND (node, 2), spc, flags);
}
break;
--- 752,775 ----
pp_character (buffer, '{');
newline_and_indent (buffer, spc+4);
dump_generic_node (buffer, COND_EXPR_ELSE (node), spc+4,
! flags, true);
newline_and_indent (buffer, spc+2);
pp_character (buffer, '}');
}
}
+ is_expr = false;
}
else
{
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
pp_space (buffer);
pp_character (buffer, '?');
pp_space (buffer);
! dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false);
pp_space (buffer);
pp_character (buffer, ':');
pp_space (buffer);
! dump_generic_node (buffer, TREE_OPERAND (node, 2), spc, flags, false);
}
break;
*************** dump_generic_node (pretty_printer *buffe
*** 769,782 ****
pp_newline (buffer);
for (op0 = BIND_EXPR_VARS (node); op0; op0 = TREE_CHAIN (op0))
! print_declaration (buffer, op0, spc+2, flags);
}
newline_and_indent (buffer, spc+2);
! dump_generic_node (buffer, BIND_EXPR_BODY (node), spc+2, flags);
newline_and_indent (buffer, spc);
pp_character (buffer, '}');
}
break;
case CALL_EXPR:
--- 782,799 ----
pp_newline (buffer);
for (op0 = BIND_EXPR_VARS (node); op0; op0 = TREE_CHAIN (op0))
! {
! print_declaration (buffer, op0, spc+2);
! pp_newline (buffer);
! }
}
newline_and_indent (buffer, spc+2);
! dump_generic_node (buffer, BIND_EXPR_BODY (node), spc+2, flags, true);
newline_and_indent (buffer, spc);
pp_character (buffer, '}');
}
+ is_expr = false;
break;
case CALL_EXPR:
*************** dump_generic_node (pretty_printer *buffe
*** 787,793 ****
pp_character (buffer, '(');
op1 = TREE_OPERAND (node, 1);
if (op1)
! dump_generic_node (buffer, op1, spc, flags);
pp_character (buffer, ')');
break;
--- 804,810 ----
pp_character (buffer, '(');
op1 = TREE_OPERAND (node, 1);
if (op1)
! dump_generic_node (buffer, op1, spc, flags, false);
pp_character (buffer, ')');
break;
*************** dump_generic_node (pretty_printer *buffe
*** 797,803 ****
case CLEANUP_POINT_EXPR:
pp_string (buffer, "<<cleanup_point ");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
pp_string (buffer, ">>");
break;
--- 814,820 ----
case CLEANUP_POINT_EXPR:
pp_string (buffer, "<<cleanup_point ");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
pp_string (buffer, ">>");
break;
*************** dump_generic_node (pretty_printer *buffe
*** 856,866 ****
if (op_prio (op0) < op_prio (node))
{
pp_character (buffer, '(');
! dump_generic_node (buffer, op0, spc, flags);
pp_character (buffer, ')');
}
else
! dump_generic_node (buffer, op0, spc, flags);
pp_space (buffer);
pp_string (buffer, op);
--- 873,883 ----
if (op_prio (op0) < op_prio (node))
{
pp_character (buffer, '(');
! dump_generic_node (buffer, op0, spc, flags, false);
pp_character (buffer, ')');
}
else
! dump_generic_node (buffer, op0, spc, flags, false);
pp_space (buffer);
pp_string (buffer, op);
*************** dump_generic_node (pretty_printer *buffe
*** 871,881 ****
if (op_prio (op1) < op_prio (node))
{
pp_character (buffer, '(');
! dump_generic_node (buffer, op1, spc, flags);
pp_character (buffer, ')');
}
else
! dump_generic_node (buffer, op1, spc, flags);
}
break;
--- 888,898 ----
if (op_prio (op1) < op_prio (node))
{
pp_character (buffer, '(');
! dump_generic_node (buffer, op1, spc, flags, false);
pp_character (buffer, ')');
}
else
! dump_generic_node (buffer, op1, spc, flags, false);
}
break;
*************** dump_generic_node (pretty_printer *buffe
*** 898,908 ****
if (op_prio (TREE_OPERAND (node, 0)) < op_prio (node))
{
pp_character (buffer, '(');
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
pp_character (buffer, ')');
}
else
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
break;
case POSTDECREMENT_EXPR:
--- 915,925 ----
if (op_prio (TREE_OPERAND (node, 0)) < op_prio (node))
{
pp_character (buffer, '(');
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
pp_character (buffer, ')');
}
else
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
break;
case POSTDECREMENT_EXPR:
*************** dump_generic_node (pretty_printer *buffe
*** 910,942 ****
if (op_prio (TREE_OPERAND (node, 0)) < op_prio (node))
{
pp_character (buffer, '(');
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
pp_character (buffer, ')');
}
else
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
pp_string (buffer, op_symbol (node));
break;
case MIN_EXPR:
pp_string (buffer, "MIN_EXPR <");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
pp_string (buffer, ", ");
! dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags);
pp_character (buffer, '>');
break;
case MAX_EXPR:
pp_string (buffer, "MAX_EXPR <");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
pp_string (buffer, ", ");
! dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags);
pp_character (buffer, '>');
break;
case ABS_EXPR:
pp_string (buffer, "ABS_EXPR <");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
pp_character (buffer, '>');
break;
--- 927,959 ----
if (op_prio (TREE_OPERAND (node, 0)) < op_prio (node))
{
pp_character (buffer, '(');
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
pp_character (buffer, ')');
}
else
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
pp_string (buffer, op_symbol (node));
break;
case MIN_EXPR:
pp_string (buffer, "MIN_EXPR <");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
pp_string (buffer, ", ");
! dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false);
pp_character (buffer, '>');
break;
case MAX_EXPR:
pp_string (buffer, "MAX_EXPR <");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
pp_string (buffer, ", ");
! dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false);
pp_character (buffer, '>');
break;
case ABS_EXPR:
pp_string (buffer, "ABS_EXPR <");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
pp_character (buffer, '>');
break;
*************** dump_generic_node (pretty_printer *buffe
*** 976,1012 ****
if (type != TREE_TYPE (op0))
{
pp_character (buffer, '(');
! dump_generic_node (buffer, type, spc, flags);
pp_string (buffer, ")");
}
if (op_prio (op0) < op_prio (node))
pp_character (buffer, '(');
! dump_generic_node (buffer, op0, spc, flags);
if (op_prio (op0) < op_prio (node))
pp_character (buffer, ')');
break;
case VIEW_CONVERT_EXPR:
pp_string (buffer, "VIEW_CONVERT_EXPR<");
! dump_generic_node (buffer, TREE_TYPE (node), spc, flags);
pp_string (buffer, ">(");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
pp_character (buffer, ')');
break;
case NON_LVALUE_EXPR:
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
break;
case SAVE_EXPR:
pp_string (buffer, "SAVE_EXPR <");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
pp_character (buffer, '>');
break;
case UNSAVE_EXPR:
pp_string (buffer, "UNSAVE_EXPR <");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
pp_character (buffer, '>');
break;
--- 993,1029 ----
if (type != TREE_TYPE (op0))
{
pp_character (buffer, '(');
! dump_generic_node (buffer, type, spc, flags, false);
pp_string (buffer, ")");
}
if (op_prio (op0) < op_prio (node))
pp_character (buffer, '(');
! dump_generic_node (buffer, op0, spc, flags, false);
if (op_prio (op0) < op_prio (node))
pp_character (buffer, ')');
break;
case VIEW_CONVERT_EXPR:
pp_string (buffer, "VIEW_CONVERT_EXPR<");
! dump_generic_node (buffer, TREE_TYPE (node), spc, flags, false);
pp_string (buffer, ">(");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
pp_character (buffer, ')');
break;
case NON_LVALUE_EXPR:
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
break;
case SAVE_EXPR:
pp_string (buffer, "SAVE_EXPR <");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
pp_character (buffer, '>');
break;
case UNSAVE_EXPR:
pp_string (buffer, "UNSAVE_EXPR <");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
pp_character (buffer, '>');
break;
*************** dump_generic_node (pretty_printer *buffe
*** 1020,1052 ****
case COMPLEX_EXPR:
pp_string (buffer, "COMPLEX_EXPR <");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
pp_string (buffer, ", ");
! dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags);
pp_string (buffer, ">");
break;
case CONJ_EXPR:
pp_string (buffer, "CONJ_EXPR <");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
pp_string (buffer, ">");
break;
case REALPART_EXPR:
pp_string (buffer, "REALPART_EXPR <");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
pp_string (buffer, ">");
break;
case IMAGPART_EXPR:
pp_string (buffer, "IMAGPART_EXPR <");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
pp_string (buffer, ">");
break;
case VA_ARG_EXPR:
pp_string (buffer, "VA_ARG_EXPR <");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
pp_string (buffer, ">");
break;
--- 1037,1069 ----
case COMPLEX_EXPR:
pp_string (buffer, "COMPLEX_EXPR <");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
pp_string (buffer, ", ");
! dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false);
pp_string (buffer, ">");
break;
case CONJ_EXPR:
pp_string (buffer, "CONJ_EXPR <");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
pp_string (buffer, ">");
break;
case REALPART_EXPR:
pp_string (buffer, "REALPART_EXPR <");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
pp_string (buffer, ">");
break;
case IMAGPART_EXPR:
pp_string (buffer, "IMAGPART_EXPR <");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
pp_string (buffer, ">");
break;
case VA_ARG_EXPR:
pp_string (buffer, "VA_ARG_EXPR <");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
pp_string (buffer, ">");
break;
*************** dump_generic_node (pretty_printer *buffe
*** 1056,1062 ****
newline_and_indent (buffer, spc+2);
pp_string (buffer, "{");
newline_and_indent (buffer, spc+4);
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc+4, flags);
newline_and_indent (buffer, spc+2);
pp_string (buffer, "}");
newline_and_indent (buffer, spc);
--- 1073,1079 ----
newline_and_indent (buffer, spc+2);
pp_string (buffer, "{");
newline_and_indent (buffer, spc+4);
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc+4, flags, true);
newline_and_indent (buffer, spc+2);
pp_string (buffer, "}");
newline_and_indent (buffer, spc);
*************** dump_generic_node (pretty_printer *buffe
*** 1065,1097 ****
newline_and_indent (buffer, spc+2);
pp_string (buffer, "{");
newline_and_indent (buffer, spc+4);
! dump_generic_node (buffer, TREE_OPERAND (node, 1), spc+4, flags);
newline_and_indent (buffer, spc+2);
pp_string (buffer, "}");
break;
case CATCH_EXPR:
pp_string (buffer, "catch (");
! dump_generic_node (buffer, CATCH_TYPES (node), spc+2, flags);
pp_string (buffer, ")");
newline_and_indent (buffer, spc+2);
pp_string (buffer, "{");
newline_and_indent (buffer, spc+4);
! dump_generic_node (buffer, CATCH_BODY (node), spc+4, flags);
newline_and_indent (buffer, spc+2);
pp_string (buffer, "}");
break;
case EH_FILTER_EXPR:
pp_string (buffer, "<<<eh_filter (");
! dump_generic_node (buffer, EH_FILTER_TYPES (node), spc+2, flags);
pp_string (buffer, ")>>>");
newline_and_indent (buffer, spc+2);
pp_string (buffer, "{");
newline_and_indent (buffer, spc+4);
! dump_generic_node (buffer, EH_FILTER_FAILURE (node), spc+4, flags);
newline_and_indent (buffer, spc+2);
pp_string (buffer, "}");
break;
case GOTO_SUBROUTINE_EXPR:
--- 1082,1117 ----
newline_and_indent (buffer, spc+2);
pp_string (buffer, "{");
newline_and_indent (buffer, spc+4);
! dump_generic_node (buffer, TREE_OPERAND (node, 1), spc+4, flags, true);
newline_and_indent (buffer, spc+2);
pp_string (buffer, "}");
+ is_expr = false;
break;
case CATCH_EXPR:
pp_string (buffer, "catch (");
! dump_generic_node (buffer, CATCH_TYPES (node), spc+2, flags, false);
pp_string (buffer, ")");
newline_and_indent (buffer, spc+2);
pp_string (buffer, "{");
newline_and_indent (buffer, spc+4);
! dump_generic_node (buffer, CATCH_BODY (node), spc+4, flags, true);
newline_and_indent (buffer, spc+2);
pp_string (buffer, "}");
+ is_expr = false;
break;
case EH_FILTER_EXPR:
pp_string (buffer, "<<<eh_filter (");
! dump_generic_node (buffer, EH_FILTER_TYPES (node), spc+2, flags, false);
pp_string (buffer, ")>>>");
newline_and_indent (buffer, spc+2);
pp_string (buffer, "{");
newline_and_indent (buffer, spc+4);
! dump_generic_node (buffer, EH_FILTER_FAILURE (node), spc+4, flags, true);
newline_and_indent (buffer, spc+2);
pp_string (buffer, "}");
+ is_expr = false;
break;
case GOTO_SUBROUTINE_EXPR:
*************** dump_generic_node (pretty_printer *buffe
*** 1108,1116 ****
|| strcmp (name, "continue") == 0)
break;
}
! dump_generic_node (buffer, op0, spc, flags);
pp_character (buffer, ':');
- pp_character (buffer, ';');
break;
case LABELED_BLOCK_EXPR:
--- 1128,1135 ----
|| strcmp (name, "continue") == 0)
break;
}
! dump_generic_node (buffer, op0, spc, flags, false);
pp_character (buffer, ':');
break;
case LABELED_BLOCK_EXPR:
*************** dump_generic_node (pretty_printer *buffe
*** 1122,1139 ****
if (strcmp (name, "break") == 0
|| strcmp (name, "continue") == 0)
{
! dump_generic_node (buffer, LABELED_BLOCK_BODY (node), spc, flags);
break;
}
}
! dump_generic_node (buffer, LABELED_BLOCK_LABEL (node), spc, flags);
pp_string (buffer, ": {");
if (!(flags & TDF_SLIM))
newline_and_indent (buffer, spc+2);
! dump_generic_node (buffer, LABELED_BLOCK_BODY (node), spc+2, flags);
if (!flags)
newline_and_indent (buffer, spc);
pp_character (buffer, '}');
break;
case EXIT_BLOCK_EXPR:
--- 1141,1159 ----
if (strcmp (name, "break") == 0
|| strcmp (name, "continue") == 0)
{
! dump_generic_node (buffer, LABELED_BLOCK_BODY (node), spc, flags, false);
break;
}
}
! dump_generic_node (buffer, LABELED_BLOCK_LABEL (node), spc, flags, false);
pp_string (buffer, ": {");
if (!(flags & TDF_SLIM))
newline_and_indent (buffer, spc+2);
! dump_generic_node (buffer, LABELED_BLOCK_BODY (node), spc+2, flags, true);
if (!flags)
newline_and_indent (buffer, spc);
pp_character (buffer, '}');
+ is_expr = false;
break;
case EXIT_BLOCK_EXPR:
*************** dump_generic_node (pretty_printer *buffe
*** 1150,1156 ****
}
}
pp_string (buffer, "<<<exit block ");
! dump_generic_node (buffer, op0, spc, flags);
pp_string (buffer, ">>>");
break;
--- 1170,1176 ----
}
}
pp_string (buffer, "<<<exit block ");
! dump_generic_node (buffer, op0, spc, flags, false);
pp_string (buffer, ">>>");
break;
*************** dump_generic_node (pretty_printer *buffe
*** 1169,1178 ****
newline_and_indent (buffer, spc+2);
pp_character (buffer, '{');
newline_and_indent (buffer, spc+4);
! dump_generic_node (buffer, LOOP_EXPR_BODY (node), spc+4, flags);
newline_and_indent (buffer, spc+2);
pp_character (buffer, '}');
}
break;
case RETURN_EXPR:
--- 1189,1199 ----
newline_and_indent (buffer, spc+2);
pp_character (buffer, '{');
newline_and_indent (buffer, spc+4);
! dump_generic_node (buffer, LOOP_EXPR_BODY (node), spc+4, flags, true);
newline_and_indent (buffer, spc+2);
pp_character (buffer, '}');
}
+ is_expr = false;
break;
case RETURN_EXPR:
*************** dump_generic_node (pretty_printer *buffe
*** 1182,1203 ****
{
pp_space (buffer);
if (TREE_CODE (op0) == MODIFY_EXPR)
! dump_generic_node (buffer, TREE_OPERAND (op0, 1), spc, flags);
else
! dump_generic_node (buffer, op0, spc, flags);
}
- pp_character (buffer, ';');
break;
case EXIT_EXPR:
pp_string (buffer, "if (");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
! pp_string (buffer, ") break;");
break;
case SWITCH_EXPR:
pp_string (buffer, "switch (");
! dump_generic_node (buffer, SWITCH_COND (node), spc, flags);
pp_character (buffer, ')');
if (!(flags & TDF_SLIM))
{
--- 1203,1223 ----
{
pp_space (buffer);
if (TREE_CODE (op0) == MODIFY_EXPR)
! dump_generic_node (buffer, TREE_OPERAND (op0, 1), spc, flags, false);
else
! dump_generic_node (buffer, op0, spc, flags, false);
}
break;
case EXIT_EXPR:
pp_string (buffer, "if (");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
! pp_string (buffer, ") break");
break;
case SWITCH_EXPR:
pp_string (buffer, "switch (");
! dump_generic_node (buffer, SWITCH_COND (node), spc, flags, false);
pp_character (buffer, ')');
if (!(flags & TDF_SLIM))
{
*************** dump_generic_node (pretty_printer *buffe
*** 1206,1212 ****
if (SWITCH_BODY (node))
{
newline_and_indent (buffer, spc+4);
! dump_generic_node (buffer, SWITCH_BODY (node), spc+4, flags);
}
else
{
--- 1226,1232 ----
if (SWITCH_BODY (node))
{
newline_and_indent (buffer, spc+4);
! dump_generic_node (buffer, SWITCH_BODY (node), spc+4, flags, true);
}
else
{
*************** dump_generic_node (pretty_printer *buffe
*** 1216,1230 ****
{
tree elt = TREE_VEC_ELT (vec, i);
newline_and_indent (buffer, spc+4);
! dump_generic_node (buffer, elt, spc+4, flags);
pp_string (buffer, " goto ");
! dump_generic_node (buffer, CASE_LABEL (elt), spc+4, flags);
! pp_character (buffer, ';');
}
}
newline_and_indent (buffer, spc+2);
pp_character (buffer, '}');
}
break;
case GOTO_EXPR:
--- 1236,1250 ----
{
tree elt = TREE_VEC_ELT (vec, i);
newline_and_indent (buffer, spc+4);
! dump_generic_node (buffer, elt, spc+4, flags, false);
pp_string (buffer, " goto ");
! dump_generic_node (buffer, CASE_LABEL (elt), spc+4, flags, true);
}
}
newline_and_indent (buffer, spc+2);
pp_character (buffer, '}');
}
+ is_expr = false;
break;
case GOTO_EXPR:
*************** dump_generic_node (pretty_printer *buffe
*** 1242,1253 ****
}
}
pp_string (buffer, "goto ");
! dump_generic_node (buffer, op0, spc, flags);
! pp_character (buffer, ';');
break;
case RESX_EXPR:
! pp_string (buffer, "resx;");
/* ??? Any sensible way to present the eh region? */
break;
--- 1262,1272 ----
}
}
pp_string (buffer, "goto ");
! dump_generic_node (buffer, op0, spc, flags, false);
break;
case RESX_EXPR:
! pp_string (buffer, "resx");
/* ??? Any sensible way to present the eh region? */
break;
*************** dump_generic_node (pretty_printer *buffe
*** 1256,1288 ****
if (ASM_VOLATILE_P (node))
pp_string (buffer, " __volatile__");
pp_character (buffer, '(');
! dump_generic_node (buffer, ASM_STRING (node), spc, flags);
pp_character (buffer, ':');
! dump_generic_node (buffer, ASM_OUTPUTS (node), spc, flags);
pp_character (buffer, ':');
! dump_generic_node (buffer, ASM_INPUTS (node), spc, flags);
if (ASM_CLOBBERS (node))
{
pp_character (buffer, ':');
! dump_generic_node (buffer, ASM_CLOBBERS (node), spc, flags);
}
! pp_string (buffer, ");");
! if (!(flags & TDF_SLIM))
! pp_newline (buffer);
break;
case CASE_LABEL_EXPR:
if (CASE_LOW (node) && CASE_HIGH (node))
{
pp_string (buffer, "case ");
! dump_generic_node (buffer, CASE_LOW (node), spc, flags);
pp_string (buffer, " ... ");
! dump_generic_node (buffer, CASE_HIGH (node), spc, flags);
}
else if (CASE_LOW (node))
{
pp_string (buffer, "case ");
! dump_generic_node (buffer, CASE_LOW (node), spc, flags);
}
else
pp_string (buffer, "default ");
--- 1275,1305 ----
if (ASM_VOLATILE_P (node))
pp_string (buffer, " __volatile__");
pp_character (buffer, '(');
! dump_generic_node (buffer, ASM_STRING (node), spc, flags, false);
pp_character (buffer, ':');
! dump_generic_node (buffer, ASM_OUTPUTS (node), spc, flags, false);
pp_character (buffer, ':');
! dump_generic_node (buffer, ASM_INPUTS (node), spc, flags, false);
if (ASM_CLOBBERS (node))
{
pp_character (buffer, ':');
! dump_generic_node (buffer, ASM_CLOBBERS (node), spc, flags, false);
}
! pp_string (buffer, ")");
break;
case CASE_LABEL_EXPR:
if (CASE_LOW (node) && CASE_HIGH (node))
{
pp_string (buffer, "case ");
! dump_generic_node (buffer, CASE_LOW (node), spc, flags, false);
pp_string (buffer, " ... ");
! dump_generic_node (buffer, CASE_HIGH (node), spc, flags, false);
}
else if (CASE_LOW (node))
{
pp_string (buffer, "case ");
! dump_generic_node (buffer, CASE_LOW (node), spc, flags, false);
}
else
pp_string (buffer, "default ");
*************** dump_generic_node (pretty_printer *buffe
*** 1291,1301 ****
case VTABLE_REF:
pp_string (buffer, "VTABLE_REF <(");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags);
pp_string (buffer, "),");
! dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags);
pp_character (buffer, ',');
! dump_generic_node (buffer, TREE_OPERAND (node, 2), spc, flags);
pp_character (buffer, '>');
break;
--- 1308,1318 ----
case VTABLE_REF:
pp_string (buffer, "VTABLE_REF <(");
! dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
pp_string (buffer, "),");
! dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false);
pp_character (buffer, ',');
! dump_generic_node (buffer, TREE_OPERAND (node, 2), spc, flags, false);
pp_character (buffer, '>');
break;
*************** dump_generic_node (pretty_printer *buffe
*** 1304,1310 ****
int i;
pp_string (buffer, " EPHI (");
! dump_generic_node (buffer, EREF_NAME (node), spc, flags);
pp_string (buffer, ") ");
pp_character (buffer, '[');
pp_string (buffer, " class:");
--- 1321,1327 ----
int i;
pp_string (buffer, " EPHI (");
! dump_generic_node (buffer, EREF_NAME (node), spc, flags, false);
pp_string (buffer, ") ");
pp_character (buffer, '[');
pp_string (buffer, " class:");
*************** dump_generic_node (pretty_printer *buffe
*** 1340,1346 ****
pp_string (buffer, " ] ");
pp_string (buffer, " defined by:");
dump_generic_node (buffer, EPHI_ARG_DEF (node, i),
! spc + 4, flags | TDF_SLIM);
}
}
}
--- 1357,1363 ----
pp_string (buffer, " ] ");
pp_string (buffer, " defined by:");
dump_generic_node (buffer, EPHI_ARG_DEF (node, i),
! spc + 4, flags | TDF_SLIM, false);
}
}
}
*************** dump_generic_node (pretty_printer *buffe
*** 1353,1359 ****
pp_string (buffer, "EEXIT (");
else if (TREE_CODE (node) == EKILL_NODE)
pp_string (buffer, "EKILL (");
! dump_generic_node (buffer, EREF_NAME (node), spc, flags);
pp_string (buffer, ") ");
pp_character (buffer, '[');
pp_string (buffer, "class:");
--- 1370,1376 ----
pp_string (buffer, "EEXIT (");
else if (TREE_CODE (node) == EKILL_NODE)
pp_string (buffer, "EKILL (");
! dump_generic_node (buffer, EREF_NAME (node), spc, flags, false);
pp_string (buffer, ") ");
pp_character (buffer, '[');
pp_string (buffer, "class:");
*************** dump_generic_node (pretty_printer *buffe
*** 1364,1370 ****
break;
case EUSE_NODE:
pp_string (buffer, " EUSE (");
! dump_generic_node (buffer, EREF_NAME (node), spc, flags);
pp_string (buffer, ") ");
pp_character (buffer, '[');
--- 1381,1387 ----
break;
case EUSE_NODE:
pp_string (buffer, " EUSE (");
! dump_generic_node (buffer, EREF_NAME (node), spc, flags, false);
pp_string (buffer, ") ");
pp_character (buffer, '[');
*************** dump_generic_node (pretty_printer *buffe
*** 1383,1393 ****
{
int i;
! dump_generic_node (buffer, PHI_RESULT (node), spc, flags);
pp_string (buffer, " = PHI <");
for (i = 0; i < PHI_NUM_ARGS (node); i++)
{
! dump_generic_node (buffer, PHI_ARG_DEF (node, i), spc, flags);
pp_string (buffer, "(");
pp_decimal_int (buffer, PHI_ARG_EDGE (node, i)->src->index);
pp_string (buffer, ")");
--- 1400,1410 ----
{
int i;
! dump_generic_node (buffer, PHI_RESULT (node), spc, flags, false);
pp_string (buffer, " = PHI <");
for (i = 0; i < PHI_NUM_ARGS (node); i++)
{
! dump_generic_node (buffer, PHI_ARG_DEF (node, i), spc, flags, false);
pp_string (buffer, "(");
pp_decimal_int (buffer, PHI_ARG_EDGE (node, i)->src->index);
pp_string (buffer, ")");
*************** dump_generic_node (pretty_printer *buffe
*** 1399,1421 ****
break;
case SSA_NAME:
! dump_generic_node (buffer, SSA_NAME_VAR (node), spc, flags);
pp_string (buffer, "_");
pp_decimal_int (buffer, SSA_NAME_VERSION (node));
break;
case VDEF_EXPR:
! dump_generic_node (buffer, VDEF_RESULT (node), spc, flags);
pp_string (buffer, " = VDEF <");
! dump_generic_node (buffer, VDEF_OP (node), spc, flags);
pp_string (buffer, ">;");
- pp_newline (buffer);
break;
default:
NIY;
}
pp_write_text_to_stream (buffer);
return spc;
--- 1416,1439 ----
break;
case SSA_NAME:
! dump_generic_node (buffer, SSA_NAME_VAR (node), spc, flags, false);
pp_string (buffer, "_");
pp_decimal_int (buffer, SSA_NAME_VERSION (node));
break;
case VDEF_EXPR:
! dump_generic_node (buffer, VDEF_RESULT (node), spc, flags, false);
pp_string (buffer, " = VDEF <");
! dump_generic_node (buffer, VDEF_OP (node), spc, flags, false);
pp_string (buffer, ">;");
break;
default:
NIY;
}
+ if (is_stmt && is_expr)
+ pp_semicolon (buffer);
pp_write_text_to_stream (buffer);
return spc;
*************** dump_generic_node (pretty_printer *buffe
*** 1424,1430 ****
/* Print the declaration of a variable. */
static void
! print_declaration (pretty_printer *buffer, tree t, int spc, int flags)
{
/* Don't print type declarations. */
if (TREE_CODE (t) == TYPE_DECL)
--- 1442,1448 ----
/* Print the declaration of a variable. */
static void
! print_declaration (pretty_printer *buffer, tree t, int spc)
{
/* Don't print type declarations. */
if (TREE_CODE (t) == TYPE_DECL)
*************** print_declaration (pretty_printer *buffe
*** 1449,1459 ****
tmp = TREE_TYPE (t);
while (TREE_CODE (TREE_TYPE (tmp)) == ARRAY_TYPE)
tmp = TREE_TYPE (tmp);
! dump_generic_node (buffer, TREE_TYPE (tmp), spc, 0);
/* Print variable's name. */
pp_space (buffer);
! dump_generic_node (buffer, t, spc, 0);
/* Print the dimensions. */
tmp = TREE_TYPE (t);
--- 1467,1477 ----
tmp = TREE_TYPE (t);
while (TREE_CODE (TREE_TYPE (tmp)) == ARRAY_TYPE)
tmp = TREE_TYPE (tmp);
! dump_generic_node (buffer, TREE_TYPE (tmp), spc, 0, false);
/* Print variable's name. */
pp_space (buffer);
! dump_generic_node (buffer, t, spc, 0, false);
/* Print the dimensions. */
tmp = TREE_TYPE (t);
*************** print_declaration (pretty_printer *buffe
*** 1467,1473 ****
TREE_INT_CST_LOW (TYPE_SIZE (tmp)) /
TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (tmp))));
else
! dump_generic_node (buffer, TYPE_SIZE_UNIT (tmp), spc, 0);
}
pp_character (buffer, ']');
tmp = TREE_TYPE (tmp);
--- 1485,1491 ----
TREE_INT_CST_LOW (TYPE_SIZE (tmp)) /
TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (tmp))));
else
! dump_generic_node (buffer, TYPE_SIZE_UNIT (tmp), spc, 0, false);
}
pp_character (buffer, ']');
tmp = TREE_TYPE (tmp);
*************** print_declaration (pretty_printer *buffe
*** 1476,1486 ****
else
{
/* Print type declaration. */
! dump_generic_node (buffer, TREE_TYPE (t), spc, 0);
/* Print variable's name. */
pp_space (buffer);
! dump_generic_node (buffer, t, spc, 0);
}
/* The initial value of a function serves to determine wether the function
--- 1494,1504 ----
else
{
/* Print type declaration. */
! dump_generic_node (buffer, TREE_TYPE (t), spc, 0, false);
/* Print variable's name. */
pp_space (buffer);
! dump_generic_node (buffer, t, spc, 0, false);
}
/* The initial value of a function serves to determine wether the function
*************** print_declaration (pretty_printer *buffe
*** 1494,1506 ****
pp_space (buffer);
pp_character (buffer, '=');
pp_space (buffer);
! dump_generic_node (buffer, DECL_INITIAL (t), spc, 0);
}
}
pp_character (buffer, ';');
- if (!(flags & TDF_SLIM))
- pp_newline (buffer);
}
--- 1512,1522 ----
pp_space (buffer);
pp_character (buffer, '=');
pp_space (buffer);
! dump_generic_node (buffer, DECL_INITIAL (t), spc, 0, false);
}
}
pp_character (buffer, ';');
}
*************** print_struct_decl (pretty_printer *buffe
*** 1520,1526 ****
pp_string (buffer, "union ");
else
NIY;
! dump_generic_node (buffer, TYPE_NAME (node), spc, 0);
}
/* Print the contents of the structure. */
--- 1536,1542 ----
pp_string (buffer, "union ");
else
NIY;
! dump_generic_node (buffer, TYPE_NAME (node), spc, 0, false);
}
/* Print the contents of the structure. */
*************** print_struct_decl (pretty_printer *buffe
*** 1543,1549 ****
if (TREE_TYPE (tmp) != node
|| (TREE_CODE (TREE_TYPE (tmp)) == POINTER_TYPE &&
TREE_TYPE (TREE_TYPE (tmp)) != node))
! print_declaration (buffer, tmp, spc+2, 0);
else
{
--- 1559,1568 ----
if (TREE_TYPE (tmp) != node
|| (TREE_CODE (TREE_TYPE (tmp)) == POINTER_TYPE &&
TREE_TYPE (TREE_TYPE (tmp)) != node))
! {
! print_declaration (buffer, tmp, spc+2);
! pp_newline (buffer);
! }
else
{
*************** print_call_name (pretty_printer *buffer,
*** 1831,1846 ****
case ADDR_EXPR:
case INDIRECT_REF:
case NOP_EXPR:
! dump_generic_node (buffer, TREE_OPERAND (op0, 0), 0, 0);
break;
case COND_EXPR:
pp_string (buffer, "(");
! dump_generic_node (buffer, TREE_OPERAND (op0, 0), 0, 0);
pp_string (buffer, ") ? ");
! dump_generic_node (buffer, TREE_OPERAND (op0, 1), 0, 0);
pp_string (buffer, " : ");
! dump_generic_node (buffer, TREE_OPERAND (op0, 2), 0, 0);
break;
case COMPONENT_REF:
--- 1850,1865 ----
case ADDR_EXPR:
case INDIRECT_REF:
case NOP_EXPR:
! dump_generic_node (buffer, TREE_OPERAND (op0, 0), 0, 0, false);
break;
case COND_EXPR:
pp_string (buffer, "(");
! dump_generic_node (buffer, TREE_OPERAND (op0, 0), 0, 0, false);
pp_string (buffer, ") ? ");
! dump_generic_node (buffer, TREE_OPERAND (op0, 1), 0, 0, false);
pp_string (buffer, " : ");
! dump_generic_node (buffer, TREE_OPERAND (op0, 2), 0, 0, false);
break;
case COMPONENT_REF:
*************** print_call_name (pretty_printer *buffer,
*** 1849,1855 ****
TREE_CODE (TREE_OPERAND (op0, 0)) == VAR_DECL)
PRINT_FUNCTION_NAME (TREE_OPERAND (op0, 1));
else
! dump_generic_node (buffer, TREE_OPERAND (op0, 0), 0, 0);
/* else
We can have several levels of structures and a function
pointer inside. This is not implemented yet... */
--- 1868,1874 ----
TREE_CODE (TREE_OPERAND (op0, 0)) == VAR_DECL)
PRINT_FUNCTION_NAME (TREE_OPERAND (op0, 1));
else
! dump_generic_node (buffer, TREE_OPERAND (op0, 0), 0, 0, false);
/* else
We can have several levels of structures and a function
pointer inside. This is not implemented yet... */
*************** print_call_name (pretty_printer *buffer,
*** 1864,1870 ****
break;
case SSA_NAME:
! dump_generic_node (buffer, op0, 0, 0);
break;
default:
--- 1883,1889 ----
break;
case SSA_NAME:
! dump_generic_node (buffer, op0, 0, 0, false);
break;
default:
*************** pretty_print_string (pretty_printer *buf
*** 1963,1970 ****
static void
maybe_init_pretty_print (FILE *file)
{
- last_bb = NULL;
-
if (!initialized)
{
pp_construct (&buffer, /* prefix */NULL, /* line-width */0);
--- 1982,1987 ----
*************** newline_and_indent (pretty_printer *buff
*** 1982,2068 ****
INDENT (spc);
}
-
- static void
- dump_block_info (pretty_printer *buffer, basic_block bb, int spc, int flags)
- {
- if (bb)
- {
- edge e;
- tree *stmt_p = bb->head_tree_p;
- int lineno;
-
- newline_and_indent (buffer, spc);
- pp_scalar (buffer, "# block %d", bb->index);
-
- if (stmt_p
- && is_exec_stmt (*stmt_p)
- && (lineno = get_lineno (*stmt_p)) > 0
- && (flags & TDF_LINENO))
- {
- pp_string (buffer, " (");
- pp_string (buffer, get_filename (*stmt_p));
- pp_scalar (buffer, ":%d", lineno);
- pp_string (buffer, ")");
- }
-
- pp_string (buffer, ". pred:");
- for (e = bb->pred; e; e = e->pred_next)
- if (e->src)
- {
- pp_scalar (buffer, " %d", e->src->index);
- if (e->flags & EDGE_ABNORMAL)
- pp_string (buffer, "(ab)");
- }
-
- pp_string (buffer, ". succ:");
- for (e = bb->succ; e; e = e->succ_next)
- if (e->dest)
- {
- pp_scalar (buffer, " %d", e->dest->index);
- if (e->flags & EDGE_ABNORMAL)
- pp_string (buffer, "(ab)");
- }
-
- pp_character (buffer, '.');
-
- newline_and_indent (buffer, spc);
- }
- }
-
-
static void
dump_vops (pretty_printer *buffer, tree stmt, int spc)
{
size_t i;
- basic_block bb;
stmt_ann_t ann = stmt_ann (stmt);
varray_type vdefs = vdef_ops (ann);
varray_type vuses = vuse_ops (ann);
- bb = bb_for_stmt (stmt);
- if (bb && bb != last_bb && bb->tree_annotations)
- {
- tree phi;
-
- for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
- {
- pp_string (buffer, "# ");
- dump_generic_node (buffer, phi, spc, 0);
- newline_and_indent (buffer, spc);
- }
- }
-
- if (vdefs || vuses)
- newline_and_indent (buffer, spc);
-
if (vdefs)
for (i = 0; i < VARRAY_ACTIVE_SIZE (vdefs); i++)
{
tree vdef = VARRAY_TREE (vdefs, i);
pp_string (buffer, "# ");
! dump_generic_node (buffer, vdef, spc, 0);
! INDENT (spc);
}
if (vuses)
--- 1999,2019 ----
INDENT (spc);
}
static void
dump_vops (pretty_printer *buffer, tree stmt, int spc)
{
size_t i;
stmt_ann_t ann = stmt_ann (stmt);
varray_type vdefs = vdef_ops (ann);
varray_type vuses = vuse_ops (ann);
if (vdefs)
for (i = 0; i < VARRAY_ACTIVE_SIZE (vdefs); i++)
{
tree vdef = VARRAY_TREE (vdefs, i);
pp_string (buffer, "# ");
! dump_generic_node (buffer, vdef, spc + 2, 0, false);
! newline_and_indent (buffer, spc);
}
if (vuses)
*************** dump_vops (pretty_printer *buffer, tree
*** 2070,2077 ****
{
tree vuse = VARRAY_TREE (vuses, i);
pp_string (buffer, "# VUSE <");
! dump_generic_node (buffer, vuse, spc, 0);
pp_string (buffer, ">;");
newline_and_indent (buffer, spc);
}
}
--- 2021,2151 ----
{
tree vuse = VARRAY_TREE (vuses, i);
pp_string (buffer, "# VUSE <");
! dump_generic_node (buffer, vuse, spc + 2, 0, false);
pp_string (buffer, ">;");
newline_and_indent (buffer, spc);
}
+ }
+
+ /* Dumps basic block BB to FILE with details described by FLAGS and
+ indented by INDENT spaces. */
+
+ void
+ dump_generic_bb (FILE *file, basic_block bb, int indent, int flags)
+ {
+ maybe_init_pretty_print (file);
+ dumping_stmts = true;
+ dump_generic_bb_buff (&buffer, bb, indent, flags);
+ pp_flush (&buffer);
+ }
+
+ /* Dumps header of basic block BB to buffer BUFFER indented by INDENT
+ spaces and details described by flags. */
+
+ static void
+ dump_bb_header (pretty_printer *buffer, basic_block bb, int indent, int flags)
+ {
+ edge e;
+
+ INDENT (indent);
+ pp_string (buffer, "# Basic block ");
+ pp_decimal_int (buffer, bb->index);
+
+ if (flags & TDF_LINENO)
+ {
+ block_stmt_iterator bsi;
+ tree stmt = NULL_TREE;
+
+ for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ if (get_lineno (bsi_stmt (bsi)) != -1)
+ {
+ stmt = bsi_stmt (bsi);
+ break;
+ }
+
+ if (stmt)
+ {
+ pp_string (buffer, ", starting at line ");
+ pp_decimal_int (buffer, get_lineno (stmt));
+ }
+ }
+ newline_and_indent (buffer, indent);
+
+ pp_string (buffer, "# Predecessors:");
+ pp_write_text_to_stream (buffer);
+ for (e = bb->pred; e; e = e->pred_next)
+ dump_edge_info (buffer->buffer->stream, e, 0);
+ pp_newline (buffer);
+ }
+
+ /* Dumps end of basic block BB to buffer BUFFER indented by INDENT
+ spaces. */
+
+ static void
+ dump_bb_end (pretty_printer *buffer, basic_block bb, int indent)
+ {
+ edge e;
+
+ INDENT (indent);
+ pp_string (buffer, "# Successors:");
+ pp_write_text_to_stream (buffer);
+ for (e = bb->succ; e; e = e->succ_next)
+ dump_edge_info (buffer->buffer->stream, e, 1);
+ pp_newline (buffer);
+ }
+
+ /* Dumps phi nodes of basic block BB to buffer BUFFER with details described by
+ FLAGS indented by INDENT spaces. */
+
+ static void
+ dump_phi_nodes (pretty_printer *buffer, basic_block bb, int indent, int flags)
+ {
+ tree phi = phi_nodes (bb);
+ if (!phi)
+ return;
+
+ for (; phi; phi = TREE_CHAIN (phi))
+ {
+ INDENT (indent);
+ dump_generic_node (buffer, phi, indent, flags, false);
+ pp_newline (buffer);
+ }
+ pp_newline (buffer);
+ }
+
+ /* Dumps basic block BB to buffer BUFFER with details described by FLAGS and
+ indented by INDENT spaces. */
+
+ static void
+ dump_generic_bb_buff (pretty_printer *buffer, basic_block bb,
+ int indent, int flags)
+ {
+ block_stmt_iterator bsi;
+ tree stmt;
+ int label_indent = indent - 2;
+
+ if (label_indent < 0)
+ label_indent = 0;
+
+ if (flags & TDF_BLOCKS)
+ dump_bb_header (buffer, bb, indent, flags);
+
+ if (flags & TDF_VOPS)
+ dump_phi_nodes (buffer, bb, indent, flags);
+
+ for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ {
+ int curr_indent;
+
+ stmt = bsi_stmt (bsi);
+
+ curr_indent = TREE_CODE (stmt) == LABEL_EXPR ? label_indent : indent;
+
+ INDENT (curr_indent);
+ dump_generic_node (buffer, stmt, curr_indent, flags, true);
+ pp_newline (buffer);
+ }
+
+ if (flags & TDF_BLOCKS)
+ dump_bb_end (buffer, bb, indent);
}
Index: tree-ssa-ccp.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-ccp.c,v
retrieving revision 1.1.2.107
diff -c -3 -p -r1.1.2.107 tree-ssa-ccp.c
*** tree-ssa-ccp.c 8 Nov 2003 09:49:19 -0000 1.1.2.107
--- tree-ssa-ccp.c 8 Nov 2003 16:34:20 -0000
*************** tree_ssa_ccp (tree fndecl, sbitmap vars_
*** 203,209 ****
fprintf (dump_file, "\n");
}
! dump_cfg_function_to_file (fndecl, dump_file, dump_flags);
dump_end (phase, dump_file);
}
}
--- 203,209 ----
fprintf (dump_file, "\n");
}
! dump_function_to_file (fndecl, dump_file, dump_flags);
dump_end (phase, dump_file);
}
}
Index: tree-ssa-copyprop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-copyprop.c,v
retrieving revision 1.1.2.22
diff -c -3 -p -r1.1.2.22 tree-ssa-copyprop.c
*** tree-ssa-copyprop.c 5 Nov 2003 13:39:23 -0000 1.1.2.22
--- tree-ssa-copyprop.c 8 Nov 2003 16:34:21 -0000
*************** tree_ssa_copyprop (tree fndecl, enum tre
*** 79,85 ****
if (dump_file)
{
! dump_cfg_function_to_file (fndecl, dump_file, dump_flags);
dump_end (phase, dump_file);
}
--- 79,85 ----
if (dump_file)
{
! dump_function_to_file (fndecl, dump_file, dump_flags);
dump_end (phase, dump_file);
}
Index: tree-ssa-dce.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-dce.c,v
retrieving revision 1.1.2.64
diff -c -3 -p -r1.1.2.64 tree-ssa-dce.c
*** tree-ssa-dce.c 5 Nov 2003 13:39:23 -0000 1.1.2.64
--- tree-ssa-dce.c 8 Nov 2003 16:34:21 -0000
*************** tree_ssa_dce (tree fndecl, enum tree_dum
*** 539,545 ****
/* Debugging dumps. */
if (dump_file)
{
! dump_cfg_function_to_file (fndecl, dump_file, dump_flags);
print_stats ();
dump_end (phase, dump_file);
}
--- 539,545 ----
/* Debugging dumps. */
if (dump_file)
{
! dump_function_to_file (fndecl, dump_file, dump_flags);
print_stats ();
dump_end (phase, dump_file);
}
Index: tree-ssa-dom.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-dom.c,v
retrieving revision 1.1.2.76
diff -c -3 -p -r1.1.2.76 tree-ssa-dom.c
*** tree-ssa-dom.c 5 Nov 2003 13:39:23 -0000 1.1.2.76
--- tree-ssa-dom.c 8 Nov 2003 16:34:24 -0000
*************** tree_ssa_dominator_optimize_1 (tree fnde
*** 470,476 ****
{
if (dump_flags & TDF_STATS)
dump_dominator_optimization_stats (dump_file);
! dump_cfg_function_to_file (fndecl, dump_file, dump_flags);
dump_end (phase, dump_file);
}
--- 470,476 ----
{
if (dump_flags & TDF_STATS)
dump_dominator_optimization_stats (dump_file);
! dump_function_to_file (fndecl, dump_file, dump_flags);
dump_end (phase, dump_file);
}
Index: tree-ssa-pre.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-pre.c,v
retrieving revision 1.1.4.99
diff -c -3 -p -r1.1.4.99 tree-ssa-pre.c
*** tree-ssa-pre.c 7 Nov 2003 06:17:45 -0000 1.1.4.99
--- tree-ssa-pre.c 8 Nov 2003 16:34:27 -0000
*************** tree_perform_ssapre (tree fndecl, enum t
*** 3310,3316 ****
fprintf (dump_file, "Expressions generated for rename2:%d\n",
pre_stats.exprs_generated);
}
! dump_cfg_function_to_file (fndecl, dump_file, dump_flags);
dump_end (phase, dump_file);
}
--- 3310,3316 ----
fprintf (dump_file, "Expressions generated for rename2:%d\n",
pre_stats.exprs_generated);
}
! dump_function_to_file (fndecl, dump_file, dump_flags);
dump_end (phase, dump_file);
}
Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa.c,v
retrieving revision 1.1.4.145
diff -c -3 -p -r1.1.4.145 tree-ssa.c
*** tree-ssa.c 5 Nov 2003 13:39:24 -0000 1.1.4.145
--- tree-ssa.c 8 Nov 2003 16:34:29 -0000
*************** rewrite_into_ssa (tree fndecl, sbitmap v
*** 448,454 ****
dump_tree_ssa_stats (dump_file);
}
! dump_cfg_function_to_file (fndecl, dump_file, dump_flags);
dump_end (phase, dump_file);
}
--- 448,454 ----
dump_tree_ssa_stats (dump_file);
}
! dump_function_to_file (fndecl, dump_file, dump_flags);
dump_end (phase, dump_file);
}
*************** rewrite_out_of_ssa (tree fndecl, enum tr
*** 1890,1906 ****
tree->rtl expanders deal with. */
remove_useless_stmts_and_vars (&DECL_SAVED_TREE (fndecl), true);
- /* Flush out flow graph and SSA data. */
- delete_tree_ssa (fndecl);
- delete_var_map (map);
- timevar_pop (TV_TREE_SSA_TO_NORMAL);
-
/* Debugging dumps. */
if (dump_file)
{
! dump_cfg_function_to_file (fndecl, dump_file, dump_flags);
dump_end (phase, dump_file);
}
}
--- 1890,1906 ----
tree->rtl expanders deal with. */
remove_useless_stmts_and_vars (&DECL_SAVED_TREE (fndecl), true);
/* Debugging dumps. */
if (dump_file)
{
! dump_function_to_file (fndecl, dump_file, dump_flags);
dump_end (phase, dump_file);
}
+
+ /* Flush out flow graph and SSA data. */
+ delete_tree_ssa (fndecl);
+ delete_var_map (map);
+ timevar_pop (TV_TREE_SSA_TO_NORMAL);
}
Index: tree-tailcall.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-tailcall.c,v
retrieving revision 1.1.2.5
diff -c -3 -p -r1.1.2.5 tree-tailcall.c
*** tree-tailcall.c 8 Nov 2003 14:09:26 -0000 1.1.2.5
--- tree-tailcall.c 8 Nov 2003 16:34:29 -0000
*************** tree_optimize_tail_calls (void)
*** 332,338 ****
if (dump_file)
{
! dump_cfg_function_to_file (current_function_decl, dump_file, dump_flags);
dump_end (TDI_tail, dump_file);
}
}
--- 332,338 ----
if (dump_file)
{
! dump_function_to_file (current_function_decl, dump_file, dump_flags);
dump_end (TDI_tail, dump_file);
}
}