* @file
* @brief Write ir graph as a grgen construction rule
* @author Andreas Schoesser
-* @version $Id:$
+* @version $Id$
*/
/*
* Starts dumping
************************************************************************/
-void dump_irg_grgen(ir_graph *irg, char *filename, int append)
+void dump_irg_grgen_file(ir_graph *irg, char *filename, int append)
{
FILE *fp;
grgen_dumpinfo_t dump_info;
}
+void dump_irg_grgen(ir_graph *irg, char *suffix)
+{
+ char filename[100] = "";
+
+ strncat(filename, get_entity_name(get_irg_entity(irg)), 100);
+ strncat(filename, suffix, 100);
+ strncat(filename, ".grg", 100);
+
+ dump_irg_grgen_file(irg, filename, 0);
+}
+
+
/************************************************************************
* Dumps the left hand side of the rule
************************************************************************/
int i;
// Dump edges
- for(i = -1; i < get_irn_arity(n); i++)
+ for(i = is_Block(n) ? 0 : -1; i < get_irn_arity(n); i++)
dump_grg_egde(n, i, dump_info, fp);
}
// Correlate the matched phi edges with the matched block edges
// Caution: Position 0 in the edge_names array is the block edge, so start at 1
- for(i = 0; i < get_irn_arity(n) + 1; i++)
+ for(i = code == iro_Block; i < get_irn_arity(n) + 1; i++)
{
assert(edge_names[i] != NULL && "Some edges have not been dumped!");