aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2024-02-22 10:06:27 +0000
committerJason Merrill <jason@redhat.com>2024-03-14 17:14:19 -0400
commitefab88888c1b692ab080bcee99a6ef7ba6ee43ed (patch)
treec99763b04ebed017d8c9c20642f25112e7f01f2a /gcc
parent6dbf0d252f69ab2924256e6778ba7dc55d5b6915 (diff)
downloadgcc-efab88888c1b692ab080bcee99a6ef7ba6ee43ed.zip
gcc-efab88888c1b692ab080bcee99a6ef7ba6ee43ed.tar.gz
gcc-efab88888c1b692ab080bcee99a6ef7ba6ee43ed.tar.bz2
tree-core: clarify clobber comments
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-core.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-core.h b/gcc/tree-core.h
index d529712..a74fbdf 100644
--- a/gcc/tree-core.h
+++ b/gcc/tree-core.h
@@ -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,