From c0071fcb7c9a27651dfdbe2cd95c73b83c80c5d6 Mon Sep 17 00:00:00 2001 From: Till Riedel Date: Tue, 2 Mar 2004 14:52:46 +0000 Subject: [PATCH] introduce a prefix filter [r2480] --- ir/ir/irdump.c | 23 +++++++++++++++++++++-- ir/ir/irdump.h | 1 + 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ir/ir/irdump.c b/ir/ir/irdump.c index 82753881c..08a1988c1 100644 --- a/ir/ir/irdump.c +++ b/ir/ir/irdump.c @@ -195,6 +195,8 @@ static void print_ent_node_edge(FILE *F, entity *E, const ir_node *N, const char /* A suffix to manipulate the file name. */ char *dump_file_suffix = ""; +char *dump_file_filter = ""; + /* file to dump to */ static FILE *F; @@ -1550,8 +1552,10 @@ dump_ir_graph (ir_graph *irg) ir_graph *rem; char *suffix; rem = current_ir_graph; - current_ir_graph = irg; + if(strncmp(get_irg_dump_name(irg),dump_file_filter,strlen(dump_file_filter))!=0) return; + + current_ir_graph = irg; if (interprocedural_view) suffix = "-pure-ip"; else suffix = "-pure"; vcg_open (irg, dump_file_suffix, suffix); @@ -1578,6 +1582,8 @@ dump_ir_block_graph (ir_graph *irg) int i; char *suffix; + if(strncmp(get_irg_dump_name(irg),dump_file_filter,strlen(dump_file_filter))!=0) return; + if (interprocedural_view) suffix = "-ip"; else suffix = ""; vcg_open (irg, dump_file_suffix, suffix); @@ -1603,6 +1609,9 @@ dump_ir_graph_w_types (ir_graph *irg) { ir_graph *rem = current_ir_graph; char *suffix; + + if(strncmp(get_irg_dump_name(irg),dump_file_filter,strlen(dump_file_filter))!=0) return; + current_ir_graph = irg; if (interprocedural_view) suffix = "-pure-wtypes-ip"; @@ -1629,6 +1638,8 @@ dump_ir_block_graph_w_types (ir_graph *irg) char *suffix; ir_graph *rem = current_ir_graph; + if(strncmp(get_irg_dump_name(irg),dump_file_filter,strlen(dump_file_filter))!=0) return; + if (interprocedural_view) suffix = "-wtypes-ip"; else suffix = "-wtypes"; vcg_open (irg, dump_file_suffix, suffix); @@ -1704,6 +1715,9 @@ dump_cfg (ir_graph *irg) ir_graph *rem = current_ir_graph; int ddif = dump_dominator_information_flag; int ipv = interprocedural_view; + + if(strncmp(get_irg_dump_name(irg),dump_file_filter,strlen(dump_file_filter))!=0) return; + current_ir_graph = irg; vcg_open (irg, dump_file_suffix, "-cfg"); @@ -1765,6 +1779,9 @@ dump_type_graph (ir_graph *irg) { ir_graph *rem; rem = current_ir_graph; + + if(strncmp(get_irg_dump_name(irg),dump_file_filter,strlen(dump_file_filter))!=0) return; + current_ir_graph = irg; vcg_open (irg, dump_file_suffix, "-type"); @@ -1829,7 +1846,7 @@ void dump_all_ir_graphs (dump_graph_func *dmp_grph) { void dump_loops_standalone (ir_loop *loop) { - int i, loop_node_started = 0, son_number = 0, first; + int i, loop_node_started = 0, son_number = 0, first = 0; loop_element le; /* Dump a new loop node. */ @@ -1904,6 +1921,8 @@ void dump_loop_tree(ir_graph *irg, char *suffix) int el_rem = edge_label; edge_label = 1; + if(strncmp(get_irg_dump_name(irg),dump_file_filter,strlen(dump_file_filter))!=0) return; + current_ir_graph = irg; vcg_open(irg, suffix, "-looptree"); diff --git a/ir/ir/irdump.h b/ir/ir/irdump.h index 53e1cd220..6d66d3f67 100644 --- a/ir/ir/irdump.h +++ b/ir/ir/irdump.h @@ -43,6 +43,7 @@ * @todo GL: A hack -- add parameter to dumper function. */ extern char *dump_file_suffix; +extern char *dump_file_filter; /** * Dump a firm graph. -- 2.20.1