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-6050] [Ada] Refactor repeated code for component attributes
Date: Tue, 15 Dec 2020 11:43:19 +0000 (GMT)	[thread overview]
Message-ID: <20201215114319.C8FDC384B106@sourceware.org> (raw)

https://gcc.gnu.org/g:10853d6e8a0cc92f2dcf2a396db9ae73f75b5abc

commit r11-6050-g10853d6e8a0cc92f2dcf2a396db9ae73f75b5abc
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Mon Nov 23 23:44:06 2020 +0100

    [Ada] Refactor repeated code for component attributes
    
    gcc/ada/
    
            * sem_attr.adb (Analyze_Attribute): Merge identical code for
            First_Bit/Last_Bit and Position attributes.

Diff:
---
 gcc/ada/sem_attr.adb | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 30fdfb8c55d..537da93dc66 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -4094,6 +4094,7 @@ package body Sem_Attr is
 
       when Attribute_First_Bit
          | Attribute_Last_Bit
+         | Attribute_Position
       =>
          Check_Component;
          Set_Etype (N, Universal_Integer);
@@ -5305,9 +5306,7 @@ package body Sem_Attr is
       -- Position --
       --------------
 
-      when Attribute_Position =>
-         Check_Component;
-         Set_Etype (N, Universal_Integer);
+      --  Shares processing with First_Bit attribute
 
       ----------
       -- Pred --


                 reply	other threads:[~2020-12-15 11:43 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=20201215114319.C8FDC384B106@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: link
Be 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).