aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch3.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2012-10-01 10:45:43 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2012-10-01 10:45:43 +0200
commitc5a26133df8575533bc97def6e76bf66bec7f91a (patch)
treebc41eca22e0a81ac94816a7d59b5d89a6242b070 /gcc/ada/exp_ch3.adb
parent9e1902a9e7e3cb06d33ad2c1e1e002d2ba0973ec (diff)
downloadgcc-c5a26133df8575533bc97def6e76bf66bec7f91a.zip
gcc-c5a26133df8575533bc97def6e76bf66bec7f91a.tar.gz
gcc-c5a26133df8575533bc97def6e76bf66bec7f91a.tar.bz2
[multiple changes]
2012-10-01 Robert Dewar <dewar@adacore.com> * freeze.adb, sem_ch6.adb, opt.ads, sem_ch13.adb, exp_ch3.adb: Minor reformatting. 2012-10-01 Hristian Kirtchev <kirtchev@adacore.com> * checks.adb (Build_PPC_Pragma): A PPC pragma can now be properly associated with a subprogram body. From-SVN: r191902
Diffstat (limited to 'gcc/ada/exp_ch3.adb')
-rw-r--r--gcc/ada/exp_ch3.adb12
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index 293c902..cf99375 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -3626,7 +3626,7 @@ package body Exp_Ch3 is
-- Name for argument of invariant procedure
Object_Entity : constant Node_Id :=
- Make_Defining_Identifier (Loc, Object_Name);
+ Make_Defining_Identifier (Loc, Object_Name);
-- The procedure declaration entity for the argument
Invariant_Found : Boolean;
@@ -3681,10 +3681,10 @@ package body Exp_Ch3 is
begin
Stmts := New_List;
Decl := First_Non_Pragma (Component_Items (Comp_List));
-
while Present (Decl) loop
if Nkind (Decl) = N_Component_Declaration then
Id := Defining_Identifier (Decl);
+
if Has_Invariants (Etype (Id)) then
Append_To (Stmts, Build_Component_Invariant_Call (Id));
end if;
@@ -3734,14 +3734,16 @@ package body Exp_Ch3 is
return Stmts;
end Build_Invariant_Checks;
+ -- Start of processing for Build_Record_Invariant_Proc
+
begin
Invariant_Found := False;
Type_Def := Type_Definition (Parent (R_Type));
+
if Nkind (Type_Def) = N_Record_Definition
- and then not Null_Present (Type_Def)
+ and then not Null_Present (Type_Def)
then
- Stmts :=
- Build_Invariant_Checks (Component_List (Type_Def));
+ Stmts := Build_Invariant_Checks (Component_List (Type_Def));
else
return;
end if;