diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-01-04 09:08:50 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-01-04 09:08:50 +0000 |
commit | df9fba45bc11329d2b71c742565833796eff4739 (patch) | |
tree | 3266b4f490ae72a9e167f1807975fd0e4f1971e9 /gcc/ada/sem_ch13.adb | |
parent | f9d34e9a216f7c9e2ba5a641ce95c4cff8f49ad4 (diff) | |
download | gcc-df9fba45bc11329d2b71c742565833796eff4739.tar.gz |
2013-01-04 Thomas Quinot <quinot@adacore.com>
* sinfo.ads: Minor documentation update.
2013-01-04 Thomas Quinot <quinot@adacore.com>
* sem_ch3.adb, einfo.adb (Analyze_Object_Declaration): Do not set Ekind
before resolving initialization expression.
2013-01-04 Hristian Kirtchev <kirtchev@adacore.com>
* checks.adb (Generate_Index_Checks): Delay the generation of
the check for an indexed component where the prefix mentions
Loop_Entry until the attribute has been properly expanded.
* exp_ch5.adb (Expand_Loop_Entry_Attributes): Perform minor
decoration of the constant that captures the value of Loop_Entry's
prefix at the entry point into a loop. Generate index checks
for an attribute reference that has been transformed into an
indexed component.
2013-01-04 Thomas Quinot <quinot@adacore.com>
* exp_prag.adb, exp_util.adb, exp_util.ads, freeze.adb, exp_aggr.adb,
sem_ch13.adb (Exp_Aggr.Collect_Initialization_Statements): Nothing to
do if Obj is already frozen.
(Exp_Util.Find_Init_Call): Rename to...
(Exp_Util.Remove_Init_Call): New subprogram, renamed from
Find_Init_Call. Remove the initialization call from the enclosing
list if found, and if it is from an Initialization_Statements
attribute, reset it.
(Exp_Util.Append_Freeze_Action): Minor code reorganization.
(Exp_Util.Append_Freeze_Actions): Ensure a freeze node has been
allocated (as is already done in Append_Freeze_Action).
(Freeze.Freeze_Entity): For an object with captured
Initialization_Statements and non-delayed freezeing, unwrap the
initialization statements and insert and them directly in the
enclosing list.
(Sem_Ch13.Check_Address_Clause): For an object
with Initialization_Statements and an address clause, unwrap the
initialization statements when moving them to the freeze actions.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194887 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch13.adb')
-rw-r--r-- | gcc/ada/sem_ch13.adb | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 0a2ac51a658..e02b7a085c7 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -2903,11 +2903,25 @@ package body Sem_Ch13 is -- before its definition. declare - Init_Call : constant Node_Id := Find_Init_Call (U_Ent, N); + Init_Call : constant Node_Id := + Remove_Init_Call (U_Ent, N); begin if Present (Init_Call) then - Remove (Init_Call); - Append_Freeze_Action (U_Ent, Init_Call); + + -- If the init call is an expression with actions with + -- null expression, just extract the actions. + + if Nkind (Init_Call) = N_Expression_With_Actions + and then Nkind (Expression (Init_Call)) + = N_Null_Statement + then + Append_Freeze_Actions (U_Ent, Actions (Init_Call)); + + -- General case: move Init_Call to freeze actions + + else + Append_Freeze_Action (U_Ent, Init_Call); + end if; end if; end; |