X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firdumptxt.c;h=322da9be4a807dedba0262f02ed8d0eb34e19f52;hb=eb47aca33f2f8c414409f3695e73277b47442334;hp=2a461b85e66f23827c1e5ef193e2b6c2b2379feb;hpb=9d3c8631459f431c313160dab5778e8a7b88dd92;p=libfirm diff --git a/ir/ir/irdumptxt.c b/ir/ir/irdumptxt.c index 2a461b85e..322da9be4 100644 --- a/ir/ir/irdumptxt.c +++ b/ir/ir/irdumptxt.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -123,8 +123,8 @@ void dump_irnode_to_file(FILE *F, ir_node *n) if (get_irg_loopinfo_state(irg) & loopinfo_valid) { ir_loop *loop = get_irn_loop(n); if (loop != NULL) { - fprintf(F, " in loop %d with depth %d\n", - get_loop_loop_nr(loop), get_loop_depth(loop)); + fprintf(F, " in loop %ld with depth %u\n", + get_loop_loop_nr(loop), get_loop_depth(loop)); } } @@ -137,9 +137,14 @@ void dump_irnode_to_file(FILE *F, ir_node *n) fprintf(F, " block marked: %u\n", get_Block_mark(n)); if (get_irg_dom_state(get_irn_irg(n)) != dom_none) { fprintf(F, " dom depth %d\n", get_Block_dom_depth(n)); - fprintf(F, " tree pre num %d\n", get_Block_dom_tree_pre_num(n)); + fprintf(F, " domtree pre num %d\n", get_Block_dom_tree_pre_num(n)); fprintf(F, " max subtree pre num %d\n", get_Block_dom_max_subtree_pre_num(n)); } + if (get_irg_postdom_state(get_irn_irg(n)) != dom_none) { + fprintf(F, " pdom depth %d\n", get_Block_postdom_depth(n)); + fprintf(F, " pdomtree pre num %d\n", get_Block_pdom_tree_pre_num(n)); + fprintf(F, " max pdomsubtree pre num %d\n", get_Block_pdom_max_subtree_pre_num(n)); + } fprintf(F, " Execution frequency statistics:\n"); if (get_irg_exec_freq_state(get_irn_irg(n)) != exec_freq_none) @@ -149,6 +154,7 @@ void dump_irnode_to_file(FILE *F, ir_node *n) /* not dumped: mature */ } break; case iro_Start: { + size_t i; ir_type *tp = get_entity_type(get_irg_entity(get_irn_irg(n))); ir_fprintf(F, " start of method of type %+F\n", tp); for (i = 0; i < get_method_n_params(tp); ++i) @@ -185,22 +191,29 @@ void dump_irnode_to_file(FILE *F, ir_node *n) fprintf(F, " tail call\n"); ir_fprintf(F, " calling method of type %+F\n", tp); if (get_unknown_type() != tp) { + size_t i; for (i = 0; i < get_method_n_params(tp); ++i) ir_fprintf(F, " param %d type: %+F\n", i, get_method_param_type(tp, i)); for (i = 0; i < get_method_n_ress(tp); ++i) ir_fprintf(F, " result %d type: %+F\n", i, get_method_res_type(tp, i)); } if (Call_has_callees(n)) { + size_t i; fprintf(F, " possible callees:\n"); for (i = 0; i < get_Call_n_callees(n); i++) { - fprintf(F, " %d: %s\n", i, get_ent_dump_name(get_Call_callee(n, i))); + ir_fprintf(F, " %zu: %s\n", i, get_ent_dump_name(get_Call_callee(n, i))); } } } break; case iro_Cast: { ir_fprintf(F, " cast to type: %+F\n", get_Cast_type(n)); } break; + case iro_Cmp: { + ir_relation relation = get_Cmp_relation(n); + ir_fprintf(F, " relation: %s\n", get_relation_string(relation)); + } break; case iro_Return: { + size_t i; ir_type *tp = get_entity_type(get_irg_entity(get_irn_irg(n))); ir_fprintf(F, " return in method of type %+F\n", tp); for (i = 0; i < get_method_n_ress(tp); ++i) { @@ -244,14 +257,14 @@ void dump_irnode_to_file(FILE *F, ir_node *n) case iro_Load: fprintf(F, " mode of loaded value: %s\n", get_mode_name_ex(get_Load_mode(n), NULL)); fprintf(F, " volatility: %s\n", get_volatility_name(get_Load_volatility(n))); - fprintf(F, " align: %s\n", get_align_name(get_Load_align(n))); + fprintf(F, " align: %s\n", get_align_name(get_Load_unaligned(n))); break; case iro_Store: fprintf(F, " volatility: %s\n", get_volatility_name(get_Store_volatility(n))); - fprintf(F, " align: %s\n", get_align_name(get_Store_align(n))); + fprintf(F, " align: %s\n", get_align_name(get_Store_unaligned(n))); break; case iro_Confirm: - fprintf(F, " compare operation: %s\n", get_pnc_string(get_Confirm_cmp(n))); + fprintf(F, " compare operation: %s\n", get_relation_string(get_Confirm_relation(n))); break; case iro_ASM: { const ir_asm_constraint *cons; @@ -311,15 +324,15 @@ void dump_graph_as_text(FILE *out, ir_graph *irg) * "prefix" node8, ... node15,\n * "prefix" node16, node17\n */ -static void dump_node_list(FILE *F, firm_kind *k, char *prefix, - int (*get_entity_n_nodes)(firm_kind *ent), - ir_node *(*get_entity_node)(firm_kind *ent, int pos), - char *name) +static void dump_node_list(FILE *F, firm_kind *k, const char *prefix, + size_t (*get_entity_n_nodes)(firm_kind *ent), + ir_node *(*get_entity_node)(firm_kind *ent, size_t pos), + const char *name) { - int i, n_nodes = get_entity_n_nodes(k); - char *comma = ""; + size_t i, n_nodes = get_entity_n_nodes(k); + const char *comma = ""; - fprintf(F, "%s %s (%d):", prefix, name, n_nodes); + ir_fprintf(F, "%s %s (%zu):", prefix, name, n_nodes); for (i = 0; i < n_nodes; ++i) { if (i > 7 && !(i & 7)) { /* line break every eight node. */ fprintf(F, ",\n%s ", prefix); @@ -338,15 +351,15 @@ static void dump_node_list(FILE *F, firm_kind *k, char *prefix, * "prefix" node8, ... node15,\n * "prefix" node16, node17\n */ -static void dump_type_list(FILE *F, ir_type *tp, char *prefix, - int (*get_n_types)(const ir_type *tp), - ir_type *(*get_type)(const ir_type *tp, int pos), +static void dump_type_list(FILE *F, ir_type *tp, const char *prefix, + size_t (*get_n_types)(const ir_type *tp), + ir_type *(*get_type)(const ir_type *tp, size_t pos), const char *name) { - int i, n_nodes = get_n_types(tp); - char *comma = ""; + size_t i, n_nodes = get_n_types(tp); + const char *comma = ""; - fprintf(F, "%s %s (%d):", prefix, name, n_nodes); + ir_fprintf(F, "%s %s (%zu):", prefix, name, n_nodes); for (i = 0; i < n_nodes; ++i) { if (i > 7 && !(i & 7)) { /* line break every eight node. */ fprintf(F, ",\n%s ", prefix); @@ -446,9 +459,8 @@ static void dump_entity_linkage(FILE *F, const ir_entity *entity) fprintf(F, " hidden_user"); } -static void dump_entity_to_file_prefix(FILE *F, ir_entity *ent, char *prefix) +static void dump_entity_to_file_prefix(FILE *F, ir_entity *ent, const char *prefix) { - int i, j; ir_type *owner, *type; assert(is_entity(ent)); @@ -467,6 +479,7 @@ static void dump_entity_to_file_prefix(FILE *F, ir_entity *ent, char *prefix) if (is_Class_type(get_entity_owner(ent))) { if (get_entity_n_overwrites(ent) > 0) { + size_t i; fprintf(F, "%s overwrites:\n", prefix); for (i = 0; i < get_entity_n_overwrites(ent); ++i) { ir_entity *ov = get_entity_overwrites(ent, i); @@ -477,6 +490,7 @@ static void dump_entity_to_file_prefix(FILE *F, ir_entity *ent, char *prefix) fprintf(F, "%s Does not overwrite other entities.\n", prefix); } if (get_entity_n_overwrittenby(ent) > 0) { + size_t i; fprintf(F, "%s overwritten by:\n", prefix); for (i = 0; i < get_entity_n_overwrittenby(ent); ++i) { ir_entity *ov = get_entity_overwrittenby(ent, i); @@ -572,8 +586,10 @@ static void dump_entity_to_file_prefix(FILE *F, ir_entity *ent, char *prefix) need_nl = 1; dump_ir_initializers_to_file(F, prefix, initializer, get_entity_type(ent)); } else if (entity_has_compound_ent_values(ent)) { + size_t i; fprintf(F, "%s compound values:", prefix); for (i = 0; i < get_compound_ent_n_values(ent); ++i) { + size_t j; compound_graph_path *path = get_compound_ent_value_path(ent, i); ir_entity *ent0 = get_compound_graph_path_node(path, 0); fprintf(F, "\n%s %3d:%u ", prefix, get_entity_offset(ent0), get_entity_offset_bits_remainder(ent0)); @@ -584,7 +600,7 @@ static void dump_entity_to_file_prefix(FILE *F, ir_entity *ent, char *prefix) ir_entity *node = get_compound_graph_path_node(path, j); fprintf(F, ".%s", get_entity_name(node)); if (is_Array_type(get_entity_owner(node))) - fprintf(F, "[%d]", get_compound_graph_path_array_index(path, j)); + fprintf(F, "[%ld]", get_compound_graph_path_array_index(path, j)); } fprintf(F, "\t = "); dump_node_opcode(F, get_compound_ent_value(ent, i)); @@ -613,10 +629,10 @@ static void dump_entity_to_file_prefix(FILE *F, ir_entity *ent, char *prefix) if (get_trouts_state()) { fprintf(F, "%s Entity outs:\n", prefix); - dump_node_list(F, (firm_kind *)ent, prefix, (int(*)(firm_kind *))get_entity_n_accesses, - (ir_node *(*)(firm_kind *, int))get_entity_access, "Accesses"); - dump_node_list(F, (firm_kind *)ent, prefix, (int(*)(firm_kind *))get_entity_n_references, - (ir_node *(*)(firm_kind *, int))get_entity_reference, "References"); + dump_node_list(F, (firm_kind *)ent, prefix, (size_t(*)(firm_kind *))get_entity_n_accesses, + (ir_node *(*)(firm_kind *, size_t))get_entity_access, "Accesses"); + dump_node_list(F, (firm_kind *)ent, prefix, (size_t(*)(firm_kind *))get_entity_n_references, + (ir_node *(*)(firm_kind *, size_t))get_entity_reference, "References"); } } @@ -628,7 +644,7 @@ void dump_entity_to_file(FILE *out, ir_entity *ent) void dump_type_to_file(FILE *F, ir_type *tp) { - int i; + size_t i; if ((is_Class_type(tp)) && (verbosity & dump_verbosity_noClassTypes)) return; if ((is_Struct_type(tp)) && (verbosity & dump_verbosity_noStructTypes)) return; @@ -709,7 +725,7 @@ void dump_type_to_file(FILE *F, ir_type *tp) case tpo_array: if (verbosity & dump_verbosity_typeattrs) { - int i, n_dim; + size_t i, n_dim; ir_type *elem_tp = get_array_element_type(tp); fprintf(F, "\n array "); @@ -741,7 +757,7 @@ void dump_type_to_file(FILE *F, ir_type *tp) fprintf(F, "\n order: "); for (i = 0; i < n_dim; ++i) - fprintf(F, "<%d>", get_array_order(tp, i)); + fprintf(F, "<%zu>", get_array_order(tp, i)); fprintf(F, "\n"); @@ -762,13 +778,15 @@ void dump_type_to_file(FILE *F, ir_type *tp) case tpo_method: if (verbosity & dump_verbosity_typeattrs) { fprintf(F, "\n variadicity: %s", get_variadicity_name(get_method_variadicity(tp))); - fprintf(F, "\n return types: %d", get_method_n_ress(tp)); + fprintf(F, "\n return types: %lu", + (unsigned long) get_method_n_ress(tp)); for (i = 0; i < get_method_n_ress(tp); ++i) { ir_type *rtp = get_method_res_type(tp, i); ir_fprintf(F, "\n %+F", rtp); } - fprintf(F, "\n parameter types: %d", get_method_n_params(tp)); + fprintf(F, "\n parameter types: %lu", + (unsigned long) get_method_n_params(tp)); for (i = 0; i < get_method_n_params(tp); ++i) { ir_type *ptp = get_method_param_type(tp, i); ir_fprintf(F, "\n %+F", ptp); @@ -808,10 +826,10 @@ void dump_type_to_file(FILE *F, ir_type *tp) if (get_trouts_state()) { fprintf(F, "\n Type outs:\n"); - dump_node_list(F, (firm_kind *)tp, " ", (int(*)(firm_kind *))get_type_n_allocs, - (ir_node *(*)(firm_kind *, int))get_type_alloc, "Allocations"); - dump_node_list(F, (firm_kind *)tp, " ", (int(*)(firm_kind *))get_type_n_casts, - (ir_node *(*)(firm_kind *, int))get_type_cast, "Casts"); + dump_node_list(F, (firm_kind *)tp, " ", (size_t(*)(firm_kind *))get_type_n_allocs, + (ir_node *(*)(firm_kind *, size_t))get_type_alloc, "Allocations"); + dump_node_list(F, (firm_kind *)tp, " ", (size_t(*)(firm_kind *))get_type_n_casts, + (ir_node *(*)(firm_kind *, size_t))get_type_cast, "Casts"); dump_type_list(F, tp, " ", get_type_n_pointertypes_to, get_type_pointertype_to, "PointerTpsTo"); } @@ -820,8 +838,7 @@ void dump_type_to_file(FILE *F, ir_type *tp) void dump_types_as_text(FILE *out) { - int i; - int n_types = get_irp_n_types(); + size_t i, n_types = get_irp_n_types(); for (i = 0; i < n_types; ++i) { ir_type *type = get_irp_type(i); @@ -832,8 +849,8 @@ void dump_types_as_text(FILE *out) void dump_globals_as_text(FILE *out) { ir_type *global_type = get_glob_type(); - int n_members = get_class_n_members(global_type); - int i; + size_t n_members = get_class_n_members(global_type); + size_t i; for (i = 0; i < n_members; ++i) { ir_entity *entity = get_class_member(global_type, i);