c-ada-spec.c (print_destructor): Deal with deleting destructors.
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 9 Apr 2019 19:29:17 +0000 (19:29 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 9 Apr 2019 19:29:17 +0000 (19:29 +0000)
* c-ada-spec.c (print_destructor): Deal with deleting destructors.
(dump_ada_declaration) <FUNCTION_DECL>: Likewise.

From-SVN: r270239

gcc/c-family/ChangeLog
gcc/c-family/c-ada-spec.c

index c62395f2acf2c5d14d1904a289f27a64321bed68..2d118f2f73b89bc973f8ddfa496672ba86949e4f 100644 (file)
@@ -1,3 +1,8 @@
+2019-04-09  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * c-ada-spec.c (print_destructor): Deal with deleting destructors.
+       (dump_ada_declaration) <FUNCTION_DECL>: Likewise.
+
 2019-04-07  Eric Botcazou  <ebotcazou@adacore.com>
 
        * c-ada-spec.c (is_float128): New predicate extracted from...
index 2ca8bdaeaa306cfc4e291a31a2a2f1caff0e4d9d..c85e6060d3e73c6b9982e72766c291bc2570bb8f 100644 (file)
@@ -2676,6 +2676,8 @@ print_destructor (pretty_printer *buffer, tree t, tree type)
   tree decl_name = DECL_NAME (TYPE_NAME (type));
 
   pp_string (buffer, "Delete_");
+  if (strncmp (IDENTIFIER_POINTER (DECL_NAME (t)), "__dt_del", 8) == 0)
+    pp_string (buffer, "And_Free_");
   pp_ada_tree_identifier (buffer, decl_name, t, false);
 }
 
@@ -2946,9 +2948,10 @@ dump_ada_declaration (pretty_printer *buffer, tree t, tree type, int spc)
          if (DECL_ARTIFICIAL (t))
            return 0;
 
-         /* Only consider constructors/destructors for complete objects.  */
+         /* Only consider complete constructors and deleting destructors.  */
          if (strncmp (IDENTIFIER_POINTER (decl_name), "__ct_comp", 9) != 0
-             && strncmp (IDENTIFIER_POINTER (decl_name), "__dt_comp", 9) != 0)
+             && strncmp (IDENTIFIER_POINTER (decl_name), "__dt_comp", 9) != 0
+             && strncmp (IDENTIFIER_POINTER (decl_name), "__dt_del", 8) != 0)
            return 0;
        }