summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-13 15:34:47 +0000
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-13 15:34:47 +0000
commit593ce529b125f562bd1fb0810acd447485ccac7f (patch)
tree6edf9591cd759ae47f7a8a497c6ddf24374e6477 /gcc
parent8a0ffa1de325dbe7a0bb2cb1a8dcf6e4adbc45b2 (diff)
downloadgcc-593ce529b125f562bd1fb0810acd447485ccac7f.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204748 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/cgraph.c74
-rw-r--r--gcc/cgraph.h1
-rw-r--r--gcc/cgraphbuild.c16
-rw-r--r--gcc/gimple-fold.c2
-rw-r--r--gcc/ipa-prop.c2
-rw-r--r--gcc/ipa.c2
-rw-r--r--gcc/lto-streamer-in.c3
8 files changed, 45 insertions, 65 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8f989267084..77f3ea285b0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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>
* config/aarch64/aarch64-simd.md (vec_extract): New.
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 385b11da797..b7ec16655f5 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -540,19 +540,34 @@ cgraph_create_node (tree decl)
return node;
}
-/* Try to find a call graph node for declaration DECL and if it does not exist,
- create it. */
+/* Try to find a call graph node for declaration DECL and if it does not exist
+ or if it corresponds to an inline clone, create a new one. */
struct cgraph_node *
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 (node)
- return node;
+ if (first_clone && !first_clone->global.inlined_to)
+ return first_clone;
- 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
@@ -2890,51 +2905,6 @@ verify_cgraph (void)
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.
Walk through thunk, too.
When AVAILABILITY is non-NULL, get minimal availability in the chain. */
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index dd99dc830b6..1ac6dfb9e0d 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -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_empty_node (void);
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_add_thunk (struct cgraph_node *, tree, tree, bool, HOST_WIDE_INT,
HOST_WIDE_INT, tree, tree);
diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c
index 87e06e37cbe..21ad0ab2ab6 100644
--- a/gcc/cgraphbuild.c
+++ b/gcc/cgraphbuild.c
@@ -71,7 +71,7 @@ record_reference (tree *tp, int *walk_subtrees, void *data)
decl = get_base_var (*tp);
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)
cgraph_mark_address_taken_node (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))
{
- 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);
cgraph_mark_address_taken_node (per_node);
}
@@ -221,7 +221,7 @@ mark_address (gimple stmt, tree addr, void *data)
addr = get_base_address (addr);
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);
ipa_record_reference ((symtab_node *)data,
node,
@@ -250,7 +250,7 @@ mark_load (gimple stmt, tree t, void *data)
{
/* ??? This can happen on platforms with descriptors when these are
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);
ipa_record_reference ((symtab_node *)data,
node,
@@ -338,7 +338,7 @@ build_cgraph_edges (void)
{
tree fn = gimple_omp_parallel_child_fn (stmt);
ipa_record_reference (node,
- cgraph_get_create_real_symbol_node (fn),
+ cgraph_get_create_node (fn),
IPA_REF_ADDR, stmt);
}
if (gimple_code (stmt) == GIMPLE_OMP_TASK)
@@ -346,12 +346,12 @@ build_cgraph_edges (void)
tree fn = gimple_omp_task_child_fn (stmt);
if (fn)
ipa_record_reference (node,
- cgraph_get_create_real_symbol_node (fn),
+ cgraph_get_create_node (fn),
IPA_REF_ADDR, stmt);
fn = gimple_omp_task_copy_fn (stmt);
if (fn)
ipa_record_reference (node,
- cgraph_get_create_real_symbol_node (fn),
+ cgraph_get_create_node (fn),
IPA_REF_ADDR, stmt);
}
}
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index 122d1932b94..1cf8965b7f2 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -196,7 +196,7 @@ canonicalize_constructor_val (tree cval, tree from_decl)
/* Make sure we create a cgraph node for functions we'll reference.
They can be non-existent if the reference comes from an entry
of an external vtable for example. */
- cgraph_get_create_real_symbol_node (base);
+ cgraph_get_create_node (base);
}
/* Fixup types in global initializers. */
if (TREE_TYPE (TREE_TYPE (cval)) != TREE_TYPE (TREE_OPERAND (cval, 0)))
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 9b38e4b3862..d1d3d71c0af 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -2454,7 +2454,7 @@ ipa_make_edge_direct_to_target (struct cgraph_edge *ie, tree target)
ie->callee->order);
return NULL;
}
- callee = cgraph_get_create_real_symbol_node (target);
+ callee = cgraph_get_create_node (target);
}
ipa_check_create_node_params ();
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 5e81fccbe0a..a11b1c75304 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -355,7 +355,7 @@ symtab_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
if (DECL_ABSTRACT_ORIGIN (node->decl))
{
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;
enqueue_node (origin_node, &first, reachable);
}
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index d4a52a76671..ebff04f5cdc 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -915,7 +915,8 @@ input_function (tree fn_decl, struct data_in *data_in,
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_cfg (ib_cfg, fn, node->count_materialization_scale);