Commit eb773359 by Jason Merrill Committed by Jason Merrill

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
parent e872bb7a
Wed Nov 26 20:28:49 1997 Jason Merrill <jason@yorick.cygnus.com> 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. * except.c (expand_throw): Call mark_used on the destructor.
1997-11-26 Mark Mitchell <mmitchell@usa.net> 1997-11-26 Mark Mitchell <mmitchell@usa.net>
......
...@@ -38,6 +38,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -38,6 +38,7 @@ Boston, MA 02111-1307, USA. */
#include "output.h" #include "output.h"
#include "except.h" #include "except.h"
#include "expr.h" #include "expr.h"
#include "defaults.h"
#ifdef HAVE_STDLIB_H #ifdef HAVE_STDLIB_H
#include <stdlib.h> #include <stdlib.h>
...@@ -2527,6 +2528,12 @@ import_export_vtable (decl, type, final) ...@@ -2527,6 +2528,12 @@ import_export_vtable (decl, type, final)
TREE_PUBLIC (decl) = 1; TREE_PUBLIC (decl) = 1;
DECL_EXTERNAL (decl) = ! CLASSTYPE_VTABLE_NEEDS_WRITING (type); DECL_EXTERNAL (decl) = ! CLASSTYPE_VTABLE_NEEDS_WRITING (type);
DECL_INTERFACE_KNOWN (decl) = 1; 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 else
{ {
...@@ -2618,6 +2625,7 @@ finish_vtable_vardecl (prev, vars) ...@@ -2618,6 +2625,7 @@ finish_vtable_vardecl (prev, vars)
if (write_virtuals >= 0 if (write_virtuals >= 0
&& ! DECL_EXTERNAL (vars) && ! DECL_EXTERNAL (vars)
&& ((TREE_PUBLIC (vars) && ! DECL_WEAK (vars) && ! DECL_ONE_ONLY (vars)) && ((TREE_PUBLIC (vars) && ! DECL_WEAK (vars) && ! DECL_ONE_ONLY (vars))
|| CLASSTYPE_EXPLICIT_INSTANTIATION (DECL_CONTEXT (vars))
|| TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (vars)) || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (vars))
|| (hack_decl_function_context (vars) && TREE_USED (vars))) || (hack_decl_function_context (vars) && TREE_USED (vars)))
&& ! TREE_ASM_WRITTEN (vars)) && ! TREE_ASM_WRITTEN (vars))
...@@ -2815,6 +2823,12 @@ import_export_decl (decl) ...@@ -2815,6 +2823,12 @@ import_export_decl (decl)
DECL_NOT_REALLY_EXTERN (decl) DECL_NOT_REALLY_EXTERN (decl)
= ! (CLASSTYPE_INTERFACE_ONLY (ctype) = ! (CLASSTYPE_INTERFACE_ONLY (ctype)
|| (DECL_THIS_INLINE (decl) && ! flag_implement_inlines)); || (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)) else if (TYPE_BUILT_IN (ctype) && ctype == TYPE_MAIN_VARIANT (ctype))
DECL_NOT_REALLY_EXTERN (decl) = 0; DECL_NOT_REALLY_EXTERN (decl) = 0;
......
...@@ -4327,16 +4327,8 @@ mark_class_instantiated (t, extern_p) ...@@ -4327,16 +4327,8 @@ mark_class_instantiated (t, extern_p)
int extern_p; int extern_p;
{ {
SET_CLASSTYPE_EXPLICIT_INSTANTIATION (t); SET_CLASSTYPE_EXPLICIT_INSTANTIATION (t);
SET_CLASSTYPE_INTERFACE_KNOWN (t);
if (supports_one_only () && ! SUPPORTS_WEAK) CLASSTYPE_INTERFACE_ONLY (t) = extern_p;
/* For WIN32 we also want to put explicit instantiations in
linkonce sections. */;
else
{
SET_CLASSTYPE_INTERFACE_KNOWN (t);
CLASSTYPE_INTERFACE_ONLY (t) = extern_p;
}
CLASSTYPE_VTABLE_NEEDS_WRITING (t) = ! extern_p; CLASSTYPE_VTABLE_NEEDS_WRITING (t) = ! extern_p;
TYPE_DECL_SUPPRESS_DEBUG (TYPE_NAME (t)) = extern_p; TYPE_DECL_SUPPRESS_DEBUG (TYPE_NAME (t)) = extern_p;
if (! extern_p) if (! extern_p)
......
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