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 r11-6058] [Ada] Refactor repeated code for Value attributes Date: Tue, 15 Dec 2020 11:44:01 +0000 (GMT) [thread overview] Message-ID: <20201215114401.9F21A3843893@sourceware.org> (raw) https://gcc.gnu.org/g:b2304663888042a75a07851833519842a953cecb commit r11-6058-gb2304663888042a75a07851833519842a953cecb Author: Piotr Trojanek <trojanek@adacore.com> Date: Tue Nov 24 16:01:52 2020 +0100 [Ada] Refactor repeated code for Value attributes gcc/ada/ * sem_attr.adb (Analyze_Attribute): Reuse existing code for attribute Value when analyzing attributes Wide_Value and Wide_Wide_Value. Diff: --- gcc/ada/sem_attr.adb | 41 ++++++----------------------------------- 1 file changed, 6 insertions(+), 35 deletions(-) diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 865bbae4885..d5970a1f62c 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -7088,7 +7088,10 @@ package body Sem_Attr is -- Value -- ----------- - when Attribute_Value => + when Attribute_Value + | Attribute_Wide_Value + | Attribute_Wide_Wide_Value + => Check_E1; Check_Scalar_Type; @@ -7174,45 +7177,13 @@ package body Sem_Attr is -- Wide_Value -- ---------------- - when Attribute_Wide_Value => - Check_E1; - Check_Scalar_Type; - - -- Set Etype before resolving expression because expansion - -- of expression may require enclosing type. - - Set_Etype (N, P_Type); - Validate_Non_Static_Attribute_Function_Call; - - -- Check restriction No_Fixed_IO - - if Restriction_Check_Required (No_Fixed_IO) - and then Is_Fixed_Point_Type (P_Type) - then - Check_Restriction (No_Fixed_IO, P); - end if; + -- Shares processing with Value attribute --------------------- -- Wide_Wide_Value -- --------------------- - when Attribute_Wide_Wide_Value => - Check_E1; - Check_Scalar_Type; - - -- Set Etype before resolving expression because expansion - -- of expression may require enclosing type. - - Set_Etype (N, P_Type); - Validate_Non_Static_Attribute_Function_Call; - - -- Check restriction No_Fixed_IO - - if Restriction_Check_Required (No_Fixed_IO) - and then Is_Fixed_Point_Type (P_Type) - then - Check_Restriction (No_Fixed_IO, P); - end if; + -- Shares processing with Value attribute --------------------- -- Wide_Wide_Width --
reply other threads:[~2020-12-15 11:44 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=20201215114401.9F21A3843893@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).