summaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-06 18:54:38 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-06 18:54:38 +0000
commit0f4e132dfcfd415772a7a05564148a2ce9b55f1f (patch)
treeda7ceb57fd3446fb3bfc8509e1cdccdfa6ff9e48 /gcc/cgraph.c
parent48f2922b9a4ea86e2b9bbf81ccd474733cf49d29 (diff)
downloadgcc-0f4e132dfcfd415772a7a05564148a2ce9b55f1f.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161877 138bc75d-0d04-0410-961f-82ee72b054a4
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 aaa50b607d2..37367695606 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;