From cda6870fc00cbd490d382b7acb34713138411281 Mon Sep 17 00:00:00 2001 From: tneumann Date: Sat, 30 Jun 2007 10:52:30 +0000 Subject: [PATCH] * ipa.c (cgraph_postorder): Cast according to the coding conventions. (cgraph_remove_unreachable_nodes): Likewise. * ipa-cp.c (ipcp_propagate_stage): Use BOTTOM instead of integer 0. * ipa-inline.c (update_caller_keys): Cast according to the coding conventions. (cgraph_decide_recursive_inlining): Likewise. (cgraph_decide_inlining_of_small_function): Likewise. (try_inline): Likewise. (cgraph_decide_inlining_incrementally): Likewise. * ipa-pure-const.c (get_function_state): Likewise. (scan_function): Likewise. (analyze_function): Likewise. (static_execute): Likewise. * gcc/ipa-reference.c (scan_for_static_refs): Likewise. (merge_callee_local_info): Likewise. (analyze_function): Use type safe memory macros. (static_execute): Likewise. Cast according to the coding conventions. * ipa-type-escape.c (scan_for_regs): Cast according to the coding conventions. * ipa-utils.c (searchc): Likewise. Avoid using C++ keywords as variable names. (ipa_utils_reduced_inorder): Likewise. Use type safe memory macros. * ipa-utils.h (struct ipa_dfa_info): Avoid using C++ keywords as variable names. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126140 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 27 +++++++++++++++++++++++++++ gcc/ipa-cp.c | 2 +- gcc/ipa-inline.c | 18 ++++++++++-------- gcc/ipa-pure-const.c | 16 ++++++++-------- gcc/ipa-reference.c | 32 ++++++++++++++++---------------- gcc/ipa-type-escape.c | 2 +- gcc/ipa-utils.c | 16 ++++++++-------- gcc/ipa-utils.h | 2 +- gcc/ipa.c | 6 +++--- 9 files changed, 75 insertions(+), 46 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ed02674..047c18f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,30 @@ +2006-06-30 Thomas Neumann + + * ipa.c (cgraph_postorder): Cast according to the coding conventions. + (cgraph_remove_unreachable_nodes): Likewise. + * ipa-cp.c (ipcp_propagate_stage): Use BOTTOM instead of integer 0. + * ipa-inline.c (update_caller_keys): Cast according to the coding + conventions. + (cgraph_decide_recursive_inlining): Likewise. + (cgraph_decide_inlining_of_small_function): Likewise. + (try_inline): Likewise. + (cgraph_decide_inlining_incrementally): Likewise. + * ipa-pure-const.c (get_function_state): Likewise. + (scan_function): Likewise. + (analyze_function): Likewise. + (static_execute): Likewise. + * gcc/ipa-reference.c (scan_for_static_refs): Likewise. + (merge_callee_local_info): Likewise. + (analyze_function): Use type safe memory macros. + (static_execute): Likewise. Cast according to the coding conventions. + * ipa-type-escape.c (scan_for_regs): Cast according to the coding + conventions. + * ipa-utils.c (searchc): Likewise. Avoid using C++ keywords as variable + names. + (ipa_utils_reduced_inorder): Likewise. Use type safe memory macros. + * ipa-utils.h (struct ipa_dfa_info): Avoid using C++ keywords as + variable names. + 2007-06-29 Andrew Pinski PR middle-end/30024 diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index ee989c1..fe34881 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -570,7 +570,7 @@ static void ipcp_propagate_stage (void) { int i; - struct ipcp_formal cval1 = { 0, {0} }, cval = { 0,{0} }; + struct ipcp_formal cval1 = { BOTTOM, {0} }, cval = { BOTTOM, {0} }; struct ipcp_formal *cval2; struct cgraph_node *mt, *callee; struct cgraph_edge *cs; diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 1aacce4..cd7d2af 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -583,7 +583,7 @@ update_caller_keys (fibheap_t heap, struct cgraph_node *node, for (edge = node->callers; edge; edge = edge->next_caller) if (edge->aux) { - fibheap_delete_node (heap, edge->aux); + fibheap_delete_node (heap, (fibnode_t) edge->aux); edge->aux = NULL; if (edge->inline_failed) edge->inline_failed = failed_reason; @@ -597,7 +597,7 @@ update_caller_keys (fibheap_t heap, struct cgraph_node *node, int badness = cgraph_edge_badness (edge); if (edge->aux) { - fibnode_t n = edge->aux; + fibnode_t n = (fibnode_t) edge->aux; gcc_assert (n->data == edge); if (n->key == badness) continue; @@ -605,7 +605,7 @@ update_caller_keys (fibheap_t heap, struct cgraph_node *node, /* fibheap_replace_key only increase the keys. */ if (fibheap_replace_key (heap, n, badness)) continue; - fibheap_delete_node (heap, edge->aux); + fibheap_delete_node (heap, (fibnode_t) edge->aux); } edge->aux = fibheap_insert (heap, badness, edge); } @@ -705,7 +705,8 @@ cgraph_decide_recursive_inlining (struct cgraph_node *node) && (cgraph_estimate_size_after_inlining (1, node, master_clone) <= limit)) { - struct cgraph_edge *curr = fibheap_extract_min (heap); + struct cgraph_edge *curr + = (struct cgraph_edge *) fibheap_extract_min (heap); struct cgraph_node *cnode; depth = 1; @@ -856,7 +857,8 @@ cgraph_decide_inlining_of_small_functions (void) max_insns = compute_max_insns (overall_insns); min_insns = overall_insns; - while (overall_insns <= max_insns && (edge = fibheap_extract_min (heap))) + while (overall_insns <= max_insns + && (edge = (struct cgraph_edge *) fibheap_extract_min (heap))) { int old_insns = overall_insns; struct cgraph_node *where; @@ -994,7 +996,7 @@ cgraph_decide_inlining_of_small_functions (void) fprintf (dump_file, "New minimal insns reached: %i\n", min_insns); } } - while ((edge = fibheap_extract_min (heap)) != NULL) + while ((edge = (struct cgraph_edge *) fibheap_extract_min (heap)) != NULL) { gcc_assert (edge->aux); edge->aux = NULL; @@ -1182,7 +1184,7 @@ static bool try_inline (struct cgraph_edge *e, enum inlining_mode mode, int depth) { struct cgraph_node *callee = e->callee; - enum inlining_mode callee_mode = (size_t) callee->aux; + enum inlining_mode callee_mode = (enum inlining_mode) (size_t) callee->aux; bool always_inline = e->callee->local.disregard_inline_limits; /* We've hit cycle? */ @@ -1259,7 +1261,7 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node, verify_cgraph_node (node); #endif - old_mode = (size_t)node->aux; + old_mode = (enum inlining_mode) (size_t)node->aux; if (mode != INLINE_ALWAYS_INLINE && lookup_attribute ("flatten", DECL_ATTRIBUTES (node->decl)) != NULL) diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c index 1be8ef1..b710bf0 100644 --- a/gcc/ipa-pure-const.c +++ b/gcc/ipa-pure-const.c @@ -80,8 +80,8 @@ typedef struct funct_state_d * funct_state; static inline funct_state get_function_state (struct cgraph_node *node) { - struct ipa_dfs_info * info = node->aux; - return info->aux; + struct ipa_dfs_info * info = (struct ipa_dfs_info *) node->aux; + return (funct_state) info->aux; } /* Check to see if the use (or definition when CHECHING_WRITE is true) @@ -396,7 +396,7 @@ scan_function (tree *tp, int *walk_subtrees, void *data) { - struct cgraph_node *fn = data; + struct cgraph_node *fn = (struct cgraph_node *) data; tree t = *tp; funct_state local = get_function_state (fn); @@ -505,7 +505,7 @@ analyze_function (struct cgraph_node *fn) { funct_state l = XCNEW (struct funct_state_d); tree decl = fn->decl; - struct ipa_dfs_info * w_info = fn->aux; + struct ipa_dfs_info * w_info = (struct ipa_dfs_info *) fn->aux; w_info->aux = l; @@ -602,7 +602,7 @@ static_execute (void) struct cgraph_node *w; struct cgraph_node **order = XCNEWVEC (struct cgraph_node *, cgraph_n_nodes); - int order_pos = order_pos = ipa_utils_reduced_inorder (order, true, false); + int order_pos = ipa_utils_reduced_inorder (order, true, false); int i; struct ipa_dfs_info * w_info; @@ -673,7 +673,7 @@ static_execute (void) } } } - w_info = w->aux; + w_info = (struct ipa_dfs_info *) w->aux; w = w_info->next_cycle; } @@ -708,7 +708,7 @@ static_execute (void) break; } } - w_info = w->aux; + w_info = (struct ipa_dfs_info *) w->aux; w = w_info->next_cycle; } } @@ -718,7 +718,7 @@ static_execute (void) /* Get rid of the aux information. */ if (node->aux) { - w_info = node->aux; + w_info = (struct ipa_dfs_info *) node->aux; if (w_info->aux) free (w_info->aux); free (node->aux); diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c index af6dac7..62b1c1d 100644 --- a/gcc/ipa-reference.c +++ b/gcc/ipa-reference.c @@ -475,7 +475,7 @@ scan_for_static_refs (tree *tp, int *walk_subtrees, void *data) { - struct cgraph_node *fn = data; + struct cgraph_node *fn = (struct cgraph_node *) data; tree t = *tp; ipa_reference_local_vars_info_t local = NULL; if (fn) @@ -692,7 +692,7 @@ merge_callee_local_info (struct cgraph_node *target, get_reference_vars_info_from_cgraph (target)->local; /* Make the world safe for tail recursion. */ - struct ipa_dfs_info *node_info = x->aux; + struct ipa_dfs_info *node_info = (struct ipa_dfs_info *) x->aux; if (node_info->aux) return; @@ -787,9 +787,9 @@ static void analyze_function (struct cgraph_node *fn) { ipa_reference_vars_info_t info - = xcalloc (1, sizeof (struct ipa_reference_vars_info_d)); + = XCNEW (struct ipa_reference_vars_info_d); ipa_reference_local_vars_info_t l - = xcalloc (1, sizeof (struct ipa_reference_local_vars_info_d)); + = XCNEW (struct ipa_reference_local_vars_info_d); tree decl = fn->decl; /* Add the info to the tree's annotation. */ @@ -908,8 +908,8 @@ static_execute (void) struct varpool_node *vnode; struct cgraph_node *w; struct cgraph_node **order = - xcalloc (cgraph_n_nodes, sizeof (struct cgraph_node *)); - int order_pos = order_pos = ipa_utils_reduced_inorder (order, false, true); + XCNEWVEC (struct cgraph_node *, cgraph_n_nodes); + int order_pos = ipa_utils_reduced_inorder (order, false, true); int i; ipa_init (); @@ -1080,7 +1080,7 @@ static_execute (void) { ipa_reference_vars_info_t node_info; ipa_reference_global_vars_info_t node_g = - xcalloc (1, sizeof (struct ipa_reference_global_vars_info_d)); + XCNEW (struct ipa_reference_global_vars_info_d); ipa_reference_local_vars_info_t node_l; bool read_all; @@ -1104,7 +1104,7 @@ static_execute (void) /* If any node in a cycle is calls_read_all or calls_write_all they all are. */ - w_info = node->aux; + w_info = (struct ipa_dfs_info *) node->aux; w = w_info->next_cycle; while (w) { @@ -1113,7 +1113,7 @@ static_execute (void) read_all |= w_l->calls_read_all; write_all |= w_l->calls_write_all; - w_info = w->aux; + w_info = (struct ipa_dfs_info *) w->aux; w = w_info->next_cycle; } @@ -1136,7 +1136,7 @@ static_execute (void) node_l->statics_written); } - w_info = node->aux; + w_info = (struct ipa_dfs_info *) node->aux; w = w_info->next_cycle; while (w) { @@ -1157,7 +1157,7 @@ static_execute (void) if (!write_all) bitmap_ior_into (node_g->statics_written, w_l->statics_written); - w_info = w->aux; + w_info = (struct ipa_dfs_info *) w->aux; w = w_info->next_cycle; } @@ -1165,7 +1165,7 @@ static_execute (void) while (w) { propagate_bits (w); - w_info = w->aux; + w_info = (struct ipa_dfs_info *) w->aux; w = w_info->next_cycle; } } @@ -1182,12 +1182,12 @@ static_execute (void) node = order[i]; merge_callee_local_info (node, node); - w_info = node->aux; + w_info = (struct ipa_dfs_info *) node->aux; w = w_info->next_cycle; while (w) { merge_callee_local_info (w, w); - w_info = w->aux; + w_info = (struct ipa_dfs_info *) w->aux; w = w_info->next_cycle; } } @@ -1225,7 +1225,7 @@ static_execute (void) get_static_name (index)); } - w_info = node->aux; + w_info = (struct ipa_dfs_info *) node->aux; w = w_info->next_cycle; while (w) { @@ -1251,7 +1251,7 @@ static_execute (void) } - w_info = w->aux; + w_info = (struct ipa_dfs_info *) w->aux; w = w_info->next_cycle; } fprintf (dump_file, "\n globals read: "); diff --git a/gcc/ipa-type-escape.c b/gcc/ipa-type-escape.c index 0398b84..a2d459a 100644 --- a/gcc/ipa-type-escape.c +++ b/gcc/ipa-type-escape.c @@ -1499,7 +1499,7 @@ okay_pointer_operation (enum tree_code code, tree op0, tree op1) static tree scan_for_refs (tree *tp, int *walk_subtrees, void *data) { - struct cgraph_node *fn = data; + struct cgraph_node *fn = (struct cgraph_node *) data; tree t = *tp; switch (TREE_CODE (t)) diff --git a/gcc/ipa-utils.c b/gcc/ipa-utils.c index f0025c7..8b7aeaf 100644 --- a/gcc/ipa-utils.c +++ b/gcc/ipa-utils.c @@ -86,10 +86,10 @@ static void searchc (struct searchc_env* env, struct cgraph_node *v) { struct cgraph_edge *edge; - struct ipa_dfs_info *v_info = v->aux; + struct ipa_dfs_info *v_info = (struct ipa_dfs_info *) v->aux; /* mark node as old */ - v_info->new = false; + v_info->new_node = false; splay_tree_remove (env->nodes_marked_new, v->uid); v_info->dfn_number = env->count; @@ -107,8 +107,8 @@ searchc (struct searchc_env* env, struct cgraph_node *v) w = cgraph_master_clone (w); if (w && w->aux) { - w_info = w->aux; - if (w_info->new) + w_info = (struct ipa_dfs_info *) w->aux; + if (w_info->new_node) { searchc (env, w); v_info->low_link = @@ -132,7 +132,7 @@ searchc (struct searchc_env* env, struct cgraph_node *v) struct ipa_dfs_info *x_info; do { x = env->stack[--(env->stack_size)]; - x_info = x->aux; + x_info = (struct ipa_dfs_info *) x->aux; x_info->on_stack = false; if (env->reduce) @@ -177,10 +177,10 @@ ipa_utils_reduced_inorder (struct cgraph_node **order, AVAIL_OVERWRITABLE)))) { /* Reuse the info if it is already there. */ - struct ipa_dfs_info *info = node->aux; + struct ipa_dfs_info *info = (struct ipa_dfs_info *) node->aux; if (!info) - info = xcalloc (1, sizeof (struct ipa_dfs_info)); - info->new = true; + info = XCNEW (struct ipa_dfs_info); + info->new_node = true; info->on_stack = false; info->next_cycle = NULL; node->aux = info; diff --git a/gcc/ipa-utils.h b/gcc/ipa-utils.h index 1bb5e6d..25293f5 100644 --- a/gcc/ipa-utils.h +++ b/gcc/ipa-utils.h @@ -30,7 +30,7 @@ extern tree memory_identifier_string; struct ipa_dfs_info { int dfn_number; int low_link; - bool new; + bool new_node; bool on_stack; struct cgraph_node* next_cycle; PTR aux; diff --git a/gcc/ipa.c b/gcc/ipa.c index 9997f6c..5326af6 100644 --- a/gcc/ipa.c +++ b/gcc/ipa.c @@ -58,7 +58,7 @@ cgraph_postorder (struct cgraph_node **order) { while (node2->aux != &last) { - edge = node2->aux; + edge = (struct cgraph_edge *) node2->aux; if (edge->next_caller) node2->aux = edge->next_caller; else @@ -98,7 +98,7 @@ cgraph_postorder (struct cgraph_node **order) bool cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file) { - struct cgraph_node *first = (void *) 1; + struct cgraph_node *first = (struct cgraph_node *) (void *) 1; struct cgraph_node *node, *next; bool changed = false; int insns = 0; @@ -131,7 +131,7 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file) { struct cgraph_edge *e; node = first; - first = first->aux; + first = (struct cgraph_node *) first->aux; for (e = node->callees; e; e = e->next_callee) if (!e->callee->aux -- 2.7.4