diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2009-06-21 15:19:57 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2009-06-21 15:19:57 +0200 |
commit | f3b57ab07947fb2cd07b0abebdfca7784875bc1a (patch) | |
tree | f10817861720e5be575f1049ddbaf8826f62e83b /gcc/ada/sem_ch13.adb | |
parent | 4f91a2557f88fd788380e3059bb7f475418002a6 (diff) | |
download | gcc-f3b57ab07947fb2cd07b0abebdfca7784875bc1a.zip gcc-f3b57ab07947fb2cd07b0abebdfca7784875bc1a.tar.gz gcc-f3b57ab07947fb2cd07b0abebdfca7784875bc1a.tar.bz2 |
[multiple changes]
2009-06-21 Thomas Quinot <quinot@adacore.com>
* exp_ch3.adb, exp_prag.adb, exp_util.adb, exp_util.ads, freeze.adb,
sem_ch13.adb, sem_elab.adb (Exp_Prag.Expand_Pragma_Import_Or_Interface):
Factor out code to new subprogram...
(Exp_Util.Find_Init_Call): New shared routine to find the init proc call
for a default initialized variable.
(Freeze.Check_Address_Clause): Do not reset Has_Delayed_Freeze on an
entity that has an associated freeze node.
(Sem_Ch13.Analyze_Attribute_Definition_Clause, case Address):
If there is an init call for the object, defer it to the object freeze
point.
(Check_Elab_Call.Find_Init_Call): Rename to Check_Init_Call, to avoid
name clash with new subprogram introduced in Exp_Util.
2009-06-21 Robert Dewar <dewar@adacore.com>
* einfo.ads: Minor reformatting
From-SVN: r148764
Diffstat (limited to 'gcc/ada/sem_ch13.adb')
-rw-r--r-- | gcc/ada/sem_ch13.adb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 89cfbb6..11bb5ed 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -977,6 +977,21 @@ package body Sem_Ch13 is Set_Has_Delayed_Freeze (U_Ent); + -- If an initialization call has been generated for this + -- object, it needs to be deferred to after the freeze node + -- we have just now added, otherwise GIGI will see a + -- reference to the variable (as actual to the IP call) + -- before its definition. + + declare + Init_Call : constant Node_Id := Find_Init_Call (U_Ent, N); + begin + if Present (Init_Call) then + Remove (Init_Call); + Append_Freeze_Action (U_Ent, Init_Call); + end if; + end; + if Is_Exported (U_Ent) then Error_Msg_N ("& cannot be exported if an address clause is given", |