Commit 24d3f325 by Nathan Sidwell Committed by Nathan Sidwell

ipa-visibility.c (function_and_variable_visibility): Reformat comments and long lines.

	gcc/
	* ipa-visibility.c (function_and_variable_visibility): Reformat
	comments and long lines.  Remove extrneous if.
	* symtab.c (symtab_node::make_decl_local): Fix code format.
	(symtab_node::set_section_for_node): Fix comment typo.

	gcc/lto/
	* lto-partition.c (lto_balanced_map): Reformat/respell comment.
	(may_need_named_section_p): Likewise.
	(rename_statics): Likewise.
	(lto_promote_cross_file_statics): Likewise.

From-SVN: r244156
parent eb0f8780
2017-01-06 Nathan Sidwell <nathan@acm.org>
* ipa-visibility.c (function_and_variable_visibility): Reformat
comments and long lines. Remove extrneous if.
* symtab.c (symtab_node::make_decl_local): Fix code format.
(symtab_node::set_section_for_node): Fix comment typo.
2017-01-06 Martin Liska <mliska@suse.cz> 2017-01-06 Martin Liska <mliska@suse.cz>
PR bootstrap/79003 PR bootstrap/79003
......
...@@ -553,9 +553,9 @@ function_and_variable_visibility (bool whole_program) ...@@ -553,9 +553,9 @@ function_and_variable_visibility (bool whole_program)
DECL_STATIC_DESTRUCTOR (node->decl) = 0; DECL_STATIC_DESTRUCTOR (node->decl) = 0;
} }
/* Frontends and alias code marks nodes as needed before parsing is finished. /* Frontends and alias code marks nodes as needed before parsing
We may end up marking as node external nodes where this flag is meaningless is finished. We may end up marking as node external nodes
strip it. */ where this flag is meaningless strip it. */
if (DECL_EXTERNAL (node->decl) || !node->definition) if (DECL_EXTERNAL (node->decl) || !node->definition)
{ {
node->force_output = 0; node->force_output = 0;
...@@ -609,35 +609,36 @@ function_and_variable_visibility (bool whole_program) ...@@ -609,35 +609,36 @@ function_and_variable_visibility (bool whole_program)
{ {
gcc_assert (whole_program || in_lto_p gcc_assert (whole_program || in_lto_p
|| !TREE_PUBLIC (node->decl)); || !TREE_PUBLIC (node->decl));
node->unique_name |= ((node->resolution == LDPR_PREVAILING_DEF_IRONLY node->unique_name
|| node->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP) |= ((node->resolution == LDPR_PREVAILING_DEF_IRONLY
&& TREE_PUBLIC (node->decl) || node->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP)
&& !flag_incremental_link); && TREE_PUBLIC (node->decl)
&& !flag_incremental_link);
node->resolution = LDPR_PREVAILING_DEF_IRONLY; node->resolution = LDPR_PREVAILING_DEF_IRONLY;
if (node->same_comdat_group && TREE_PUBLIC (node->decl)) if (node->same_comdat_group && TREE_PUBLIC (node->decl))
{ {
symtab_node *next = node; symtab_node *next = node;
/* Set all members of comdat group local. */ /* Set all members of comdat group local. */
if (node->same_comdat_group) for (next = node->same_comdat_group;
for (next = node->same_comdat_group; next != node;
next != node; next = next->same_comdat_group)
next = next->same_comdat_group)
{ {
next->set_comdat_group (NULL); next->set_comdat_group (NULL);
if (!next->alias) if (!next->alias)
next->set_section (NULL); next->set_section (NULL);
if (!next->transparent_alias) if (!next->transparent_alias)
next->make_decl_local (); next->make_decl_local ();
next->unique_name |= ((next->resolution == LDPR_PREVAILING_DEF_IRONLY next->unique_name
|| next->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP) |= ((next->resolution == LDPR_PREVAILING_DEF_IRONLY
&& TREE_PUBLIC (next->decl) || next->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP)
&& !flag_incremental_link); && TREE_PUBLIC (next->decl)
&& !flag_incremental_link);
} }
/* cgraph_externally_visible_p has already checked all other nodes /* cgraph_externally_visible_p has already checked all
in the group and they will all be made local. We need to other nodes in the group and they will all be made
dissolve the group at once so that the predicate does not local. We need to dissolve the group at once so that
segfault though. */ the predicate does not segfault though. */
node->dissolve_same_comdat_group_list (); node->dissolve_same_comdat_group_list ();
} }
if (TREE_PUBLIC (node->decl)) if (TREE_PUBLIC (node->decl))
......
2017-01-06 Nathan Sidwell <nathan@acm.org>
* lto-partition.c (lto_balanced_map): Reformat/respell comment.
(may_need_named_section_p): Likewise.
(rename_statics): Likewise.
(lto_promote_cross_file_statics): Likewise.
2017-01-01 Jakub Jelinek <jakub@redhat.com> 2017-01-01 Jakub Jelinek <jakub@redhat.com>
Update copyright years. Update copyright years.
......
...@@ -668,8 +668,9 @@ lto_balanced_map (int n_lto_partitions, int max_partition_size) ...@@ -668,8 +668,9 @@ lto_balanced_map (int n_lto_partitions, int max_partition_size)
vnode = dyn_cast <varpool_node *> (ref->referring); vnode = dyn_cast <varpool_node *> (ref->referring);
gcc_assert (vnode->definition); gcc_assert (vnode->definition);
/* It is better to couple variables with their users, because it allows them /* It is better to couple variables with their users,
to be removed. Coupling with objects they refer to only helps to reduce because it allows them to be removed. Coupling
with objects they refer to only helps to reduce
number of symbols promoted to hidden. */ number of symbols promoted to hidden. */
if (!symbol_partitioned_p (vnode) && flag_toplevel_reorder if (!symbol_partitioned_p (vnode) && flag_toplevel_reorder
&& !vnode->no_reorder && !vnode->no_reorder
...@@ -1008,10 +1009,11 @@ promote_symbol (symtab_node *node) ...@@ -1008,10 +1009,11 @@ promote_symbol (symtab_node *node)
"Promoting as hidden: %s\n", node->name ()); "Promoting as hidden: %s\n", node->name ());
} }
/* Return true if NODE needs named section even if it won't land in the partition /* Return true if NODE needs named section even if it won't land in
symbol table. the partition symbol table.
FIXME: we should really not use named sections for inline clones and master
clones. */ FIXME: we should really not use named sections for inline clones
and master clones. */
static bool static bool
may_need_named_section_p (lto_symtab_encoder_t encoder, symtab_node *node) may_need_named_section_p (lto_symtab_encoder_t encoder, symtab_node *node)
...@@ -1089,7 +1091,8 @@ rename_statics (lto_symtab_encoder_t encoder, symtab_node *node) ...@@ -1089,7 +1091,8 @@ rename_statics (lto_symtab_encoder_t encoder, symtab_node *node)
|| lto_symtab_encoder_lookup (encoder, s) != LCC_NOT_FOUND)) || lto_symtab_encoder_lookup (encoder, s) != LCC_NOT_FOUND))
{ {
if (privatize_symbol_name (s)) if (privatize_symbol_name (s))
/* Re-start from beginning since we do not know how many symbols changed a name. */ /* Re-start from beginning since we do not know how many
symbols changed a name. */
s = symtab_node::get_for_asmname (name); s = symtab_node::get_for_asmname (name);
else s = s->next_sharing_asm_name; else s = s->next_sharing_asm_name;
} }
...@@ -1130,8 +1133,8 @@ lto_promote_cross_file_statics (void) ...@@ -1130,8 +1133,8 @@ lto_promote_cross_file_statics (void)
{ {
symtab_node *node = lsei_node (lsei); symtab_node *node = lsei_node (lsei);
/* If symbol is static, rename it if its assembler name clash with /* If symbol is static, rename it if its assembler name
anything else in this unit. */ clashes with anything else in this unit. */
rename_statics (encoder, node); rename_statics (encoder, node);
/* No need to promote if symbol already is externally visible ... */ /* No need to promote if symbol already is externally visible ... */
...@@ -1139,7 +1142,7 @@ lto_promote_cross_file_statics (void) ...@@ -1139,7 +1142,7 @@ lto_promote_cross_file_statics (void)
/* ... or if it is part of current partition ... */ /* ... or if it is part of current partition ... */
|| lto_symtab_encoder_in_partition_p (encoder, node) || lto_symtab_encoder_in_partition_p (encoder, node)
/* ... or if we do not partition it. This mean that it will /* ... or if we do not partition it. This mean that it will
appear in every partition refernecing it. */ appear in every partition referencing it. */
|| node->get_partitioning_class () != SYMBOL_PARTITION) || node->get_partitioning_class () != SYMBOL_PARTITION)
{ {
validize_symbol_for_target (node); validize_symbol_for_target (node);
......
...@@ -1259,7 +1259,8 @@ symtab_node::make_decl_local (void) ...@@ -1259,7 +1259,8 @@ symtab_node::make_decl_local (void)
TREE_ADDRESSABLE (decl) = 1; TREE_ADDRESSABLE (decl) = 1;
TREE_STATIC (decl) = 1; TREE_STATIC (decl) = 1;
} }
else gcc_assert (TREE_CODE (decl) == FUNCTION_DECL); else
gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
DECL_COMDAT (decl) = 0; DECL_COMDAT (decl) = 0;
DECL_WEAK (decl) = 0; DECL_WEAK (decl) = 0;
...@@ -1439,7 +1440,7 @@ symtab_node::fixup_same_cpp_alias_visibility (symtab_node *target) ...@@ -1439,7 +1440,7 @@ symtab_node::fixup_same_cpp_alias_visibility (symtab_node *target)
} }
/* Set section, do not recurse into aliases. /* Set section, do not recurse into aliases.
When one wants to change section of symbol and its aliases, When one wants to change section of a symbol and its aliases,
use set_section. */ use set_section. */
void void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment