diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-12-16 21:05:39 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-12-16 21:05:39 +0000 |
commit | a865a0f2e01e631512e9954313d24b164c006073 (patch) | |
tree | 6295e912a24f2f4ac3f5d8cee014b550e096a38d /gcc/ipa-visibility.c | |
parent | d6bb0b93d134428cb54b09440aac2f21441a1e99 (diff) | |
download | gcc-a865a0f2e01e631512e9954313d24b164c006073.tar.gz |
* ipa-visibility.c (can_replace_by_local_alias): Make static,
check ASM_OUTPUT_DEF.
(can_replace_by_local_alias_in_vtable): Make static.
(function_and_variable_visibility): Reformat overlong comment.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231721 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-visibility.c')
-rw-r--r-- | gcc/ipa-visibility.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/gcc/ipa-visibility.c b/gcc/ipa-visibility.c index 7ce8266c466..4b48d6e5b8b 100644 --- a/gcc/ipa-visibility.c +++ b/gcc/ipa-visibility.c @@ -329,9 +329,13 @@ varpool_node::externally_visible_p (void) Local aliases save dynamic linking overhead and enable more optimizations. */ -bool +static bool can_replace_by_local_alias (symtab_node *node) { +#ifndef ASM_OUTPUT_DEF + /* If aliases aren't supported, we can't do replacement. */ + return false; +#endif /* Weakrefs have a reason to be non-local. Be sure we do not replace them. */ while (node->transparent_alias && node->definition && !node->weakref) @@ -344,11 +348,11 @@ can_replace_by_local_alias (symtab_node *node) && !node->can_be_discarded_p ()); } -/* Return true if we can replace refernece to NODE by local alias +/* Return true if we can replace reference to NODE by local alias within a virtual table. Generally we can replace function pointers and virtual table pointers. */ -bool +static bool can_replace_by_local_alias_in_vtable (symtab_node *node) { if (is_a <varpool_node *> (node) @@ -592,10 +596,11 @@ function_and_variable_visibility (bool whole_program) if (!node->local.local) node->local.local |= node->local_p (); - /* If we know that function can not be overwritten by a different semantics - and moreover its section can not be discarded, replace all direct calls - by calls to an noninterposable alias. This make dynamic linking - cheaper and enable more optimization. + /* If we know that function can not be overwritten by a + different semantics and moreover its section can not be + discarded, replace all direct calls by calls to an + noninterposable alias. This make dynamic linking cheaper and + enable more optimization. TODO: We can also update virtual tables. */ if (node->callers |