diff options
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r-- | gcc/cgraph.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h index dbfc89f..1ccae09 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -856,19 +856,28 @@ varpool_node_set_nonempty_p (varpool_node_set set) static inline bool cgraph_only_called_directly_p (struct cgraph_node *node) { - return !node->needed && !node->local.externally_visible; + return !node->needed && !node->address_taken && !node->local.externally_visible; } /* Return true when function NODE can be removed from callgraph if all direct calls are eliminated. */ static inline bool -cgraph_can_remove_if_no_direct_calls_p (struct cgraph_node *node) +cgraph_can_remove_if_no_direct_calls_and_refs_p (struct cgraph_node *node) { return (!node->needed && !node->reachable_from_other_partition && (DECL_COMDAT (node->decl) || !node->local.externally_visible)); } +/* Return true when function NODE can be removed from callgraph + if all direct calls are eliminated. */ + +static inline bool +cgraph_can_remove_if_no_direct_calls_p (struct cgraph_node *node) +{ + return !node->address_taken && cgraph_can_remove_if_no_direct_calls_and_refs_p (node); +} + /* Constant pool accessor function. */ htab_t constant_pool_htab (void); |