* [PATCH RFA] tree-core: clarify clobber comments
@ 2024-03-14 20:27 Jason Merrill
2024-03-14 20:46 ` Jakub Jelinek
0 siblings, 1 reply; 2+ messages in thread
From: Jason Merrill @ 2024-03-14 20:27 UTC (permalink / raw)
To: gcc-patches
OK for trunk?
-- 8< --
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 | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/gcc/tree-core.h b/gcc/tree-core.h
index 8a89462bd7e..654d182b1c3 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,
base-commit: 5c01ede02a1f9ba1a58ab8d96a73e46e0484d820
--
2.43.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH RFA] tree-core: clarify clobber comments
2024-03-14 20:27 [PATCH RFA] tree-core: clarify clobber comments Jason Merrill
@ 2024-03-14 20:46 ` Jakub Jelinek
0 siblings, 0 replies; 2+ messages in thread
From: Jakub Jelinek @ 2024-03-14 20:46 UTC (permalink / raw)
To: Jason Merrill; +Cc: gcc-patches
On Thu, Mar 14, 2024 at 04:27:22PM -0400, Jason Merrill wrote:
> OK for trunk?
>
> -- 8< --
>
> 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.
LGTM.
> diff --git a/gcc/tree-core.h b/gcc/tree-core.h
> index 8a89462bd7e..654d182b1c3 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,
>
> base-commit: 5c01ede02a1f9ba1a58ab8d96a73e46e0484d820
> --
> 2.43.2
Jakub
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-03-14 20:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-14 20:27 [PATCH RFA] tree-core: clarify clobber comments Jason Merrill
2024-03-14 20:46 ` Jakub Jelinek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).