aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-07-06 20:54:38 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2010-07-06 18:54:38 +0000
commite10aaec029cf3918f75755a6365c1976be8ad6eb (patch)
treeda7ceb57fd3446fb3bfc8509e1cdccdfa6ff9e48 /gcc/cgraph.c
parent4bbf141cf116e3c59cba66e9c51fb33bc90793f1 (diff)
downloadgcc-e10aaec029cf3918f75755a6365c1976be8ad6eb.zip
gcc-e10aaec029cf3918f75755a6365c1976be8ad6eb.tar.gz
gcc-e10aaec029cf3918f75755a6365c1976be8ad6eb.tar.bz2
lto-symtab.c (lto_cgraph_replace_node): Handle aliases.
* lto-symtab.c (lto_cgraph_replace_node): Handle aliases. (lto_symtab_resolve_can_prevail_p): Also alias of cgraph node with body can prevail. (lto_symtab_resolve_symbols): Use cgraph_get_node_or_alias. (lto_symtab_merge_cgraph_nodes_1): Do not remove nodes from aliases. * cgraph.c (cgraph_get_node_or_alias): New function. * cgraph.h (cgraph_get_node_or_alias): Declare. From-SVN: r161877
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index aaa50b6..3736769 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -604,6 +604,29 @@ cgraph_add_thunk (tree alias, tree decl, bool this_adjusting,
is assigned. */
struct cgraph_node *
+cgraph_get_node_or_alias (tree decl)
+{
+ struct cgraph_node key, *node = NULL, **slot;
+
+ gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
+
+ if (!cgraph_hash)
+ return NULL;
+
+ key.decl = decl;
+
+ slot = (struct cgraph_node **) htab_find_slot (cgraph_hash, &key,
+ NO_INSERT);
+
+ if (slot && *slot)
+ node = *slot;
+ return node;
+}
+
+/* Returns the cgraph node assigned to DECL or NULL if no cgraph node
+ is assigned. */
+
+struct cgraph_node *
cgraph_get_node (tree decl)
{
struct cgraph_node key, *node = NULL, **slot;