#include "irgwalk.h"
#include "tv_t.h"
#include "irouts.h"
+#include "iredges.h"
#include "irdom.h"
#include "irloop_t.h"
#include "callgraph.h"
static int const_entities = 1;
/** An option to dump the keep alive edges */
static int dump_keepalive = 0;
+/** An option to dump the new out edges */
+static int dump_new_edges_flag = 0;
/** An option to dump ld_names instead of names. */
static int dump_ld_name = 1;
/** Compiler options to dump analysis information in dump_ir_graph */
static int dump_loop_information_flag = 0;
static int dump_backedge_information_flag = 1;
static int dump_const_local = 0;
+static int dump_node_idx_labels = 0;
/** An option to dump all graph anchors */
static int dump_anchors = 0;
* are set, else returns dump_const_local_flag.
*/
int get_opt_dump_const_local(void) {
- if (!dump_out_edge_flag && !dump_loop_information_flag)
- return dump_const_local;
- else
+ if (dump_out_edge_flag || dump_loop_information_flag || (dump_new_edges_flag && edges_activated(current_ir_graph)))
return 0;
+ return dump_const_local;
}
/* Set a prefix filter for output functions. */
dump_const_local = flag;
}
+void dump_node_idx_label(int flag) {
+ dump_node_idx_labels = flag;
+}
+
void dump_constant_entity_values(int flag) {
const_entities = flag;
}
dump_keepalive = flag;
}
+void dump_new_edges(int flag) {
+ dump_new_edges_flag = flag;
+}
+
int get_opt_dump_keepalive_edges(void) {
return dump_keepalive;
}
* Walker that visits the anchors
*/
static void ird_walk_graph(ir_graph *irg, irg_walk_func *pre, irg_walk_func *post, void *env) {
- if (dump_anchors) {
+ if (dump_anchors || (dump_new_edges_flag && edges_activated(irg))) {
irg_walk_anchors(irg, pre, post, env);
} else {
irg_walk_graph(irg, pre, post, env);
case symconst_enum_const:
fprintf(F, "SymC %s enum", get_enumeration_name(get_SymConst_enum(n)));
break;
+ case symconst_label:
+ fprintf(F, "SymC %lu label", get_SymConst_label(n));
+ break;
}
} break;
break;
}
case iro_Load:
+ if (get_Load_align(n) == align_non_aligned)
+ fprintf(F, "ua");
fprintf(F, "%s[%s]", get_irn_opname(n), get_mode_name_ex(get_Load_mode(n), &bad));
break;
+ case iro_Store:
+ if (get_Store_align(n) == align_non_aligned)
+ fprintf(F, "ua");
+ fprintf(F, "%s", get_irn_opname(n));
+ break;
case iro_Block:
fprintf(F, "%s%s", is_Block_dead(n) ? "Dead " : "", get_irn_opname(n));
break;
fprintf(F, "strict");
fprintf(F, "%s", get_irn_opname(n));
break;
+ case iro_Div:
+ fprintf(F, "%s[%s]", get_irn_opname(n), get_mode_name_ex(get_Div_resmode(n), &bad));
+ break;
+ case iro_Mod:
+ fprintf(F, "%s[%s]", get_irn_opname(n), get_mode_name_ex(get_Mod_resmode(n), &bad));
+ break;
+ case iro_DivMod:
+ fprintf(F, "%s[%s]", get_irn_opname(n), get_mode_name_ex(get_DivMod_resmode(n), &bad));
+ break;
default:
default_case:
fprintf(F, " ");
bad |= dump_node_typeinfo(F, n);
bad |= dump_node_nodeattr(F, n);
- fprintf(F, "%ld:%d", get_irn_node_nr(n), get_irn_idx(n));
+ if(dump_node_idx_labels) {
+ fprintf(F, "%ld:%d", get_irn_node_nr(n), get_irn_idx(n));
+ } else {
+ fprintf(F, "%ld", get_irn_node_nr(n));
+ }
return bad;
}
* do not use get_nodes_block() here, will fail
* if the irg is not pinned.
*/
- if (get_nodes_block(from) == get_nodes_block(get_irn_n(from, to)))
+ if (get_irn_n(from, -1) == get_irn_n(get_irn_n(from, to), -1))
fprintf(F, INTRA_DATA_EDGE_ATTR);
else
fprintf(F, INTER_DATA_EDGE_ATTR);
* do not use get_nodes_block() here, will fail
* if the irg is not pinned.
*/
- if (get_nodes_block(from) == get_nodes_block(get_irn_n(from, to)))
+ if (get_irn_n(from, -1) == get_irn_n(get_irn_n(from, to), -1))
fprintf(F, INTRA_MEM_EDGE_ATTR);
else
fprintf(F, INTER_MEM_EDGE_ATTR);
fprintf(F, KEEP_ALIVE_DF_EDGE_ATTR);
}
break;
- case iro_Anchor:
- fprintf(F, ANCHOR_EDGE_ATTR);
- break;
default:
if (is_Proj(from)) {
if (get_irn_mode(from) == mode_M)
for (i = 0; i < get_irn_deps(n); ++i) {
ir_node *dep = get_irn_dep(n, i);
- if(dep) {
+ if (dep) {
fprintf(F, "edge: {sourcename: \"");
PRINT_NODEID(n);
fprintf(F, "\" targetname: ");
}
}
+/**
+ * Dump the ir_edges
+ */
+static void
+dump_ir_edges(FILE *F, ir_node *n) {
+ const ir_edge_t *edge;
+ int i = 0;
+
+ foreach_out_edge(n, edge) {
+ ir_node *succ = get_edge_src_irn(edge);
+
+ fprintf(F, "edge: {sourcename: \"");
+ PRINT_NODEID(n);
+ fprintf(F, "\" targetname: \"");
+ PRINT_NODEID(succ);
+ fprintf(F, "\"");
+
+ fprintf(F, " label: \"%d\" ", i);
+ fprintf(F, OUT_EDGE_ATTR);
+ fprintf(F, "}\n");
+ ++i;
+ }
+}
+
+
/** Dumps a node and its edges but not the block edge
*/
-static INLINE void
+static void
dump_node_wo_blockedge(ir_node *n, void *env) {
FILE *F = env;
dump_node(F, n);
dump_whole_node(ir_node *n, void *env) {
FILE *F = env;
dump_node_wo_blockedge(n, env);
- if (!node_floats(n)) dump_ir_block_edge(F, n);
+ if (!node_floats(n))
+ dump_ir_block_edge(F, n);
+ if (dump_new_edges_flag && edges_activated(current_ir_graph))
+ dump_ir_edges(F, n);
}
static void
}
dump_ir_data_edges(F, node);
}
+ if (dump_new_edges_flag && edges_activated(irg))
+ dump_ir_edges(F, node);
}
if (dump_loop_information_flag && (get_irg_loopinfo_state(irg) & loopinfo_valid))
"classname 18: \"Exception Control Flow for Interval Analysis\"\n"
"classname 19: \"Postdominators\"\n"
"classname 20: \"Keep Alive\"\n"
+ "classname 21: \"Out Edges\"\n"
"infoname 1: \"Attribute\"\n"
"infoname 2: \"Verification errors\"\n"
"infoname 3: \"Debug info\"\n",
name, label, orientation);
- /* don't use all, the range is too whith/black. */
+ /* don't use all, the range is too wide. */
n_colors = 18;
base_color = 105;
fprintf(F,
* from irg.
*/
for (i = get_irp_n_irgs() - 1; i >= 0; --i) {
- ir_node **arr = ird_get_irg_link(get_irp_irg(i));
+ ir_graph *g = get_irp_irg(i);
+ ir_node **arr = ird_get_irg_link(g);
if (arr) {
- dump_graph_from_list(f, get_irp_irg(i));
+ dump_graph_from_list(f, g);
DEL_ARR_F(arr);
}
}