mirror of git://gcc.gnu.org/git/gcc.git
cgraph.c (cgraph_get_create_node): Do what cgraph_get_create_real_symbol_node used to do.
2013-11-13 Martin Jambor <mjambor@suse.cz> * cgraph.c (cgraph_get_create_node): Do what cgraph_get_create_real_symbol_node used to do. (cgraph_get_create_real_symbol_node): Removed. Changed all users to call cgraph_get_create_node. * cgraph.h (cgraph_get_create_real_symbol_node): Removed. * lto-streamer-in.c (input_function): Call cgraph_get_node instead of cgraph_get_create_node. Assert we get a node. From-SVN: r204748
This commit is contained in:
parent
0f365c102f
commit
6f99e449db
|
|
@ -1,3 +1,13 @@
|
||||||
|
2013-11-13 Martin Jambor <mjambor@suse.cz>
|
||||||
|
|
||||||
|
* cgraph.c (cgraph_get_create_node): Do what
|
||||||
|
cgraph_get_create_real_symbol_node used to do.
|
||||||
|
(cgraph_get_create_real_symbol_node): Removed. Changed all users to
|
||||||
|
call cgraph_get_create_node.
|
||||||
|
* cgraph.h (cgraph_get_create_real_symbol_node): Removed.
|
||||||
|
* lto-streamer-in.c (input_function): Call cgraph_get_node instead of
|
||||||
|
cgraph_get_create_node. Assert we get a node.
|
||||||
|
|
||||||
2013-11-13 Tejas Belagod <tejas.belagod@arm.com>
|
2013-11-13 Tejas Belagod <tejas.belagod@arm.com>
|
||||||
|
|
||||||
* config/aarch64/aarch64-simd.md (vec_extract): New.
|
* config/aarch64/aarch64-simd.md (vec_extract): New.
|
||||||
|
|
|
||||||
74
gcc/cgraph.c
74
gcc/cgraph.c
|
|
@ -540,19 +540,34 @@ cgraph_create_node (tree decl)
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Try to find a call graph node for declaration DECL and if it does not exist,
|
/* Try to find a call graph node for declaration DECL and if it does not exist
|
||||||
create it. */
|
or if it corresponds to an inline clone, create a new one. */
|
||||||
|
|
||||||
struct cgraph_node *
|
struct cgraph_node *
|
||||||
cgraph_get_create_node (tree decl)
|
cgraph_get_create_node (tree decl)
|
||||||
{
|
{
|
||||||
struct cgraph_node *node;
|
struct cgraph_node *first_clone = cgraph_get_node (decl);
|
||||||
|
|
||||||
node = cgraph_get_node (decl);
|
if (first_clone && !first_clone->global.inlined_to)
|
||||||
if (node)
|
return first_clone;
|
||||||
return node;
|
|
||||||
|
|
||||||
return cgraph_create_node (decl);
|
struct cgraph_node *node = cgraph_create_node (decl);
|
||||||
|
if (first_clone)
|
||||||
|
{
|
||||||
|
first_clone->clone_of = node;
|
||||||
|
node->clones = first_clone;
|
||||||
|
symtab_prevail_in_asm_name_hash (node);
|
||||||
|
symtab_insert_node_to_hashtable (node);
|
||||||
|
if (dump_file)
|
||||||
|
fprintf (dump_file, "Introduced new external node "
|
||||||
|
"(%s/%i) and turned into root of the clone tree.\n",
|
||||||
|
xstrdup (cgraph_node_name (node)), node->order);
|
||||||
|
}
|
||||||
|
else if (dump_file)
|
||||||
|
fprintf (dump_file, "Introduced new external node "
|
||||||
|
"(%s/%i).\n", xstrdup (cgraph_node_name (node)),
|
||||||
|
node->order);
|
||||||
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Mark ALIAS as an alias to DECL. DECL_NODE is cgraph node representing
|
/* Mark ALIAS as an alias to DECL. DECL_NODE is cgraph node representing
|
||||||
|
|
@ -2890,51 +2905,6 @@ verify_cgraph (void)
|
||||||
verify_cgraph_node (node);
|
verify_cgraph_node (node);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create external decl node for DECL.
|
|
||||||
The difference i nbetween cgraph_get_create_node and
|
|
||||||
cgraph_get_create_real_symbol_node is that cgraph_get_create_node
|
|
||||||
may return inline clone, while cgraph_get_create_real_symbol_node
|
|
||||||
will create a new node in this case.
|
|
||||||
FIXME: This function should be removed once clones are put out of decl
|
|
||||||
hash. */
|
|
||||||
|
|
||||||
struct cgraph_node *
|
|
||||||
cgraph_get_create_real_symbol_node (tree decl)
|
|
||||||
{
|
|
||||||
struct cgraph_node *first_clone = cgraph_get_node (decl);
|
|
||||||
struct cgraph_node *node;
|
|
||||||
/* create symbol table node. even if inline clone exists, we can not take
|
|
||||||
it as a target of non-inlined call. */
|
|
||||||
node = cgraph_get_node (decl);
|
|
||||||
if (node && !node->global.inlined_to)
|
|
||||||
return node;
|
|
||||||
|
|
||||||
node = cgraph_create_node (decl);
|
|
||||||
|
|
||||||
/* ok, we previously inlined the function, then removed the offline copy and
|
|
||||||
now we want it back for external call. this can happen when devirtualizing
|
|
||||||
while inlining function called once that happens after extern inlined and
|
|
||||||
virtuals are already removed. in this case introduce the external node
|
|
||||||
and make it available for call. */
|
|
||||||
if (first_clone)
|
|
||||||
{
|
|
||||||
first_clone->clone_of = node;
|
|
||||||
node->clones = first_clone;
|
|
||||||
symtab_prevail_in_asm_name_hash (node);
|
|
||||||
symtab_insert_node_to_hashtable (node);
|
|
||||||
if (dump_file)
|
|
||||||
fprintf (dump_file, "Introduced new external node "
|
|
||||||
"(%s/%i) and turned into root of the clone tree.\n",
|
|
||||||
xstrdup (cgraph_node_name (node)), node->order);
|
|
||||||
}
|
|
||||||
else if (dump_file)
|
|
||||||
fprintf (dump_file, "Introduced new external node "
|
|
||||||
"(%s/%i).\n", xstrdup (cgraph_node_name (node)),
|
|
||||||
node->order);
|
|
||||||
return node;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Given NODE, walk the alias chain to return the function NODE is alias of.
|
/* Given NODE, walk the alias chain to return the function NODE is alias of.
|
||||||
Walk through thunk, too.
|
Walk through thunk, too.
|
||||||
When AVAILABILITY is non-NULL, get minimal availability in the chain. */
|
When AVAILABILITY is non-NULL, get minimal availability in the chain. */
|
||||||
|
|
|
||||||
|
|
@ -635,7 +635,6 @@ struct cgraph_indirect_call_info *cgraph_allocate_init_indirect_info (void);
|
||||||
struct cgraph_node * cgraph_create_node (tree);
|
struct cgraph_node * cgraph_create_node (tree);
|
||||||
struct cgraph_node * cgraph_create_empty_node (void);
|
struct cgraph_node * cgraph_create_empty_node (void);
|
||||||
struct cgraph_node * cgraph_get_create_node (tree);
|
struct cgraph_node * cgraph_get_create_node (tree);
|
||||||
struct cgraph_node * cgraph_get_create_real_symbol_node (tree);
|
|
||||||
struct cgraph_node * cgraph_same_body_alias (struct cgraph_node *, tree, tree);
|
struct cgraph_node * cgraph_same_body_alias (struct cgraph_node *, tree, tree);
|
||||||
struct cgraph_node * cgraph_add_thunk (struct cgraph_node *, tree, tree, bool, HOST_WIDE_INT,
|
struct cgraph_node * cgraph_add_thunk (struct cgraph_node *, tree, tree, bool, HOST_WIDE_INT,
|
||||||
HOST_WIDE_INT, tree, tree);
|
HOST_WIDE_INT, tree, tree);
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ record_reference (tree *tp, int *walk_subtrees, void *data)
|
||||||
decl = get_base_var (*tp);
|
decl = get_base_var (*tp);
|
||||||
if (TREE_CODE (decl) == FUNCTION_DECL)
|
if (TREE_CODE (decl) == FUNCTION_DECL)
|
||||||
{
|
{
|
||||||
struct cgraph_node *node = cgraph_get_create_real_symbol_node (decl);
|
struct cgraph_node *node = cgraph_get_create_node (decl);
|
||||||
if (!ctx->only_vars)
|
if (!ctx->only_vars)
|
||||||
cgraph_mark_address_taken_node (node);
|
cgraph_mark_address_taken_node (node);
|
||||||
ipa_record_reference (ctx->varpool_node,
|
ipa_record_reference (ctx->varpool_node,
|
||||||
|
|
@ -139,9 +139,9 @@ record_eh_tables (struct cgraph_node *node, struct function *fun)
|
||||||
|
|
||||||
if (DECL_FUNCTION_PERSONALITY (node->decl))
|
if (DECL_FUNCTION_PERSONALITY (node->decl))
|
||||||
{
|
{
|
||||||
struct cgraph_node *per_node;
|
tree per_decl = DECL_FUNCTION_PERSONALITY (node->decl);
|
||||||
|
struct cgraph_node *per_node = cgraph_get_create_node (per_decl);
|
||||||
|
|
||||||
per_node = cgraph_get_create_real_symbol_node (DECL_FUNCTION_PERSONALITY (node->decl));
|
|
||||||
ipa_record_reference (node, per_node, IPA_REF_ADDR, NULL);
|
ipa_record_reference (node, per_node, IPA_REF_ADDR, NULL);
|
||||||
cgraph_mark_address_taken_node (per_node);
|
cgraph_mark_address_taken_node (per_node);
|
||||||
}
|
}
|
||||||
|
|
@ -221,7 +221,7 @@ mark_address (gimple stmt, tree addr, void *data)
|
||||||
addr = get_base_address (addr);
|
addr = get_base_address (addr);
|
||||||
if (TREE_CODE (addr) == FUNCTION_DECL)
|
if (TREE_CODE (addr) == FUNCTION_DECL)
|
||||||
{
|
{
|
||||||
struct cgraph_node *node = cgraph_get_create_real_symbol_node (addr);
|
struct cgraph_node *node = cgraph_get_create_node (addr);
|
||||||
cgraph_mark_address_taken_node (node);
|
cgraph_mark_address_taken_node (node);
|
||||||
ipa_record_reference ((symtab_node *)data,
|
ipa_record_reference ((symtab_node *)data,
|
||||||
node,
|
node,
|
||||||
|
|
@ -250,7 +250,7 @@ mark_load (gimple stmt, tree t, void *data)
|
||||||
{
|
{
|
||||||
/* ??? This can happen on platforms with descriptors when these are
|
/* ??? This can happen on platforms with descriptors when these are
|
||||||
directly manipulated in the code. Pretend that it's an address. */
|
directly manipulated in the code. Pretend that it's an address. */
|
||||||
struct cgraph_node *node = cgraph_get_create_real_symbol_node (t);
|
struct cgraph_node *node = cgraph_get_create_node (t);
|
||||||
cgraph_mark_address_taken_node (node);
|
cgraph_mark_address_taken_node (node);
|
||||||
ipa_record_reference ((symtab_node *)data,
|
ipa_record_reference ((symtab_node *)data,
|
||||||
node,
|
node,
|
||||||
|
|
@ -338,7 +338,7 @@ build_cgraph_edges (void)
|
||||||
{
|
{
|
||||||
tree fn = gimple_omp_parallel_child_fn (stmt);
|
tree fn = gimple_omp_parallel_child_fn (stmt);
|
||||||
ipa_record_reference (node,
|
ipa_record_reference (node,
|
||||||
cgraph_get_create_real_symbol_node (fn),
|
cgraph_get_create_node (fn),
|
||||||
IPA_REF_ADDR, stmt);
|
IPA_REF_ADDR, stmt);
|
||||||
}
|
}
|
||||||
if (gimple_code (stmt) == GIMPLE_OMP_TASK)
|
if (gimple_code (stmt) == GIMPLE_OMP_TASK)
|
||||||
|
|
@ -346,12 +346,12 @@ build_cgraph_edges (void)
|
||||||
tree fn = gimple_omp_task_child_fn (stmt);
|
tree fn = gimple_omp_task_child_fn (stmt);
|
||||||
if (fn)
|
if (fn)
|
||||||
ipa_record_reference (node,
|
ipa_record_reference (node,
|
||||||
cgraph_get_create_real_symbol_node (fn),
|
cgraph_get_create_node (fn),
|
||||||
IPA_REF_ADDR, stmt);
|
IPA_REF_ADDR, stmt);
|
||||||
fn = gimple_omp_task_copy_fn (stmt);
|
fn = gimple_omp_task_copy_fn (stmt);
|
||||||
if (fn)
|
if (fn)
|
||||||
ipa_record_reference (node,
|
ipa_record_reference (node,
|
||||||
cgraph_get_create_real_symbol_node (fn),
|
cgraph_get_create_node (fn),
|
||||||
IPA_REF_ADDR, stmt);
|
IPA_REF_ADDR, stmt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,7 @@ canonicalize_constructor_val (tree cval, tree from_decl)
|
||||||
/* Make sure we create a cgraph node for functions we'll reference.
|
/* Make sure we create a cgraph node for functions we'll reference.
|
||||||
They can be non-existent if the reference comes from an entry
|
They can be non-existent if the reference comes from an entry
|
||||||
of an external vtable for example. */
|
of an external vtable for example. */
|
||||||
cgraph_get_create_real_symbol_node (base);
|
cgraph_get_create_node (base);
|
||||||
}
|
}
|
||||||
/* Fixup types in global initializers. */
|
/* Fixup types in global initializers. */
|
||||||
if (TREE_TYPE (TREE_TYPE (cval)) != TREE_TYPE (TREE_OPERAND (cval, 0)))
|
if (TREE_TYPE (TREE_TYPE (cval)) != TREE_TYPE (TREE_OPERAND (cval, 0)))
|
||||||
|
|
|
||||||
|
|
@ -2454,7 +2454,7 @@ ipa_make_edge_direct_to_target (struct cgraph_edge *ie, tree target)
|
||||||
ie->callee->order);
|
ie->callee->order);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
callee = cgraph_get_create_real_symbol_node (target);
|
callee = cgraph_get_create_node (target);
|
||||||
}
|
}
|
||||||
ipa_check_create_node_params ();
|
ipa_check_create_node_params ();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -355,7 +355,7 @@ symtab_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
|
||||||
if (DECL_ABSTRACT_ORIGIN (node->decl))
|
if (DECL_ABSTRACT_ORIGIN (node->decl))
|
||||||
{
|
{
|
||||||
struct cgraph_node *origin_node
|
struct cgraph_node *origin_node
|
||||||
= cgraph_get_create_real_symbol_node (DECL_ABSTRACT_ORIGIN (node->decl));
|
= cgraph_get_create_node (DECL_ABSTRACT_ORIGIN (node->decl));
|
||||||
origin_node->used_as_abstract_origin = true;
|
origin_node->used_as_abstract_origin = true;
|
||||||
enqueue_node (origin_node, &first, reachable);
|
enqueue_node (origin_node, &first, reachable);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -915,7 +915,8 @@ input_function (tree fn_decl, struct data_in *data_in,
|
||||||
|
|
||||||
gimple_register_cfg_hooks ();
|
gimple_register_cfg_hooks ();
|
||||||
|
|
||||||
node = cgraph_get_create_node (fn_decl);
|
node = cgraph_get_node (fn_decl);
|
||||||
|
gcc_checking_assert (node);
|
||||||
input_struct_function_base (fn, data_in, ib);
|
input_struct_function_base (fn, data_in, ib);
|
||||||
input_cfg (ib_cfg, fn, node->count_materialization_scale);
|
input_cfg (ib_cfg, fn, node->count_materialization_scale);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue