diff options
author | Hristian Kirtchev <kirtchev@adacore.com> | 2014-08-04 12:55:46 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-08-04 14:55:46 +0200 |
commit | e85f4337c3c9ced8e7eece753962443d230b487f (patch) | |
tree | d312a2cd73dfff82b4b1bee4bb27fb68ec775c25 | |
parent | 135da41f0d468b1f90c7ddcc6d965ba47b17ad5b (diff) | |
download | gcc-e85f4337c3c9ced8e7eece753962443d230b487f.zip gcc-e85f4337c3c9ced8e7eece753962443d230b487f.tar.gz gcc-e85f4337c3c9ced8e7eece753962443d230b487f.tar.bz2 |
sem_ch3.adb (Analyze_Declarations): Explain why the bodies of the default initial condition procedures are build here.
2014-08-04 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch3.adb (Analyze_Declarations): Explain why the bodies of
the default initial condition procedures are build here.
* sem_util.adb (Build_Default_Init_Cond_Procedure): Wrap the
analyzed argument of pragma Default_Initial_Condition in some
dummy code as GNATprove mode disables assertions, but still
needs to see the argument.
From-SVN: r213582
-rw-r--r-- | gcc/ada/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/ada/sem_ch3.adb | 12 | ||||
-rw-r--r-- | gcc/ada/sem_util.adb | 2 |
3 files changed, 19 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 3f10d88..d210982 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,12 @@ +2014-08-04 Hristian Kirtchev <kirtchev@adacore.com> + + * sem_ch3.adb (Analyze_Declarations): Explain why the bodies of + the default initial condition procedures are build here. + * sem_util.adb (Build_Default_Init_Cond_Procedure): Wrap the + analyzed argument of pragma Default_Initial_Condition in some + dummy code as GNATprove mode disables assertions, but still + needs to see the argument. + 2014-08-04 Robert Dewar <dewar@adacore.com> * exp_ch6.adb, sem_util.adb: Minor reformatting. diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 5b16aa2..351ae87 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -2388,12 +2388,18 @@ package body Sem_Ch3 is -- When a package has private declarations, its contract must be -- analyzed at the end of the said declarations. This way both the -- analysis and freeze actions are properly synchronized in case - -- of private type use within the contract. Build the bodies of - -- the default initial condition procedures for all types subject - -- to pragma Default_Initial_Condition. + -- of private type use within the contract. if L = Private_Declarations (Context) then Analyze_Package_Contract (Defining_Entity (Context)); + + -- Build the bodies of the default initial condition procedures + -- for all types subject to pragma Default_Initial_Condition. + -- From a purely Ada stand point, this is a freezing activity, + -- however freezing is not available under GNATprove_Mode. To + -- accomodate both scenarios, the bodies are build at the end + -- of private declaration analysis. + Build_Default_Init_Cond_Procedure_Bodies (L); -- Otherwise the contract is analyzed at the end of the visible diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 6759903..01c1624 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -1298,7 +1298,7 @@ package body Sem_Util is Expr : Node_Id; Stmt : Node_Id; - -- Start of processing for Build_Default_Init_Cond_Procedure + -- Start of processing for Build_Default_Init_Cond_Procedure_Body begin -- The procedure should be generated only for [sub]types subject to |