]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Remove redundant calls in handling of aspect specifications
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 26 Aug 2022 13:27:31 +0000 (15:27 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Fri, 4 Nov 2022 13:47:29 +0000 (14:47 +0100)
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.

gcc/ada/aspects.adb
gcc/ada/sem_ch12.adb
gcc/ada/sem_util.adb

index 3471a81f1766c76c4c7d979e488f18e12693f6a3..81c9c2840480beee26ec48352c56137092ec5d27 100644 (file)
@@ -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
index 6781e5ee5b64c3db319198215370736626cb02e7..0b7b7c904d3d0d57dd36ee4f303468a98e00beb8 100644 (file)
@@ -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
index 536d5fadefb6c8d9a27adcf37316331b21f71a1e..80d07eb00237b4447f86e98e96535b1f71e9e873 100644 (file)
@@ -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;