From 5c5828008385212c6abbc8df65fbc19bb0fd6f64 Mon Sep 17 00:00:00 2001 From: charlet Date: Wed, 5 Dec 2012 11:25:23 +0000 Subject: [PATCH] 2012-12-05 Robert Dewar * par_sco.adb, sem_prag.adb, put_scos.adb, get_scos.adb: Minor reformatting. 2012-12-05 Ed Schonberg * sem_ch3.adb: Code clean up. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194217 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/ChangeLog | 9 +++++++++ gcc/ada/get_scos.adb | 1 + gcc/ada/par_sco.adb | 1 + gcc/ada/put_scos.adb | 9 ++++----- gcc/ada/sem_ch3.adb | 28 +++++++++++++++++++++------- gcc/ada/sem_prag.adb | 5 ++++- 6 files changed, 40 insertions(+), 13 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 70410fb..2898d2c 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,12 @@ +2012-12-05 Robert Dewar + + * par_sco.adb, sem_prag.adb, put_scos.adb, get_scos.adb: Minor + reformatting. + +2012-12-05 Ed Schonberg + + * sem_ch3.adb: Code clean up. + 2012-12-05 Arnaud Charlet * gcc-interface/Make-lang.in: Update dependencies. diff --git a/gcc/ada/get_scos.adb b/gcc/ada/get_scos.adb index 0020bea..170f5b5 100644 --- a/gcc/ada/get_scos.adb +++ b/gcc/ada/get_scos.adb @@ -398,6 +398,7 @@ begin Name_Len := Name_Len + 1; Name_Buffer (Name_Len) := Getc; end loop; + Nam := Name_Find; else diff --git a/gcc/ada/par_sco.adb b/gcc/ada/par_sco.adb index 1149a2e..c2c522c 100644 --- a/gcc/ada/par_sco.adb +++ b/gcc/ada/par_sco.adb @@ -829,6 +829,7 @@ package body Par_SCO is SCO_Index := SCO_Index + 1; end loop; end if; + SCO_Index := SCO_Index + 1; end loop; diff --git a/gcc/ada/put_scos.adb b/gcc/ada/put_scos.adb index e9b03fc..de44c45 100644 --- a/gcc/ada/put_scos.adb +++ b/gcc/ada/put_scos.adb @@ -23,9 +23,9 @@ -- -- ------------------------------------------------------------------------------ -with Namet; use Namet; -with Opt; use Opt; -with SCOs; use SCOs; +with Namet; use Namet; +with Opt; use Opt; +with SCOs; use SCOs; procedure Put_SCOs is Current_SCO_Unit : SCO_Unit_Index := 0; @@ -250,8 +250,7 @@ begin loop declare - T : SCO_Table_Entry - renames SCO_Table.Table (Start); + T : SCO_Table_Entry renames SCO_Table.Table (Start); begin Write_Info_Char (' '); diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index ea4e4e9..5745746 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -1192,7 +1192,8 @@ package body Sem_Ch3 is -- In ASIS mode, the access_to_subprogram may be analyzed twice, -- when it is part of an unconstrained type and subtype expansion -- is disabled. To avoid back-end problems with shared profiles, - -- use previous subprogram type as the designated type. + -- use previous subprogram type as the designated type, and then + -- remove scope added above. if ASIS_Mode and then Present (Scope (Defining_Identifier (F))) @@ -1201,6 +1202,7 @@ package body Sem_Ch3 is Init_Size_Align (T_Name); Set_Directly_Designated_Type (T_Name, Scope (Defining_Identifier (F))); + End_Scope; return; end if; @@ -4993,10 +4995,20 @@ package body Sem_Ch3 is Scope_Stack.Table (Scope_Stack.Last); Anon : constant Entity_Id := Make_Temporary (Loc, 'S'); - Acc : Node_Id; + + Acc : Node_Id; + -- Access definition in declaration + Comp : Node_Id; + -- Object definition or formal definition with an access definition + Decl : Node_Id; - P : Node_Id; + -- Declaration of anonymous access to subprogram type + + Spec : Node_Id; + -- Original specification in access to subprogram + + P : Node_Id; begin Set_Is_Internal (Anon); @@ -5032,10 +5044,12 @@ package body Sem_Ch3 is raise Program_Error; end case; - Decl := Make_Full_Type_Declaration (Loc, - Defining_Identifier => Anon, - Type_Definition => - Copy_Separate_Tree (Access_To_Subprogram_Definition (Acc))); + Spec := Access_To_Subprogram_Definition (Acc); + + Decl := + Make_Full_Type_Declaration (Loc, + Defining_Identifier => Anon, + Type_Definition => Relocate_Node (Spec)); Mark_Rewrite_Insertion (Decl); diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 36251b8..b44df5a 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -1960,7 +1960,7 @@ package body Sem_Prag is if Nkind (Stmt) = N_Block_Statement then if (No (Declarations (Stmt)) - or else List_Containing (Prev) /= Declarations (Stmt)) + or else List_Containing (Prev) /= Declarations (Stmt)) and then List_Containing (Prev) /= Statements (Handled_Statement_Sequence (Stmt)) @@ -7013,6 +7013,9 @@ package body Sem_Prag is -- pragma Assume (boolean_EXPRESSION); + -- This should share pragma Assert code ??? + -- Run-time check is missing completely ??? + when Pragma_Assume => Assume : declare begin GNAT_Pragma; -- 2.7.4