From 29484d709e3ff7b276400bf478ad81f15151fce6 Mon Sep 17 00:00:00 2001 From: pmderodat Date: Wed, 8 Nov 2017 14:07:31 +0000 Subject: 2017-11-08 Hristian Kirtchev * exp_ch3.adb (Expand_N_Object_Declaration): Save and restore relevant SPARK-related flags. Add ??? comment. * exp_util.adb (Insert_Actions): Add an entry for node N_Variable_Reference_Marker. * sem.adb (Analyze): Add an entry for node N_Variable_Reference_Marker. * sem_ch8.adb (Find_Direct_Name): Add constant Is_Assignment_LHS. Build and record a variable reference marker for the current name. (Find_Expanded_Name): Add constant Is_Assignment_LHS. Build and record a variable reference marker for the current name. * sem_elab.adb (Build_Variable_Reference_Marker): New routine. (Extract_Variable_Reference_Attributes): Reimplemented. (Info_Scenario): Add output for variable references and remove output for variable reads. (Info_Variable_Read): Removed. (Info_Variable_Reference): New routine. (Is_Suitable_Scenario): Variable references are now suitable scenarios while variable reads are not. (Output_Active_Scenarios): Add output for variable references and remove output for variable reads. (Output_Variable_Read): Removed. (Output_Variable_Reference): New routine. (Process_Variable_Read): Removed. (Process_Variable_Reference): New routine. (Process_Variable_Reference_Read): New routine. * sem_elab.ads (Build_Variable_Reference_Marker): New routine. * sem_res.adb (Resolve_Actuals): Build and record a variable reference marker for the current actual. * sem_spark.adb (Check_Node): Add an entry for node N_Variable_Reference_Marker. * sem_util.adb (Within_Subprogram_Call): Moved to the library level. * sem_util.ads (Within_Subprogram_Call): Moved to the library level. * sinfo.adb (Is_Read): New routine. (Is_Write): New routine. (Target): Updated to handle variable reference markers. (Set_Is_Read): New routine. (Set_Is_Write): New routine. (Set_Target): Updated to handle variable reference markers. * sinfo.ads: Add new attributes Is_Read and Is_Write along with occurrences in nodes. Update attribute Target. Add new node kind N_Variable_Reference_Marker. (Is_Read): New routine along with pragma Inline. (Is_Write): New routine along with pragma Inline. (Set_Is_Read): New routine along with pragma Inline. (Set_Is_Write): New routine along with pragma Inline. * sprint.adb (Sprint_Node_Actual): Add an entry for node N_Variable_Reference_Marker. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254531 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/sinfo.adb | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'gcc/ada/sinfo.adb') diff --git a/gcc/ada/sinfo.adb b/gcc/ada/sinfo.adb index dc4e8fb2c1a..5514291bb34 100644 --- a/gcc/ada/sinfo.adb +++ b/gcc/ada/sinfo.adb @@ -2090,6 +2090,14 @@ package body Sinfo is return Flag4 (N); end Is_Qualified_Universal_Literal; + function Is_Read + (N : Node_Id) return Boolean is + begin + pragma Assert (False + or else NT (N).Nkind = N_Variable_Reference_Marker); + return Flag1 (N); + end Is_Read; + function Is_Recorded_Scenario (N : Node_Id) return Boolean is begin @@ -2179,6 +2187,14 @@ package body Sinfo is return Flag5 (N); end Is_Task_Master; + function Is_Write + (N : Node_Id) return Boolean is + begin + pragma Assert (False + or else NT (N).Nkind = N_Variable_Reference_Marker); + return Flag2 (N); + end Is_Write; + function Iteration_Scheme (N : Node_Id) return Node_Id is begin @@ -3277,7 +3293,8 @@ package body Sinfo is (N : Node_Id) return Entity_Id is begin pragma Assert (False - or else NT (N).Nkind = N_Call_Marker); + or else NT (N).Nkind = N_Call_Marker + or else NT (N).Nkind = N_Variable_Reference_Marker); return Node1 (N); end Target; @@ -5512,6 +5529,14 @@ package body Sinfo is Set_Flag4 (N, Val); end Set_Is_Qualified_Universal_Literal; + procedure Set_Is_Read + (N : Node_Id; Val : Boolean := True) is + begin + pragma Assert (False + or else NT (N).Nkind = N_Variable_Reference_Marker); + Set_Flag1 (N, Val); + end Set_Is_Read; + procedure Set_Is_Recorded_Scenario (N : Node_Id; Val : Boolean := True) is begin @@ -5601,6 +5626,14 @@ package body Sinfo is Set_Flag5 (N, Val); end Set_Is_Task_Master; + procedure Set_Is_Write + (N : Node_Id; Val : Boolean := True) is + begin + pragma Assert (False + or else NT (N).Nkind = N_Variable_Reference_Marker); + Set_Flag2 (N, Val); + end Set_Is_Write; + procedure Set_Iteration_Scheme (N : Node_Id; Val : Node_Id) is begin @@ -6699,7 +6732,8 @@ package body Sinfo is (N : Node_Id; Val : Entity_Id) is begin pragma Assert (False - or else NT (N).Nkind = N_Call_Marker); + or else NT (N).Nkind = N_Call_Marker + or else NT (N).Nkind = N_Variable_Reference_Marker); Set_Node1 (N, Val); -- semantic field, no parent set end Set_Target; -- cgit v1.2.1 From 54a4cafdfd9ca8df94c3a49c87f77e466f8c2823 Mon Sep 17 00:00:00 2001 From: pmderodat Date: Thu, 9 Nov 2017 11:13:49 +0000 Subject: gcc/ada/ 2017-11-09 Arnaud Charlet * gnat1drv.adb (Adjust_Global_Switches): Suppress warnings in codepeer mode here unless -gnateC is specified. * switch-c.adb (Scan_Front_End_Switches): Do not suppress warnings with -gnatC here. 2017-11-09 Piotr Trojanek * lib-writ.adb (Write_ALI): Remove processing of the frontend xrefs as part of the ALI writing; they are now processed directly from memory when requested by the backend. * lib-xref.ads (Collect_SPARK_Xrefs): Remove. (Iterate_SPARK_Xrefs): New routine for iterating over frontend xrefs. * lib-xref-spark_specific.adb (Traverse_Compilation_Unit): Remove. (Add_SPARK_File): Remove. (Add_SPARK_Xref): Refactored from removed code; filters xref entries that are trivially uninteresting to the SPARK backend. * spark_xrefs.ads: Remove code that is no longer needed. * spark_xrefs.adb (dspark): Adapt to use Iterate_SPARK_Xrefs. 2017-11-09 Hristian Kirtchev * sem_elab.adb: Update the documentation on adding a new elaboration schenario. Add new hash table Recorded_Top_Level_Scenarios. (Is_Check_Emitting_Scenario): Removed. (Is_Recorded_Top_Level_Scenario): New routine. (Kill_Elaboration_Scenario): Reimplemented. (Record_Elaboration_Scenario): Mark the scenario as recorded. (Set_Is_Recorded_Top_Level_Scenario): New routine. (Update_Elaboration_Scenario): Reimplemented. * sinfo.adb (Is_Recorded_Scenario): Removed. (Set_Is_Recorded_Scenario): Removed. * sinfo.ads: Remove attribute Is_Recorded_Scenario along with occurrences in nodes. (Is_Recorded_Scenario): Removed along with pragma Inline. (Set_Is_Recorded_Scenario): Removed along with pragma Inline. 2017-11-09 Piotr Trojanek * sem_prag.adb (Analyze_Part_Of): Change "designate" to "denote" in error message. 2017-11-09 Justin Squirek * sem_res.adb (Resolve_Allocator): Add warning messages corresponding to the allocation of an anonymous access-to-controlled object. gcc/testsuite/ 2017-11-09 Hristian Kirtchev * gnat.dg/elab3.adb, gnat.dg/elab3.ads, gnat.dg/elab3_pkg.adb, gnat.dg/elab3_pkg.ads: New testcase. 2017-11-09 Pierre-Marie de Rodat * gnat.dg/controlled2.adb, gnat.dg/controlled4.adb, gnat.dg/finalized.adb: Disable the new warning from GNAT. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254568 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/sinfo.adb | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'gcc/ada/sinfo.adb') diff --git a/gcc/ada/sinfo.adb b/gcc/ada/sinfo.adb index 5514291bb34..20ff3b26557 100644 --- a/gcc/ada/sinfo.adb +++ b/gcc/ada/sinfo.adb @@ -2098,17 +2098,6 @@ package body Sinfo is return Flag1 (N); end Is_Read; - function Is_Recorded_Scenario - (N : Node_Id) return Boolean is - begin - pragma Assert (False - or else NT (N).Nkind = N_Call_Marker - or else NT (N).Nkind = N_Function_Instantiation - or else NT (N).Nkind = N_Package_Instantiation - or else NT (N).Nkind = N_Procedure_Instantiation); - return Flag6 (N); - end Is_Recorded_Scenario; - function Is_Source_Call (N : Node_Id) return Boolean is begin @@ -5537,17 +5526,6 @@ package body Sinfo is Set_Flag1 (N, Val); end Set_Is_Read; - procedure Set_Is_Recorded_Scenario - (N : Node_Id; Val : Boolean := True) is - begin - pragma Assert (False - or else NT (N).Nkind = N_Call_Marker - or else NT (N).Nkind = N_Function_Instantiation - or else NT (N).Nkind = N_Package_Instantiation - or else NT (N).Nkind = N_Procedure_Instantiation); - Set_Flag6 (N, Val); - end Set_Is_Recorded_Scenario; - procedure Set_Is_Source_Call (N : Node_Id; Val : Boolean := True) is begin -- cgit v1.2.1