diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-18 10:53:39 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-18 10:53:39 +0000 |
commit | af90720d78a1a655f4a598d1ddc51e472dca2439 (patch) | |
tree | 34ba584a7a250519b5af1e0804a532ecbb456e43 /gcc/ada/sem_prag.adb | |
parent | 0763da1da9253d932711b577f3ed7a5c4c929e04 (diff) | |
download | gcc-af90720d78a1a655f4a598d1ddc51e472dca2439.tar.gz |
2015-11-18 Hristian Kirtchev <kirtchev@adacore.com>
* atree.adb (Elist11): New routine.
(Set_Elist11): New routine.
* atree.ads (Elist11): New routine.
(Set_Elist11): New routine.
* atree.h: Define Elist11.
* contracts.adb (Analyze_Object_Contract): Verify the legality
of all references to a variable given that the variable is a
constituent of a single protected/task type.
* einfo.adb: Part_Of_References now utilizes Elist11.
(Part_Of_References): New routine.
(Set_Part_Of_References): New routine.
(Write_Field11_Name): Add output for Part_Of_References.
* einfo.ads New attribute Part_Of_References along with usage
in entities.
(Part_Of_References): New routine along with
pragma Inline.
(Set_Part_Of_References): New routine along with pragma Inline.
* sem_prag.adb (Analyze_Constituent): Record a possible
reference to a concurrent constituent.
(Analyze_Global_Item): Record a possible reference to a concurrent
constituent.
(Analyze_Input_Output): Record a possible reference to a
concurrent constituent.
* sem_res.adb (Resolve_Entity_Name): Record a possible reference
to a concurrent constituent.
* sem_util.adb (Check_Part_Of_Reference): New routine.
(Record_Possible_Part_Of_Reference): New routine.
* sem_util.ads (Check_Part_Of_Reference): New routine.
(Record_Possible_Part_Of_Reference): New routine.
2015-11-18 Ed Schonberg <schonberg@adacore.com>
* checks.adb (Apply_Arithmetic_Overflow_Minimized_Eliminated):
An if_expression is the proper place to apply the overflow
minimization procedure if its context is not an enclosing
arithmetic expression.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230540 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_prag.adb')
-rw-r--r-- | gcc/ada/sem_prag.adb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index f3282ea97f9..dd462199378 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -957,6 +957,16 @@ package body Sem_Prag is if Ekind (Item_Id) = E_Abstract_State then Append_New_Elmt (Item_Id, States_Seen); + + -- The variable may eventually become a constituent of a + -- single protected/task type. Record the reference now + -- and verify its legality when analyzing the contract of + -- the variable (SPARK RM 9.3). + + elsif Ekind (Item_Id) = E_Variable then + Record_Possible_Part_Of_Reference + (Var_Id => Item_Id, + Ref => Item); end if; if Ekind_In (Item_Id, E_Abstract_State, @@ -2209,6 +2219,16 @@ package body Sem_Prag is if Ekind (Item_Id) = E_Abstract_State then Append_New_Elmt (Item_Id, States_Seen); + + -- The variable may eventually become a constituent of a single + -- protected/task type. Record the reference now and verify its + -- legality when analyzing the contract of the variable + -- (SPARK RM 9.3). + + elsif Ekind (Item_Id) = E_Variable then + Record_Possible_Part_Of_Reference + (Var_Id => Item_Id, + Ref => Item); end if; if Ekind_In (Item_Id, E_Abstract_State, E_Constant, E_Variable) @@ -25452,6 +25472,17 @@ package body Sem_Prag is then Match_Constituent (Constit_Id); + -- The variable may eventually become a constituent of a + -- single protected/task type. Record the reference now + -- and verify its legality when analyzing the contract of + -- the variable (SPARK RM 9.3). + + if Ekind (Constit_Id) = E_Variable then + Record_Possible_Part_Of_Reference + (Var_Id => Constit_Id, + Ref => Constit); + end if; + -- Otherwise the constituent is illegal else |