aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1997-11-12 19:50:15 +0000
committerJason Merrill <jason@gcc.gnu.org>1997-11-12 14:50:15 -0500
commita7d87521b25088ad928ba6d748adcf2ceaeb0c38 (patch)
treecd74bd334f6f346197d5fb32fdf7505756b1822d /gcc
parent31d525285d70fab6cc44a8c8809854c01deb73ea (diff)
downloadgcc-a7d87521b25088ad928ba6d748adcf2ceaeb0c38.zip
gcc-a7d87521b25088ad928ba6d748adcf2ceaeb0c38.tar.gz
gcc-a7d87521b25088ad928ba6d748adcf2ceaeb0c38.tar.bz2
pt.c (do_type_instantiation): Fix typo.
* pt.c (do_type_instantiation): Fix typo. (mark_class_instantiated): If we support one_only but not weak symbols, don't mark this as known. * init.c (build_new): Handle cookies in EH cleanup. From-SVN: r16444
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/init.c13
-rw-r--r--gcc/cp/pt.c17
3 files changed, 32 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b08ba70..68f93f0 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,11 @@
+Wed Nov 12 11:04:33 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * pt.c (do_type_instantiation): Fix typo.
+ (mark_class_instantiated): If we support one_only but not weak
+ symbols, don't mark this as known.
+
+ * init.c (build_new): Handle cookies in EH cleanup.
+
Wed Nov 12 08:11:55 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
* call.c (build_method_call): Call complete_type before checking
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 5c02d05..48fe7a4 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -2715,13 +2715,20 @@ build_new (placement, decl, init, use_global_new)
{
tree cleanup;
+ if (use_cookie)
+ cleanup = build (MINUS_EXPR, TREE_TYPE (alloc_expr),
+ alloc_expr, BI_header_size);
+ else
+ cleanup = alloc_expr;
+
if (! use_global_new && TYPE_LANG_SPECIFIC (true_type)
&& (TYPE_GETS_DELETE (true_type) & (1 << has_array)))
- cleanup = build_opfncall (DELETE_EXPR, LOOKUP_NORMAL,
- alloc_expr, size, NULL_TREE);
+ cleanup = build_opfncall (has_array? VEC_DELETE_EXPR : DELETE_EXPR,
+ LOOKUP_NORMAL, cleanup, size, NULL_TREE);
else
cleanup = build_builtin_call
- (void_type_node, BID, build_expr_list (NULL_TREE, alloc_expr));
+ (void_type_node, has_array ? BIVD : BID,
+ build_expr_list (NULL_TREE, cleanup));
rval = build (TRY_CATCH_EXPR, TREE_TYPE (rval), rval, cleanup);
rval = build (COMPOUND_EXPR, TREE_TYPE (rval), alloc_expr, rval);
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index b02ff63..dffe1bf 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -3988,6 +3988,9 @@ mark_decl_instantiated (result, extern_p)
{
DECL_INTERFACE_KNOWN (result) = 1;
DECL_NOT_REALLY_EXTERN (result) = 1;
+
+ /* For WIN32 we also want to put explicit instantiations in
+ linkonce sections. */
if (supports_one_only () && ! SUPPORTS_WEAK)
comdat_linkage (result);
}
@@ -4323,8 +4326,16 @@ mark_class_instantiated (t, extern_p)
int extern_p;
{
SET_CLASSTYPE_EXPLICIT_INSTANTIATION (t);
- SET_CLASSTYPE_INTERFACE_KNOWN (t);
- CLASSTYPE_INTERFACE_ONLY (t) = extern_p;
+
+ 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;
+ }
+
CLASSTYPE_VTABLE_NEEDS_WRITING (t) = ! extern_p;
TYPE_DECL_SUPPRESS_DEBUG (TYPE_NAME (t)) = extern_p;
if (! extern_p)
@@ -4399,7 +4410,7 @@ do_type_instantiation (t, storage)
if (! static_p)
for (tmp = TYPE_METHODS (t); tmp; tmp = TREE_CHAIN (tmp))
- if (TREE_CODE (t) == FUNCTION_DECL
+ if (TREE_CODE (tmp) == FUNCTION_DECL
&& DECL_TEMPLATE_INSTANTIATION (tmp))
{
mark_decl_instantiated (tmp, extern_p);