aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch6.adb
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2023-03-03 17:27:40 +0100
committerMarc Poulhiès <poulhies@adacore.com>2023-05-25 09:44:16 +0200
commitd1e196d39e592d053d2528b11874a6c228932431 (patch)
tree75137d3207c8cc5212bc5c67faa24d8e61d3a61e /gcc/ada/sem_ch6.adb
parentc7b84ce699965738b0f2f2d15039c716255f7588 (diff)
downloadgcc-d1e196d39e592d053d2528b11874a6c228932431.zip
gcc-d1e196d39e592d053d2528b11874a6c228932431.tar.gz
gcc-d1e196d39e592d053d2528b11874a6c228932431.tar.bz2
ada: Remove redundant guards from calls to Move_Aspects
Routine Move_Aspects does nothing if its From parameter has no aspects. There is no need to check this at the call sites. Code cleanup related to changes in handling of expressions functions in GNATprove; semantics is unaffected. gcc/ada/ * par-ch7.adb (P_Package): Remove redundant guard from call to Move_Aspects. * par-ch9.adb (P_Task): Likewise. * sem_ch6.adb (Analyze_Expression_Function, Is_Inline_Pragma): Likewise.
Diffstat (limited to 'gcc/ada/sem_ch6.adb')
-rw-r--r--gcc/ada/sem_ch6.adb8
1 files changed, 2 insertions, 6 deletions
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 48b363e..135d8ab 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -390,9 +390,7 @@ package body Sem_Ch6 is
-- function to the proper body when the expression function acts
-- as a completion.
- if Has_Aspects (N) then
- Move_Aspects (N, To => New_Body);
- end if;
+ Move_Aspects (N, To => New_Body);
Relocate_Pragmas_To_Body (New_Body);
@@ -2875,9 +2873,7 @@ package body Sem_Ch6 is
-- Move aspects to the new spec
- if Has_Aspects (N) then
- Move_Aspects (N, To => Decl);
- end if;
+ Move_Aspects (N, To => Decl);
Insert_Before (N, Decl);
Analyze (Decl);