]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++, coroutines: Delete now unused code for parm guards.
authorIain Sandoe <iain@sandoe.co.uk>
Sun, 25 May 2025 11:14:13 +0000 (12:14 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Thu, 29 May 2025 15:17:40 +0000 (16:17 +0100)
Since r16-775-g18df4a10bc9694 we use nested cleanups to
handle parameter copy destructors in the ramp (and pass
a list of cleanups required to the actor which will only
be invoked if the parameter copies were all correctly
built - and therefore does not need to guard destructors
either.

This deletes the provisions for frame parameter copy
destructor guards.

gcc/cp/ChangeLog:

* coroutines.cc (analyze_fn_parms): No longer
create a parameter copy guard var.
* coroutines.h (struct param_info): Remove the
entry for the parameter copy destructor guard.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/cp/coroutines.cc
gcc/cp/coroutines.h

index b1e555cb33659a0925d7733b81ac57151dffa858..64a0a344349e46ff05b62d46c3ef955adef90097 100644 (file)
@@ -4089,17 +4089,7 @@ analyze_fn_parms (tree orig, hash_map<tree, param_info> *param_uses)
        }
       parm.field_id = name;
       if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (parm.frame_type))
-       {
-         char *buf = xasprintf ("_Coro_q%u_%s_live", parm_num,
-                                DECL_NAME (arg) ? IDENTIFIER_POINTER (name)
-                                                : "__unnamed");
-         parm.guard_var
-           = coro_build_artificial_var (UNKNOWN_LOCATION, get_identifier (buf),
-                                        boolean_type_node, orig,
-                                        boolean_false_node);
-         free (buf);
-         parm.trivial_dtor = false;
-       }
+       parm.trivial_dtor = false;
       else
        parm.trivial_dtor = true;
     }
index d13bea0f302bf2d5e8d5f469780db40bd636b804..10698cf2e129dbf4814fbeed348fe27134289031 100644 (file)
@@ -9,7 +9,6 @@ struct param_info
   vec<tree *> *body_uses; /* Worklist of uses, void if there are none.  */
   tree frame_type;   /* The type used to represent this parm in the frame.  */
   tree orig_type;    /* The original type of the parm (not as passed).  */
-  tree guard_var;    /* If we need a DTOR on exception, this bool guards it.  */
   tree fr_copy_dtor; /* If we need a DTOR on exception, this is it.  */
   bool by_ref;       /* Was passed by reference.  */
   bool pt_ref;       /* Was a pointer to object.  */