aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJavier Miranda <miranda@adacore.com>2014-10-10 13:23:22 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2014-10-10 15:23:22 +0200
commitd56f4479e63df5de87b47572640de835924cf443 (patch)
tree874ad07b81a5d2346941e7af5e2b47f33acca72e /gcc
parent5e396da6b43aa2ba1fc30df73b8beb257bfd081d (diff)
downloadgcc-d56f4479e63df5de87b47572640de835924cf443.zip
gcc-d56f4479e63df5de87b47572640de835924cf443.tar.gz
gcc-d56f4479e63df5de87b47572640de835924cf443.tar.bz2
exp_ch3.adb (Build_Init_Procedure): Complete the condition of an if-stmt to match its current documentation.
2014-10-10 Javier Miranda <miranda@adacore.com> * exp_ch3.adb (Build_Init_Procedure): Complete the condition of an if-stmt to match its current documentation. From-SVN: r216080
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/exp_ch3.adb22
2 files changed, 13 insertions, 14 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index e835483..d8408eb 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2014-10-10 Javier Miranda <miranda@adacore.com>
+
+ * exp_ch3.adb (Build_Init_Procedure): Complete the condition of an
+ if-stmt to match its current documentation.
+
2014-10-10 Robert Dewar <dewar@adacore.com>
* sem_ch7.adb, einfo.adb, einfo.ads, sem_prag.adb, sem_ch12.adb,
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index 9541ad0..1aa813e 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -2371,16 +2371,11 @@ package body Exp_Ch3 is
-- such case the initialization of the _parent field was not
-- generated.
- if not Is_Interface (Etype (Rec_Ent)) then
- declare
- First_Stmt : constant Node_Id := Remove_Head (Stmts);
- begin
- pragma Assert
- (Nkind (First_Stmt) = N_Procedure_Call_Statement
- and then
- Is_Init_Proc (Name (First_Stmt)));
- Prepend_To (Body_Stmts, First_Stmt);
- end;
+ if not Is_Interface (Etype (Rec_Ent))
+ and then Nkind (First (Stmts)) = N_Procedure_Call_Statement
+ and then Is_Init_Proc (Name (First (Stmts)))
+ then
+ Prepend_To (Body_Stmts, Remove_Head (Stmts));
end if;
Append_List_To (Body_Stmts, Stmts);
@@ -2664,9 +2659,9 @@ package body Exp_Ch3 is
function Build_Init_Statements (Comp_List : Node_Id) return List_Id is
Checks : constant List_Id := New_List;
- Actions : List_Id := No_List;
+ Actions : List_Id := No_List;
+ Counter_Id : Entity_Id := Empty;
Comp_Loc : Source_Ptr;
- Counter_Id : Entity_Id := Empty;
Decl : Node_Id;
Has_POC : Boolean;
Id : Entity_Id;
@@ -2980,8 +2975,7 @@ package body Exp_Ch3 is
else
Append_List_To (Stmts, Actions);
- -- Preserve the initialization state in the current
- -- counter
+ -- Preserve initialization state in the current counter
if Needs_Finalization (Typ) then
if No (Counter_Id) then