[taken from gcc-2.96]

2001-05-07  Jakub Jelinek  <jakub@redhat.com>
	* decl2.c (import_export_decl): Emit referenced inline methods even
	in the unit which just imports the class.
	* g++.old-deja/g++.other/inline21.C: New test.


git-svn-id: file:///srv/svn/repos/haiku/trunk/buildtools@9603 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe 2004-10-28 18:27:10 +00:00
parent 823a7d17d5
commit dc46dacc20

View File

@ -2885,16 +2885,28 @@ import_export_decl (decl)
if (CLASSTYPE_INTERFACE_KNOWN (ctype)
&& (! DECL_ARTIFICIAL (decl) || DECL_VINDEX (decl)))
{
DECL_NOT_REALLY_EXTERN (decl)
= ! (CLASSTYPE_INTERFACE_ONLY (ctype)
|| (DECL_THIS_INLINE (decl) && ! flag_implement_inlines
&& !DECL_VINDEX (decl)));
/* Always make artificials weak. */
if (DECL_ARTIFICIAL (decl) && flag_weak)
if (! flag_new_abi && DECL_THIS_INLINE (decl)
&& ! DECL_ARTIFICIAL (decl)
&& ! DECL_VINDEX (decl) && CLASSTYPE_INTERFACE_ONLY (ctype))
/* The heuristic does not work well, since even if we are
interface only unit of a certain class, some methods can
be declared inline only in this unit (provided they are
used only there). In this case, emit linkonce code of the
inline function as well. */
comdat_linkage (decl);
else
maybe_make_one_only (decl);
{
DECL_NOT_REALLY_EXTERN (decl)
= ! (CLASSTYPE_INTERFACE_ONLY (ctype)
|| (DECL_THIS_INLINE (decl) && ! flag_implement_inlines
&& !DECL_VINDEX (decl)));
/* Always make artificials weak. */
if (DECL_ARTIFICIAL (decl) && flag_weak)
comdat_linkage (decl);
else
maybe_make_one_only (decl);
}
}
else
comdat_linkage (decl);