public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-522] [Ada] Fix documentation of using attribute Loop_Entry in pragmas Date: Tue, 17 May 2022 08:27:32 +0000 (GMT) [thread overview] Message-ID: <20220517082732.75F32385781D@sourceware.org> (raw) https://gcc.gnu.org/g:8fc021c0988113e1fcc5ec026f2382b074894e95 commit r13-522-g8fc021c0988113e1fcc5ec026f2382b074894e95 Author: Piotr Trojanek <trojanek@adacore.com> Date: Wed Mar 16 14:42:14 2022 +0100 [Ada] Fix documentation of using attribute Loop_Entry in pragmas Attribute Loop_Entry was initially only allowed to appear in pragmas Loop_Variant and Loop_Invariant. Then it was also allowed to appear in pragmas Assert, Assert_And_Cut and Assume, but this change was not reflected in the GNAT RM. gcc/ada/ * doc/gnat_rm/implementation_defined_attributes.rst (Loop_Entry): Mention pragmas Assert, Assert_And_Cut and Assume; refill. * gnat_rm.texi: Regenerate. Diff: --- gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst | 11 +++++++---- gcc/ada/gnat_rm.texi | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst b/gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst index dc5a1ab40a1..1b4f4fe5704 100644 --- a/gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst +++ b/gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst @@ -629,10 +629,13 @@ to the value an expression had upon entry to the subprogram. The relevant loop is either identified by the given loop name, or it is the innermost enclosing loop when no loop name is given. -A ``Loop_Entry`` attribute can only occur within a -``Loop_Variant`` or ``Loop_Invariant`` pragma. A common use of -``Loop_Entry`` is to compare the current value of objects with their -initial value at loop entry, in a ``Loop_Invariant`` pragma. +A ``Loop_Entry`` attribute can only occur within an ``Assert``, +``Assert_And_Cut``, ``Assume``, ``Loop_Variant`` or ``Loop_Invariant`` pragma. +In addition, such a pragma must be one of the items in the sequence +of statements of a loop body, or nested inside block statements that +appear in the sequence of statements of a loop body. +A common use of ``Loop_Entry`` is to compare the current value of objects with +their initial value at loop entry, in a ``Loop_Invariant`` pragma. The effect of using ``X'Loop_Entry`` is the same as declaring a constant initialized with the initial value of ``X`` at loop diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index c5a87793494..7e9a7ecffec 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -11028,10 +11028,13 @@ to the value an expression had upon entry to the subprogram. The relevant loop is either identified by the given loop name, or it is the innermost enclosing loop when no loop name is given. -A @code{Loop_Entry} attribute can only occur within a -@code{Loop_Variant} or @code{Loop_Invariant} pragma. A common use of -@code{Loop_Entry} is to compare the current value of objects with their -initial value at loop entry, in a @code{Loop_Invariant} pragma. +A @code{Loop_Entry} attribute can only occur within an @code{Assert}, +@code{Assert_And_Cut}, @code{Assume}, @code{Loop_Variant} or @code{Loop_Invariant} pragma. +In addition, such a pragma must be one of the items in the sequence +of statements of a loop body, or nested inside block statements that +appear in the sequence of statements of a loop body. +A common use of @code{Loop_Entry} is to compare the current value of objects with +their initial value at loop entry, in a @code{Loop_Invariant} pragma. The effect of using @code{X'Loop_Entry} is the same as declaring a constant initialized with the initial value of @code{X} at loop
reply other threads:[~2022-05-17 8:27 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220517082732.75F32385781D@sourceware.org \ --to=pmderodat@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).