summaryrefslogtreecommitdiff
path: root/gcc/cgraphbuild.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cgraphbuild.c')
-rw-r--r--gcc/cgraphbuild.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c
index b6cafffac8d..19961e27df3 100644
--- a/gcc/cgraphbuild.c
+++ b/gcc/cgraphbuild.c
@@ -1,5 +1,5 @@
/* Callgraph construction.
- Copyright (C) 2003-2013 Free Software Foundation, Inc.
+ Copyright (C) 2003-2014 Free Software Foundation, Inc.
Contributed by Jan Hubicka
This file is part of GCC.
@@ -44,7 +44,7 @@ along with GCC; see the file COPYING3. If not see
struct record_reference_ctx
{
bool only_vars;
- struct varpool_node *varpool_node;
+ class varpool_node *varpool_node;
};
/* Walk tree and record all calls and references to functions/variables.
@@ -89,7 +89,7 @@ record_reference (tree *tp, int *walk_subtrees, void *data)
if (TREE_CODE (decl) == VAR_DECL)
{
- struct varpool_node *vnode = varpool_node_for_decl (decl);
+ varpool_node *vnode = varpool_node_for_decl (decl);
ipa_record_reference (ctx->varpool_node,
vnode,
IPA_REF_ADDR, NULL);
@@ -128,7 +128,7 @@ record_type_list (struct cgraph_node *node, tree list)
type = TREE_OPERAND (type, 0);
if (TREE_CODE (type) == VAR_DECL)
{
- struct varpool_node *vnode = varpool_node_for_decl (type);
+ varpool_node *vnode = varpool_node_for_decl (type);
ipa_record_reference (node,
vnode,
IPA_REF_ADDR, NULL);
@@ -208,7 +208,7 @@ compute_call_stmt_bb_frequency (tree decl, basic_block bb)
(DECL_STRUCT_FUNCTION (decl))->frequency;
int freq = bb->frequency;
- if (profile_status_for_function (DECL_STRUCT_FUNCTION (decl)) == PROFILE_ABSENT)
+ if (profile_status_for_fn (DECL_STRUCT_FUNCTION (decl)) == PROFILE_ABSENT)
return CGRAPH_FREQ_BASE;
if (!entry_freq)
@@ -224,7 +224,7 @@ compute_call_stmt_bb_frequency (tree decl, basic_block bb)
/* Mark address taken in STMT. */
static bool
-mark_address (gimple stmt, tree addr, void *data)
+mark_address (gimple stmt, tree addr, tree, void *data)
{
addr = get_base_address (addr);
if (TREE_CODE (addr) == FUNCTION_DECL)
@@ -238,7 +238,7 @@ mark_address (gimple stmt, tree addr, void *data)
else if (addr && TREE_CODE (addr) == VAR_DECL
&& (TREE_STATIC (addr) || DECL_EXTERNAL (addr)))
{
- struct varpool_node *vnode = varpool_node_for_decl (addr);
+ varpool_node *vnode = varpool_node_for_decl (addr);
ipa_record_reference ((symtab_node *)data,
vnode,
@@ -251,7 +251,7 @@ mark_address (gimple stmt, tree addr, void *data)
/* Mark load of T. */
static bool
-mark_load (gimple stmt, tree t, void *data)
+mark_load (gimple stmt, tree t, tree, void *data)
{
t = get_base_address (t);
if (t && TREE_CODE (t) == FUNCTION_DECL)
@@ -267,7 +267,7 @@ mark_load (gimple stmt, tree t, void *data)
else if (t && TREE_CODE (t) == VAR_DECL
&& (TREE_STATIC (t) || DECL_EXTERNAL (t)))
{
- struct varpool_node *vnode = varpool_node_for_decl (t);
+ varpool_node *vnode = varpool_node_for_decl (t);
ipa_record_reference ((symtab_node *)data,
vnode,
@@ -279,13 +279,13 @@ mark_load (gimple stmt, tree t, void *data)
/* Mark store of T. */
static bool
-mark_store (gimple stmt, tree t, void *data)
+mark_store (gimple stmt, tree t, tree, void *data)
{
t = get_base_address (t);
if (t && TREE_CODE (t) == VAR_DECL
&& (TREE_STATIC (t) || DECL_EXTERNAL (t)))
{
- struct varpool_node *vnode = varpool_node_for_decl (t);
+ varpool_node *vnode = varpool_node_for_decl (t);
ipa_record_reference ((symtab_node *)data,
vnode,
@@ -317,7 +317,7 @@ build_cgraph_edges (void)
/* Create the callgraph edges and record the nodes referenced by the function.
body. */
- FOR_EACH_BB (bb)
+ FOR_EACH_BB_FN (bb, cfun)
{
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
@@ -335,6 +335,8 @@ build_cgraph_edges (void)
if (decl)
cgraph_create_edge (node, cgraph_get_create_node (decl),
stmt, bb->count, freq);
+ else if (gimple_call_internal_p (stmt))
+ ;
else
cgraph_create_indirect_edge (node, stmt,
gimple_call_flags (stmt),
@@ -424,7 +426,7 @@ void
record_references_in_initializer (tree decl, bool only_vars)
{
struct pointer_set_t *visited_nodes = pointer_set_create ();
- struct varpool_node *node = varpool_node_for_decl (decl);
+ varpool_node *node = varpool_node_for_decl (decl);
struct record_reference_ctx ctx = {false, NULL};
ctx.varpool_node = node;
@@ -449,7 +451,7 @@ rebuild_cgraph_edges (void)
node->count = ENTRY_BLOCK_PTR_FOR_FN (cfun)->count;
- FOR_EACH_BB (bb)
+ FOR_EACH_BB_FN (bb, cfun)
{
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
@@ -464,6 +466,8 @@ rebuild_cgraph_edges (void)
if (decl)
cgraph_create_edge (node, cgraph_get_create_node (decl), stmt,
bb->count, freq);
+ else if (gimple_call_internal_p (stmt))
+ ;
else
cgraph_create_indirect_edge (node, stmt,
gimple_call_flags (stmt),
@@ -501,7 +505,7 @@ cgraph_rebuild_references (void)
node->count = ENTRY_BLOCK_PTR_FOR_FN (cfun)->count;
- FOR_EACH_BB (bb)
+ FOR_EACH_BB_FN (bb, cfun)
{
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
ipa_record_stmt_references (node, gsi_stmt (gsi));