aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-04-23 16:58:01 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1999-04-23 16:58:01 +0000
commit4cb02ea1625e1a5293342c26a904d4bb557dbc48 (patch)
treef634a346d584e871bb168835d8d13f722a45df05
parent12571b1f964b2fcbae5f66b6307c31854ed8c0d5 (diff)
downloadgcc-4cb02ea1625e1a5293342c26a904d4bb557dbc48.zip
gcc-4cb02ea1625e1a5293342c26a904d4bb557dbc48.tar.gz
gcc-4cb02ea1625e1a5293342c26a904d4bb557dbc48.tar.bz2
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
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/decl2.c39
2 files changed, 31 insertions, 11 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 20aeda5..d2f3426 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
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
such as base classes.
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index ea469f3..9d3288f 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -3628,7 +3628,8 @@ finish_file ()
{
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;
}
@@ -3636,12 +3637,28 @@ finish_file ()
initialization. Do that now. */
do
{
- if (saved_inlines)
- reconsider
- |= wrapup_global_declarations (&VARRAY_TREE (saved_inlines, 0),
- saved_inlines_used);
- reconsider
- = walk_namespaces (wrapup_globals_for_namespace, /*data=*/0);
+ reconsider = 0;
+
+ /* Above, we hung back on weak functions; they will be defined
+ where they are needed. But, here we loop again, so that we
+ output the things that *are* needed. */
+ 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. */
for (i = 0; i < pending_statics_used; ++i)
@@ -3653,10 +3670,10 @@ finish_file ()
if (DECL_NOT_REALLY_EXTERN (decl) && ! DECL_IN_AGGR_P (decl))
DECL_EXTERNAL (decl) = 0;
}
- if (pending_statics)
- reconsider
- |= wrapup_global_declarations (&VARRAY_TREE (pending_statics, 0),
- pending_statics_used);
+ if (pending_statics
+ && wrapup_global_declarations (&VARRAY_TREE (pending_statics, 0),
+ pending_statics_used))
+ reconsider = 1;
}
while (reconsider);