]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
pt.c (do_type_instantiation): Fix typo.
authorJason Merrill <jason@gcc.gnu.org>
Wed, 12 Nov 1997 19:53:33 +0000 (14:53 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 12 Nov 1997 19:53:33 +0000 (14:53 -0500)
* 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
  for destructor.

From-SVN: r16445

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/init.c
gcc/cp/pt.c

index 6971e935aaa7e610978c59ad854698dd33459174..be548a8c91ce47771cde80e1abb47db7c6ff30e4 100644 (file)
@@ -1,3 +1,16 @@
+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
+       for destructor.
+
 Wed Nov 12 00:48:16 1997  Jason Merrill  <jason@yorick.cygnus.com>
 
        * init.c (build_new): Handle freeing allocated memory when the
index d4cf780f277bf86b9aa7d913cf50e90bddfbecf0..f8eb43e9da9b439c5e28f37bb395f1cd141070f1 100644 (file)
@@ -1812,7 +1812,7 @@ build_method_call (instance, name, parms, basetype_path, flags)
          return cp_convert (void_type_node, instance);
        }
 
-      if (! TYPE_HAS_DESTRUCTOR (basetype))
+      if (! TYPE_HAS_DESTRUCTOR (complete_type (basetype)))
        return cp_convert (void_type_node, instance);
       instance = default_conversion (instance);
       instance_ptr = build_unary_op (ADDR_EXPR, instance, 0);
index 5c02d053bdd46ccfdd05283406d531ce6f54b53e..48fe7a4a2c88aacff4ace81837bdf970bcc78c2e 100644 (file)
@@ -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);
index 96b21aae03b4ef20c219ce03f89d5f831f363176..f5a1291b3471f333bb44eee7bf852a754ee1e011 100644 (file)
@@ -3962,6 +3962,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);
     }
@@ -4297,8 +4300,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)
@@ -4373,7 +4384,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);