- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_Conv:
- xfprintf (F, "\"%I%I\"", get_irn_opident(n), get_irn_modeident(n));
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_Tuple:
- xfprintf (F, "\"%I%I\"", get_irn_opident(n), get_irn_modeident(n));
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_Add:
- xfprintf (F, "\"%I%I\"", get_irn_opident(n), get_irn_modeident(n));
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_Sub:
- xfprintf (F, "\"%I%I\"", get_irn_opident(n), get_irn_modeident(n));
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_Mul:
- xfprintf (F, "\"%I%I\"", get_irn_opident(n), get_irn_modeident(n));
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_Quot:
- xfprintf (F, "\"%I%I\"", get_irn_opident(n), get_irn_modeident(n));
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_DivMod:
- xfprintf (F, "\"%I%I\"", get_irn_opident(n), get_irn_modeident(n));
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_Div:
- xfprintf (F, "\"%I%I\"", get_irn_opident(n), get_irn_modeident(n));
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_Mod:
- xfprintf (F, "\"%I%I\"", get_irn_opident(n), get_irn_modeident(n));
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_And:
- xfprintf (F, "\"%I%I\"", get_irn_opident(n), get_irn_modeident(n));
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_Or:
- xfprintf (F, "\"%I%I\"", get_irn_opident(n), get_irn_modeident(n));
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_Eor:
- xfprintf (F, "\"%I%I\"", get_irn_opident(n), get_irn_modeident(n));
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_Shl:
- xfprintf (F, "\"%I%I\"", get_irn_opident(n), get_irn_modeident(n));
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_Shr:
- xfprintf (F, "\"%I%I\"", get_irn_opident(n), get_irn_modeident(n));
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_Abs:
- xfprintf (F, "\"%I%I\"", get_irn_opident(n), get_irn_modeident(n));
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_Cmp:
- xfprintf (F, "\"%I%I\"", get_irn_opident(n), get_irn_modeident(n));
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_Jmp:
- xfprintf (F, "\"%I\"", get_irn_opident(n));
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_Cond:
- xfprintf (F, "\"%I\"", get_irn_opident(n));
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_Call:
- xfprintf (F, "\"%I\"", get_irn_opident(n));
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_Return:
- xfprintf (F, "\"%I\"", get_irn_opident(n));
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_Raise:
- xfprintf (F, "\"%I%I\"", get_irn_opident(n), get_irn_modeident(n));
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_Load:
- case iro_Store:
- xfprintf (F, "\"%R\"", n);
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_Alloc:
- xfprintf (F, "\"%I\" ", get_irn_opident(n));
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_Sel:
- assert(get_kind(get_Sel_entity(n)) == k_entity);
- xfprintf (F, "\"%I ", get_irn_opident(n));
- xfprintf (F, "%I", get_entity_ident(get_Sel_entity(n)));
- xfprintf (F, DEFAULT_NODE_ATTR);
- break;
- case iro_SymConst:
- assert(get_kind(get_SymConst_type(n)) == k_type);
- assert(get_type_ident(get_SymConst_type(n)));
- xfprintf (F, "\"%s ", get_type_name(get_SymConst_type(n)));
- switch (n->attr.i.num){
- case type_tag:
- xfprintf (F, "tag\" ");
- break;
- case size:
- xfprintf (F, "size\" ");
- break;
- default:
- assert(0);
- break;
+ }
+ }
+ } break;
+ case iro_CallBegin: {
+ ir_node *call = get_CallBegin_call(n);
+ if (Call_has_callees(call)) {
+ fprintf(F, "possible callees: \n");
+ for (i = 0; i < get_Call_n_callees(call); i++) {
+ if (!get_Call_callee(call, i)) {
+ fprintf(F, " %d external method\n", i);
+ } else {
+ fprintf(F, " %d: %s\n", i, get_ent_dump_name(get_Call_callee(call, i)));
+ }
+ }
+ }
+ } break;
+ case iro_Return: {
+ if (!interprocedural_view) {
+ type *tp = get_entity_type(get_irg_ent(get_irn_irg(n)));
+ fprintf(F, "return in method of type %s \n", get_type_name_ex(tp, &bad));
+ for (i = 0; i < get_method_n_ress(tp); ++i)
+ fprintf(F, " res %d type: %s \n", i, get_type_name_ex(get_method_res_type(tp, i), &bad));
+ }
+ } break;
+ case iro_Const: {
+ type *tp = get_Const_type(n);
+ assert(tp != none_type);
+ fprintf(F, "Const of type %s \n", get_type_name_ex(get_Const_type(n), &bad));
+ } break;
+ case iro_Filter: {
+ int i;
+ if (interprocedural_view) {
+ fprintf(F, "intra predecessor nodes:\n");
+ for (i = 0; i < get_irn_intra_arity(n); i++) {
+ ir_node *pred = get_irn_intra_n(n, i);
+ fprintf(F, " %s%s %ld\n", get_irn_opname(pred), get_irn_modename(pred), get_irn_node_nr(pred));
+ }
+ } else {
+ fprintf(F, "inter predecessor nodes:\n");
+ for (i = 0; i < get_irn_inter_arity(n); i++) {
+ ir_node *pred = get_irn_inter_n(n, i);
+ fprintf(F, " %s%s %ld \tin graph %s\n", get_irn_opname(pred), get_irn_modename(pred),
+ get_irn_node_nr(pred), get_ent_dump_name(get_irg_entity(get_irn_irg(pred))));
+ }
+ }
+ } break;
+ default: ;
+ }
+
+ if (get_irg_typeinfo_state(get_irn_irg(n)) == irg_typeinfo_consistent ||
+ get_irg_typeinfo_state(get_irn_irg(n)) == irg_typeinfo_inconsistent )
+ if (get_irn_type(n) != none_type)
+ fprintf (F, "\nAnalysed type: %s", get_type_name_ex(get_irn_type(n), &bad));
+
+ fprintf (F, "\"");
+
+ return bad;
+}
+
+
+static INLINE
+bool is_constlike_node(ir_node *n) {
+ ir_op *op = get_irn_op(n);
+ return (op == op_Const || op == op_Bad || op == op_SymConst || op == op_Unknown);
+}
+
+
+/* outputs the predecessors of n, that are constants, local. I.e.,
+ generates a copy of the constant predecessors for each node called with. */
+static void dump_const_node_local(ir_node *n) {
+ int i;
+ if (!get_opt_dump_const_local()) return;
+
+ /* Use visited flag to avoid outputting nodes twice.
+ initialize it first. */
+ for (i = 0; i < get_irn_arity(n); i++) {
+ ir_node *con = get_irn_n(n, i);
+ if (is_constlike_node(con)) {
+ set_irn_visited(con, get_irg_visited(current_ir_graph)-1);