]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-core: clarify clobber comments
authorJason Merrill <jason@redhat.com>
Thu, 22 Feb 2024 10:06:27 +0000 (10:06 +0000)
committerJason Merrill <jason@redhat.com>
Thu, 14 Mar 2024 21:14:19 +0000 (17:14 -0400)
It came up on the mailing list that OBJECT_BEGIN/END are described as
marking object lifetime, but mark the beginning of the constructor and end
of the destructor, whereas the C++ notion of lifetime is between the end of
the constructor and beginning of the destructor.  So let's fix the comments.

gcc/ChangeLog:

* tree-core.h (enum clobber_kind): Clarify CLOBBER_OBJECT_*
comments.

gcc/tree-core.h

index d529712306d9a0592d8326077e20da70a58fefe6..a74fbdf75b4b451faece866ce895d96db3bb0846 100644 (file)
@@ -993,9 +993,11 @@ enum clobber_kind {
   CLOBBER_UNDEF,
   /* Beginning of storage duration, e.g. malloc.  */
   CLOBBER_STORAGE_BEGIN,
-  /* Beginning of object lifetime, e.g. C++ constructor.  */
+  /* Beginning of object data, e.g. start of C++ constructor.  This differs
+     from C++ 'lifetime', which starts when initialization is complete; a
+     clobber there would discard the initialization.  */
   CLOBBER_OBJECT_BEGIN,
-  /* End of object lifetime, e.g. C++ destructor.  */
+  /* End of object data, e.g. end of C++ destructor.  */
   CLOBBER_OBJECT_END,
   /* End of storage duration, e.g. free.  */
   CLOBBER_STORAGE_END,