+2011-04-11 Martin Jambor <mjambor@suse.cz>
+
+ * except.c (set_nothrow_function_flags): Call cgraph_get_node instead
+ of cgraph_node.
+ * final.c (rest_of_clean_state): Likewise.
+ * gimple-iterator.c (update_call_edge_frequencies): Likewise.
+ * passes.c (pass_init_dump_file): Likewise.
+ (execute_all_ipa_transforms): Likewise.
+ (function_called_by_processed_nodes_p): Likewise.
+ * predict.c (maybe_hot_frequency_p): Likewise.
+ (probably_never_executed_bb_p): Likewise.
+ (compute_function_frequency): Likewise.
+ * tree-nested.c (check_for_nested_with_variably_modified): Likewise.
+ (unnest_nesting_tree_1): Likewise.
+ (lower_nested_functions): Likewise.
+ * tree-optimize.c (execute_fixup_cfg): Likewise.
+ (tree_rest_of_compilation): Likewise.
+ * tree-profile.c (gimple_gen_ic_func_profiler): Likewise.
+ * tree-sra.c (ipa_early_sra): Likewise.
+ * tree-ssa-loop-ivopts.c (computation_cost): Likewise.
+ * config/i386/i386.c (ix86_compute_frame_layout): Likewise.
+ * ipa.c (record_cdtor_fn): Likewise.
+ * ipa-inline.c (cgraph_early_inlining): Likewise.
+ (compute_inline_parameters_for_current): Likewise.
+ * ipa-prop.c (ipa_make_edge_direct_to_target): Likewise.
+ * ipa-pure-const.c (local_pure_const): Likewise.
+ * ipa-split.c (split_function): Likewise.
+ (execute_split_functions): Likewise.
+ * cgraphbuild.c (build_cgraph_edges): Likewise.
+ (rebuild_cgraph_edges): Likewise.
+ (cgraph_rebuild_references): Likewise.
+ (remove_cgraph_callee_edges): Likewise.
+ * cgraphunit.c (cgraph_mark_if_needed): Likewise.
+ (verify_cgraph_node): Likewise.
+ (cgraph_analyze_functions): Likewise.
+ (cgraph_preserve_function_body_p): Likewise.
+ (save_inline_function_body): Likewise.
+ (save_inline_function_body): Likewise.
+ * tree-inline.c (copy_bb): Likewise.
+ (optimize_inline_calls): Likewise.
+
2011-04-11 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/48195
build_cgraph_edges (void)
{
basic_block bb;
- struct cgraph_node *node = cgraph_node (current_function_decl);
+ struct cgraph_node *node = cgraph_get_node (current_function_decl);
struct pointer_set_t *visited_nodes = pointer_set_create ();
gimple_stmt_iterator gsi;
tree decl;
rebuild_cgraph_edges (void)
{
basic_block bb;
- struct cgraph_node *node = cgraph_node (current_function_decl);
+ struct cgraph_node *node = cgraph_get_node (current_function_decl);
gimple_stmt_iterator gsi;
cgraph_node_remove_callees (node);
cgraph_rebuild_references (void)
{
basic_block bb;
- struct cgraph_node *node = cgraph_node (current_function_decl);
+ struct cgraph_node *node = cgraph_get_node (current_function_decl);
gimple_stmt_iterator gsi;
ipa_remove_all_references (&node->ref_list);
static unsigned int
remove_cgraph_callee_edges (void)
{
- cgraph_node_remove_callees (cgraph_node (current_function_decl));
+ cgraph_node_remove_callees (cgraph_get_node (current_function_decl));
return 0;
}
void
cgraph_mark_if_needed (tree decl)
{
- struct cgraph_node *node = cgraph_node (decl);
+ struct cgraph_node *node = cgraph_get_node (decl);
if (node->local.finalized && cgraph_decide_is_function_needed (node, decl))
cgraph_mark_needed_node (node);
}
&& cgraph_get_node (decl)
&& (e->callee->former_clone_of
!= cgraph_get_node (decl)->decl)
- && !clone_of_p (cgraph_node (decl),
+ && !clone_of_p (cgraph_get_node (decl),
e->callee))
{
error ("edge points to wrong declaration:");
/* If decl is a clone of an abstract function, mark that abstract
function so that we don't release its body. The DECL_INITIAL() of that
- abstract function declaration will be later needed to output debug info. */
+ abstract function declaration will be later needed to output debug
+ info. */
if (DECL_ABSTRACT_ORIGIN (decl))
{
- struct cgraph_node *origin_node = cgraph_node (DECL_ABSTRACT_ORIGIN (decl));
+ struct cgraph_node *origin_node;
+ origin_node = cgraph_get_node (DECL_ABSTRACT_ORIGIN (decl));
origin_node->abstract_and_needed = true;
}
gcc_assert (cgraph_global_info_ready);
/* Look if there is any clone around. */
- node = cgraph_node (decl);
+ node = cgraph_get_node (decl);
if (node->clones)
return true;
return false;
{
struct cgraph_node *first_clone, *n;
- gcc_assert (node == cgraph_node (node->decl));
+ gcc_assert (node == cgraph_get_node (node->decl));
cgraph_lower_function (node);
first_clone->decl = copy_node (node->decl);
cgraph_insert_node_to_hashtable (first_clone);
- gcc_assert (first_clone == cgraph_node (first_clone->decl));
+ gcc_assert (first_clone == cgraph_get_node (first_clone->decl));
if (first_clone->next_sibling_clone)
{
for (n = first_clone->next_sibling_clone; n->next_sibling_clone; n = n->next_sibling_clone)
&& cfun->machine->use_fast_prologue_epilogue_nregs != frame->nregs)
{
int count = frame->nregs;
- struct cgraph_node *node = cgraph_node (current_function_decl);
+ struct cgraph_node *node = cgraph_get_node (current_function_decl);
cfun->machine->use_fast_prologue_epilogue_nregs = count;
}
}
if (crtl->nothrow
- && (cgraph_function_body_availability (cgraph_node
+ && (cgraph_function_body_availability (cgraph_get_node
(current_function_decl))
>= AVAIL_AVAILABLE))
{
- struct cgraph_node *node = cgraph_node (current_function_decl);
+ struct cgraph_node *node = cgraph_get_node (current_function_decl);
struct cgraph_edge *e;
for (e = node->callers; e; e = e->next_caller)
e->can_throw_external = false;
else
{
const char *aname;
- struct cgraph_node *node = cgraph_node (current_function_decl);
+ struct cgraph_node *node = cgraph_get_node (current_function_decl);
aname = (IDENTIFIER_POINTER
(DECL_ASSEMBLER_NAME (current_function_decl)));
to avoid calling them if we never see any calls. */
if (cfun_node == NULL)
{
- cfun_node = cgraph_node (current_function_decl);
+ cfun_node = cgraph_get_node (current_function_decl);
bb_freq = (compute_call_stmt_bb_frequency
(current_function_decl, bb));
}
static unsigned int
cgraph_early_inlining (void)
{
- struct cgraph_node *node = cgraph_node (current_function_decl);
+ struct cgraph_node *node = cgraph_get_node (current_function_decl);
unsigned int todo = 0;
int iterations = 0;
bool inlined = false;
static unsigned int
compute_inline_parameters_for_current (void)
{
- compute_inline_parameters (cgraph_node (current_function_decl));
+ compute_inline_parameters (cgraph_get_node (current_function_decl));
return 0;
}
target = TREE_OPERAND (target, 0);
if (TREE_CODE (target) != FUNCTION_DECL)
return NULL;
- callee = cgraph_node (target);
+ callee = cgraph_get_node (target);
if (!callee)
return NULL;
ipa_check_create_node_params ();
bool skip;
struct cgraph_node *node;
- node = cgraph_node (current_function_decl);
+ node = cgraph_get_node (current_function_decl);
skip = skip_function_for_local_pure_const (node);
if (!warn_suggest_attribute_const
&& !warn_suggest_attribute_pure
/* Now create the actual clone. */
rebuild_cgraph_edges ();
- node = cgraph_function_versioning (cgraph_node (current_function_decl),
+ node = cgraph_function_versioning (cgraph_get_node (current_function_decl),
NULL, NULL,
args_to_skip,
split_point->split_bbs,
DECL_BUILT_IN_CLASS (node->decl) = NOT_BUILT_IN;
DECL_FUNCTION_CODE (node->decl) = (enum built_in_function) 0;
}
- cgraph_node_remove_callees (cgraph_node (current_function_decl));
+ cgraph_node_remove_callees (cgraph_get_node (current_function_decl));
if (!split_part_return_p)
TREE_THIS_VOLATILE (node->decl) = 1;
if (dump_file)
basic_block bb;
int overall_time = 0, overall_size = 0;
int todo = 0;
- struct cgraph_node *node = cgraph_node (current_function_decl);
+ struct cgraph_node *node = cgraph_get_node (current_function_decl);
if (flags_from_decl_or_type (current_function_decl) & ECF_NORETURN)
{
VEC_safe_push (tree, heap, static_ctors, node->decl);
if (DECL_STATIC_DESTRUCTOR (node->decl))
VEC_safe_push (tree, heap, static_dtors, node->decl);
- node = cgraph_node (node->decl);
+ node = cgraph_get_node (node->decl);
node->local.disregard_inline_limits = 1;
}
if (dump_file && current_function_decl)
{
const char *dname, *aname;
- struct cgraph_node *node = cgraph_node (current_function_decl);
+ struct cgraph_node *node = cgraph_get_node (current_function_decl);
dname = lang_hooks.decl_printable_name (current_function_decl, 2);
aname = (IDENTIFIER_POINTER
(DECL_ASSEMBLER_NAME (current_function_decl)));
struct cgraph_node *node;
if (!cfun)
return;
- node = cgraph_node (current_function_decl);
+ node = cgraph_get_node (current_function_decl);
if (node->ipa_transforms_to_apply)
{
function_called_by_processed_nodes_p (void)
{
struct cgraph_edge *e;
- for (e = cgraph_node (current_function_decl)->callers; e; e = e->next_caller)
+ for (e = cgraph_get_node (current_function_decl)->callers;
+ e;
+ e = e->next_caller)
{
if (e->caller->decl == current_function_decl)
continue;
static inline bool
maybe_hot_frequency_p (int freq)
{
- struct cgraph_node *node = cgraph_node (current_function_decl);
+ struct cgraph_node *node = cgraph_get_node (current_function_decl);
if (!profile_info || !flag_branch_probabilities)
{
if (node->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED)
if (profile_info && flag_branch_probabilities)
return ((bb->count + profile_info->runs / 2) / profile_info->runs) == 0;
if ((!profile_info || !flag_branch_probabilities)
- && cgraph_node (current_function_decl)->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED)
+ && (cgraph_get_node (current_function_decl)->frequency
+ == NODE_FREQUENCY_UNLIKELY_EXECUTED))
return true;
return false;
}
compute_function_frequency (void)
{
basic_block bb;
- struct cgraph_node *node = cgraph_node (current_function_decl);
+ struct cgraph_node *node = cgraph_get_node (current_function_decl);
if (DECL_STATIC_CONSTRUCTOR (current_function_decl)
|| MAIN_NAME_P (DECL_NAME (current_function_decl)))
node->only_called_at_startup = true;
&& id->transform_call_graph_edges == CB_CGE_MOVE_CLONES))
&& (fn = gimple_call_fndecl (stmt)) != NULL)
{
- struct cgraph_node *dest = cgraph_node (fn);
+ struct cgraph_node *dest = cgraph_get_node (fn);
/* We have missing edge in the callgraph. This can happen
when previous inlining turned an indirect call into a
/* Clear out ID. */
memset (&id, 0, sizeof (id));
- id.src_node = id.dst_node = cgraph_node (fn);
+ id.src_node = id.dst_node = cgraph_get_node (fn);
gcc_assert (id.dst_node->analyzed);
id.dst_fn = fn;
/* Or any functions that aren't finished yet. */
static bool
check_for_nested_with_variably_modified (tree fndecl, tree orig_fndecl)
{
- struct cgraph_node *cgn = cgraph_node (fndecl);
+ struct cgraph_node *cgn = cgraph_get_node (fndecl);
tree arg;
for (cgn = cgn->nested; cgn ; cgn = cgn->next_nested)
static void
unnest_nesting_tree_1 (struct nesting_info *root)
{
- struct cgraph_node *node = cgraph_node (root->context);
+ struct cgraph_node *node = cgraph_get_node (root->context);
/* For nested functions update the cgraph to reflect unnesting.
We also delay finalizing of these functions up to this point. */
if (node->origin)
{
- cgraph_unnest_node (cgraph_node (root->context));
+ cgraph_unnest_node (node);
cgraph_finalize_function (root->context, true);
}
}
struct nesting_info *root;
/* If there are no nested functions, there's nothing to do. */
- cgn = cgraph_node (fndecl);
+ cgn = cgraph_get_node (fndecl);
if (!cgn->nested)
return;
edge_iterator ei;
if (ENTRY_BLOCK_PTR->count)
- count_scale = (cgraph_node (current_function_decl)->count * REG_BR_PROB_BASE
- + ENTRY_BLOCK_PTR->count / 2) / ENTRY_BLOCK_PTR->count;
+ count_scale = ((cgraph_get_node (current_function_decl)->count
+ * REG_BR_PROB_BASE + ENTRY_BLOCK_PTR->count / 2)
+ / ENTRY_BLOCK_PTR->count);
else
count_scale = REG_BR_PROB_BASE;
- ENTRY_BLOCK_PTR->count = cgraph_node (current_function_decl)->count;
+ ENTRY_BLOCK_PTR->count = cgraph_get_node (current_function_decl)->count;
EXIT_BLOCK_PTR->count = (EXIT_BLOCK_PTR->count * count_scale
+ REG_BR_PROB_BASE / 2) / REG_BR_PROB_BASE;
gimple_set_body (fndecl, NULL);
if (DECL_STRUCT_FUNCTION (fndecl) == 0
- && !cgraph_node (fndecl)->origin)
+ && !cgraph_get_node (fndecl)->origin)
{
/* Stop pointing to the local nodes about to be freed.
But DECL_INITIAL must remain nonzero so we know this
void
gimple_gen_ic_func_profiler (void)
{
- struct cgraph_node * c_node = cgraph_node (current_function_decl);
+ struct cgraph_node * c_node = cgraph_get_node (current_function_decl);
gimple_stmt_iterator gsi;
gimple stmt1, stmt2;
tree tree_uid, cur_func, counter_ptr, ptr_var, void0;
static unsigned int
ipa_early_sra (void)
{
- struct cgraph_node *node = cgraph_node (current_function_decl);
+ struct cgraph_node *node = cgraph_get_node (current_function_decl);
ipa_parm_adjustment_vec adjustments;
int ret = 0;
unsigned cost;
/* Avoid using hard regs in ways which may be unsupported. */
int regno = LAST_VIRTUAL_REGISTER + 1;
- struct cgraph_node *node = cgraph_node (current_function_decl);
+ struct cgraph_node *node = cgraph_get_node (current_function_decl);
enum node_frequency real_frequency = node->frequency;
node->frequency = NODE_FREQUENCY_NORMAL;