aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2020-04-24 17:36:24 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-06-19 04:17:08 -0400
commit5af0271f0e983311b99493519af9863b58109ee3 (patch)
treeac0af046ac6f1c9e716a5769add8d7aea7031704 /gcc/ada
parent75c44bc6a04d032e7c4dbce8c8dd652fae7f4ff1 (diff)
downloadgcc-5af0271f0e983311b99493519af9863b58109ee3.zip
gcc-5af0271f0e983311b99493519af9863b58109ee3.tar.gz
gcc-5af0271f0e983311b99493519af9863b58109ee3.tar.bz2
[Ada] Remove repeated testing of Check_Validity_Of_Parameters
2020-06-19 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * checks.adb (Apply_Parameter_Validity_Checks): Remove testing of Check_Validity_Of_Parameters for every formal parameter and function result.
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/checks.adb18
1 files changed, 8 insertions, 10 deletions
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index 746688f..b68f366 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -2679,8 +2679,8 @@ package body Checks is
if not Comes_From_Source (Subp)
- -- Do not process formal subprograms because the corresponding actual
- -- will receive the proper checks when the instance is analyzed.
+ -- Do not process formal subprograms because the corresponding actual
+ -- will receive the proper checks when the instance is analyzed.
or else Is_Formal_Subprogram (Subp)
@@ -2723,14 +2723,12 @@ package body Checks is
-- mode IN OUT - Pre, Post => Formal'Valid[_Scalars]
-- mode OUT - Post => Formal'Valid[_Scalars]
- if Check_Validity_Of_Parameters then
- if Ekind_In (Formal, E_In_Parameter, E_In_Out_Parameter) then
- Add_Validity_Check (Formal, Name_Precondition, False);
- end if;
+ if Ekind_In (Formal, E_In_Parameter, E_In_Out_Parameter) then
+ Add_Validity_Check (Formal, Name_Precondition, False);
+ end if;
- if Ekind_In (Formal, E_In_Out_Parameter, E_Out_Parameter) then
- Add_Validity_Check (Formal, Name_Postcondition, False);
- end if;
+ if Ekind_In (Formal, E_In_Out_Parameter, E_Out_Parameter) then
+ Add_Validity_Check (Formal, Name_Postcondition, False);
end if;
Next_Formal (Formal);
@@ -2740,7 +2738,7 @@ package body Checks is
-- Post => Subp'Result'Valid[_Scalars]
- if Check_Validity_Of_Parameters and then Ekind (Subp) = E_Function then
+ if Ekind (Subp) = E_Function then
Add_Validity_Check (Subp, Name_Postcondition, True);
end if;
end Apply_Parameter_Validity_Checks;