From 986ad1338d0634b347cf39619964ceb4d4850713 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 19 Nov 2009 14:23:23 +0100 Subject: [PATCH] tree.c (need_assembler_name_p): Use cgraph_get_node instead of cgraph_node_for_decl. * tree.c (need_assembler_name_p): Use cgraph_get_node instead of cgraph_node_for_decl. * cgraph.h (cgraph_node_for_decl): Remove prototype. * cgraph.c (cgraph_node_for_decl): Remove. (cgraph_get_node): Just return NULL if !cgraph_hash. From-SVN: r154329 --- gcc/ChangeLog | 8 ++++++++ gcc/cgraph.c | 32 +------------------------------- gcc/cgraph.h | 1 - gcc/tree.c | 2 +- 4 files changed, 10 insertions(+), 33 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0521114236f2..dec2c346e236 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2009-11-19 Jakub Jelinek + + * tree.c (need_assembler_name_p): Use cgraph_get_node instead + of cgraph_node_for_decl. + * cgraph.h (cgraph_node_for_decl): Remove prototype. + * cgraph.c (cgraph_node_for_decl): Remove. + (cgraph_get_node): Just return NULL if !cgraph_hash. + 2009-11-19 Paul Brook * config.gcc: Add new ARM --with-fpu options. diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 02beae92469b..3e5b8466d8c1 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -406,36 +406,6 @@ hash_node (const void *p) } -/* Return the cgraph node associated with function DECL. If none - exists, return NULL. */ - -struct cgraph_node * -cgraph_node_for_decl (tree decl) -{ - struct cgraph_node *node; - void **slot; - - gcc_assert (TREE_CODE (decl) == FUNCTION_DECL); - - node = NULL; - if (cgraph_hash) - { - struct cgraph_node key; - - key.decl = decl; - slot = htab_find_slot (cgraph_hash, &key, NO_INSERT); - if (slot && *slot) - { - node = (struct cgraph_node *) *slot; - if (node->same_body_alias) - node = node->same_body; - } - } - - return node; -} - - /* Returns nonzero if P1 and P2 are equal. */ static int @@ -594,7 +564,7 @@ cgraph_get_node (tree decl) gcc_assert (TREE_CODE (decl) == FUNCTION_DECL); if (!cgraph_hash) - cgraph_hash = htab_create_ggc (10, hash_node, eq_node, NULL); + return NULL; key.decl = decl; diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 02c087d772e6..e09a858bdac3 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -425,7 +425,6 @@ struct cgraph_node *cgraph_node (tree); bool cgraph_same_body_alias (tree, tree); void cgraph_remove_same_body_alias (struct cgraph_node *); struct cgraph_node *cgraph_node_for_asm (tree); -struct cgraph_node *cgraph_node_for_decl (tree); struct cgraph_edge *cgraph_edge (struct cgraph_node *, gimple); void cgraph_set_call_stmt (struct cgraph_edge *, gimple); void cgraph_set_call_stmt_including_clones (struct cgraph_node *, gimple, gimple); diff --git a/gcc/tree.c b/gcc/tree.c index 3bfb527590e4..df24eb4ad593 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -4289,7 +4289,7 @@ need_assembler_name_p (tree decl) return false; /* Functions represented in the callgraph need an assembler name. */ - if (cgraph_node_for_decl (decl) != NULL) + if (cgraph_get_node (decl) != NULL) return true; /* Unused and not public functions don't need an assembler name. */