public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Marc Poulhiès" <poulhies@adacore.com>
To: gcc-patches@gcc.gnu.org
Cc: Piotr Trojanek <trojanek@adacore.com>
Subject: [COMMITTED] ada: Remove redundant calls in handling of aspect specifications
Date: Fri,  4 Nov 2022 14:58:15 +0100	[thread overview]
Message-ID: <20221104135815.86869-1-poulhies@adacore.com> (raw)

From: Piotr Trojanek <trojanek@adacore.com>

Routine Set_Aspect_Specifications sets the Has_Aspect flag, so there is
no need to set this flag again afterwards.

Code cleanup; semantics is unaffected.

gcc/ada/

	* aspects.adb (Relocate_Aspect): Remove call to Set_Has_Aspects.
	* sem_ch12.adb (Analyze_Formal_Package_Declaration): Likewise.
	* sem_util.adb (Copy_Ghost_Aspect, Copy_SPARK_Mode_Aspect):
	Likewise.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/aspects.adb  | 1 -
 gcc/ada/sem_ch12.adb | 1 -
 gcc/ada/sem_util.adb | 2 --
 3 files changed, 4 deletions(-)

diff --git a/gcc/ada/aspects.adb b/gcc/ada/aspects.adb
index 3471a81f176..81c9c284048 100644
--- a/gcc/ada/aspects.adb
+++ b/gcc/ada/aspects.adb
@@ -373,7 +373,6 @@ package body Aspects is
          else
             Asps := New_List;
             Set_Aspect_Specifications (To, Asps);
-            Set_Has_Aspects (To);
          end if;
 
          --  Remove the aspect from its original owner and relocate it to node
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 6781e5ee5b6..0b7b7c904d3 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -3121,7 +3121,6 @@ package body Sem_Ch12 is
       if Present (Aspect_Specifications (Gen_Decl)) then
          if No (Aspect_Specifications (N)) then
             Set_Aspect_Specifications (N, New_List);
-            Set_Has_Aspects (N);
          end if;
 
          declare
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 536d5fadefb..80d07eb0023 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -7049,7 +7049,6 @@ package body Sem_Util is
 
          if Present (Asp) then
             Set_Aspect_Specifications (To, New_List (New_Copy_Tree (Asp)));
-            Set_Has_Aspects (To, True);
          end if;
       end if;
    end Copy_Ghost_Aspect;
@@ -7101,7 +7100,6 @@ package body Sem_Util is
 
          if Present (Asp) then
             Set_Aspect_Specifications (To, New_List (New_Copy_Tree (Asp)));
-            Set_Has_Aspects (To, True);
          end if;
       end if;
    end Copy_SPARK_Mode_Aspect;
-- 
2.34.1


                 reply	other threads:[~2022-11-04 13:58 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=20221104135815.86869-1-poulhies@adacore.com \
    --to=poulhies@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=trojanek@adacore.com \
    /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).