Commit 4cb02ea1 by Mark Mitchell Committed by Mark Mitchell

decl2.c (finish_file): Tweak handling of extern inlines so that they are not unnecessarily put out.

	* decl2.c (finish_file): Tweak handling of extern inlines so that
	they are not unnecessarily put out.

From-SVN: r26606
parent 12571b1f
1999-04-23 Mark Mitchell <mark@codesourcery.com> 1999-04-23 Mark Mitchell <mark@codesourcery.com>
* decl2.c (finish_file): Tweak handling of extern inlines so that
they are not unnecessarily put out.
* search.c (is_subobject_of_p): Handle TEMPLATE_TYPE_PARMs and * search.c (is_subobject_of_p): Handle TEMPLATE_TYPE_PARMs and
such as base classes. such as base classes.
......
...@@ -3628,7 +3628,8 @@ finish_file () ...@@ -3628,7 +3628,8 @@ finish_file ()
{ {
tree decl = VARRAY_TREE (saved_inlines, i); tree decl = VARRAY_TREE (saved_inlines, i);
if (DECL_NOT_REALLY_EXTERN (decl)) if (DECL_NOT_REALLY_EXTERN (decl) && !DECL_COMDAT (decl)
&& DECL_INITIAL (decl))
DECL_EXTERNAL (decl) = 0; DECL_EXTERNAL (decl) = 0;
} }
...@@ -3636,12 +3637,28 @@ finish_file () ...@@ -3636,12 +3637,28 @@ finish_file ()
initialization. Do that now. */ initialization. Do that now. */
do do
{ {
if (saved_inlines) reconsider = 0;
reconsider
|= wrapup_global_declarations (&VARRAY_TREE (saved_inlines, 0), /* Above, we hung back on weak functions; they will be defined
saved_inlines_used); where they are needed. But, here we loop again, so that we
reconsider output the things that *are* needed. */
= walk_namespaces (wrapup_globals_for_namespace, /*data=*/0); for (i = 0; i < saved_inlines_used; ++i)
{
tree decl = VARRAY_TREE (saved_inlines, i);
if (DECL_NOT_REALLY_EXTERN (decl)
&& DECL_INITIAL (decl)
&& TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
DECL_EXTERNAL (decl) = 0;
}
if (saved_inlines_used
&& wrapup_global_declarations (&VARRAY_TREE (saved_inlines, 0),
saved_inlines_used))
reconsider = 1;
if (walk_namespaces (wrapup_globals_for_namespace, /*data=*/0))
reconsider = 1;
/* Static data members are just like namespace-scope globals. */ /* Static data members are just like namespace-scope globals. */
for (i = 0; i < pending_statics_used; ++i) for (i = 0; i < pending_statics_used; ++i)
...@@ -3653,10 +3670,10 @@ finish_file () ...@@ -3653,10 +3670,10 @@ finish_file ()
if (DECL_NOT_REALLY_EXTERN (decl) && ! DECL_IN_AGGR_P (decl)) if (DECL_NOT_REALLY_EXTERN (decl) && ! DECL_IN_AGGR_P (decl))
DECL_EXTERNAL (decl) = 0; DECL_EXTERNAL (decl) = 0;
} }
if (pending_statics) if (pending_statics
reconsider && wrapup_global_declarations (&VARRAY_TREE (pending_statics, 0),
|= wrapup_global_declarations (&VARRAY_TREE (pending_statics, 0), pending_statics_used))
pending_statics_used); reconsider = 1;
} }
while (reconsider); while (reconsider);
......
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