decl2.c (import_export_vtable): If we support one_only but not weak symbols...

* decl2.c (import_export_vtable): If we support one_only but not
	weak symbols, mark instantiated template vtables one_only.
	(import_export_decl): Likewise for tinfo functions.
	(finish_vtable_vardecl): Also write out vtables from explicitly
	instantiated template classes.
	* pt.c (mark_class_instantiated): Revert last change.

From-SVN: r16779
This commit is contained in:
Jason Merrill 1997-11-27 07:31:02 +00:00 committed by Jason Merrill
parent e872bb7a78
commit eb773359de
3 changed files with 23 additions and 10 deletions

View File

@ -1,5 +1,12 @@
Wed Nov 26 20:28:49 1997 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (import_export_vtable): If we support one_only but not
weak symbols, mark instantiated template vtables one_only.
(import_export_decl): Likewise for tinfo functions.
(finish_vtable_vardecl): Also write out vtables from explicitly
instantiated template classes.
* pt.c (mark_class_instantiated): Revert last change.
* except.c (expand_throw): Call mark_used on the destructor.
1997-11-26 Mark Mitchell <mmitchell@usa.net>

View File

@ -38,6 +38,7 @@ Boston, MA 02111-1307, USA. */
#include "output.h"
#include "except.h"
#include "expr.h"
#include "defaults.h"
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@ -2527,6 +2528,12 @@ import_export_vtable (decl, type, final)
TREE_PUBLIC (decl) = 1;
DECL_EXTERNAL (decl) = ! CLASSTYPE_VTABLE_NEEDS_WRITING (type);
DECL_INTERFACE_KNOWN (decl) = 1;
/* For WIN32 we also want to put explicit instantiations in
linkonce sections. */
if (CLASSTYPE_EXPLICIT_INSTANTIATION (type)
&& supports_one_only () && ! SUPPORTS_WEAK)
comdat_linkage (decl);
}
else
{
@ -2618,6 +2625,7 @@ finish_vtable_vardecl (prev, vars)
if (write_virtuals >= 0
&& ! DECL_EXTERNAL (vars)
&& ((TREE_PUBLIC (vars) && ! DECL_WEAK (vars) && ! DECL_ONE_ONLY (vars))
|| CLASSTYPE_EXPLICIT_INSTANTIATION (DECL_CONTEXT (vars))
|| TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (vars))
|| (hack_decl_function_context (vars) && TREE_USED (vars)))
&& ! TREE_ASM_WRITTEN (vars))
@ -2815,6 +2823,12 @@ import_export_decl (decl)
DECL_NOT_REALLY_EXTERN (decl)
= ! (CLASSTYPE_INTERFACE_ONLY (ctype)
|| (DECL_THIS_INLINE (decl) && ! flag_implement_inlines));
/* For WIN32 we also want to put explicit instantiations in
linkonce sections. */
if (CLASSTYPE_EXPLICIT_INSTANTIATION (ctype)
&& supports_one_only () && ! SUPPORTS_WEAK)
comdat_linkage (decl);
}
else if (TYPE_BUILT_IN (ctype) && ctype == TYPE_MAIN_VARIANT (ctype))
DECL_NOT_REALLY_EXTERN (decl) = 0;

View File

@ -4327,16 +4327,8 @@ mark_class_instantiated (t, extern_p)
int extern_p;
{
SET_CLASSTYPE_EXPLICIT_INSTANTIATION (t);
if (supports_one_only () && ! SUPPORTS_WEAK)
/* For WIN32 we also want to put explicit instantiations in
linkonce sections. */;
else
{
SET_CLASSTYPE_INTERFACE_KNOWN (t);
CLASSTYPE_INTERFACE_ONLY (t) = extern_p;
}
SET_CLASSTYPE_INTERFACE_KNOWN (t);
CLASSTYPE_INTERFACE_ONLY (t) = extern_p;
CLASSTYPE_VTABLE_NEEDS_WRITING (t) = ! extern_p;
TYPE_DECL_SUPPRESS_DEBUG (TYPE_NAME (t)) = extern_p;
if (! extern_p)