diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2012-06-12 12:12:40 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2012-06-12 12:12:40 +0200 |
commit | 3235dc87bf6bbe42b58a40f0d894283997e3100c (patch) | |
tree | 89eee6cf718fed8243d56f373857da26fb54ad6d /gcc/ada | |
parent | 83bb90af7af5df4179c85586409efe342d655b90 (diff) | |
download | gcc-3235dc87bf6bbe42b58a40f0d894283997e3100c.tar.gz |
[multiple changes]
2012-06-12 Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch7.adb (Create_Finalizer): Add the
exception reraise mechanism at the very end of the finalizer
statements. This placement ensures that all objects are finalized,
the secondary stack mark released and aborts undeferred before
propagating an exception.
2012-06-12 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Remove_Unit_From_Visibility): if the unit is a
wrapper package. remove from visibility the original subprogram
instance.
2012-06-12 Javier Miranda <miranda@adacore.com>
* sem_prag.adb (Process_Convention): Generate reference to entity
exported to foreign language. Needed for GPS navigation.
* xref_lib.adb (Parse_Identifier_Info): Parse exported entities.
* lib-xref (Output_References): Output exported entities.
2012-06-12 Pascal Obry <obry@adacore.com>
* prj-attr.adb: Add install package and corresponding attributes.
* snames.ads-tmpl (Name_Active): New constant.
(Name_Exec_Subdir): Likewise.
(Name_Install): Likewise.
(Name_Lib_Subdir): Likewise.
(Name_Project_Subdir): Likewise.
(Name_Sources_Subdir): Likewise.
2012-06-12 Bob Duff <duff@adacore.com>
* sem_res.adb (Check_Infinite_Recursion):
Suppress spurious warning on recursion after "raise with ...".
From-SVN: r188438
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 36 | ||||
-rw-r--r-- | gcc/ada/exp_ch7.adb | 31 | ||||
-rw-r--r-- | gcc/ada/lib-xref.adb | 12 | ||||
-rw-r--r-- | gcc/ada/prj-attr.adb | 10 | ||||
-rw-r--r-- | gcc/ada/sem_ch10.adb | 7 | ||||
-rw-r--r-- | gcc/ada/sem_prag.adb | 13 | ||||
-rw-r--r-- | gcc/ada/sem_res.adb | 6 | ||||
-rw-r--r-- | gcc/ada/snames.ads-tmpl | 6 | ||||
-rw-r--r-- | gcc/ada/xref_lib.adb | 7 |
9 files changed, 103 insertions, 25 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 7eab91e039b..8ffc81c6b8d 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,39 @@ +2012-06-12 Hristian Kirtchev <kirtchev@adacore.com> + + * exp_ch7.adb (Create_Finalizer): Add the + exception reraise mechanism at the very end of the finalizer + statements. This placement ensures that all objects are finalized, + the secondary stack mark released and aborts undeferred before + propagating an exception. + +2012-06-12 Ed Schonberg <schonberg@adacore.com> + + * sem_ch10.adb (Remove_Unit_From_Visibility): if the unit is a + wrapper package. remove from visibility the original subprogram + instance. + +2012-06-12 Javier Miranda <miranda@adacore.com> + + * sem_prag.adb (Process_Convention): Generate reference to entity + exported to foreign language. Needed for GPS navigation. + * xref_lib.adb (Parse_Identifier_Info): Parse exported entities. + * lib-xref (Output_References): Output exported entities. + +2012-06-12 Pascal Obry <obry@adacore.com> + + * prj-attr.adb: Add install package and corresponding attributes. + * snames.ads-tmpl (Name_Active): New constant. + (Name_Exec_Subdir): Likewise. + (Name_Install): Likewise. + (Name_Lib_Subdir): Likewise. + (Name_Project_Subdir): Likewise. + (Name_Sources_Subdir): Likewise. + +2012-06-12 Bob Duff <duff@adacore.com> + + * sem_res.adb (Check_Infinite_Recursion): + Suppress spurious warning on recursion after "raise with ...". + 2012-06-12 Thomas Quinot <quinot@adacore.com> * sem_prag.adb (Analyze_Pragma, case Unchecked_Union): Do diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index 6c42ad6f826..f42cb814202 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -1490,20 +1490,6 @@ package body Exp_Ch7 is Append_To (Finalizer_Stmts, Label); - -- The local exception does not need to be reraised for library- - -- level finalizers. Generate: - -- - -- if Raised and then not Abort then - -- Raise_From_Controlled_Operation (E); - -- end if; - - if not For_Package - and then Exceptions_OK - then - Append_To (Finalizer_Stmts, - Build_Raise_Statement (Finalizer_Data)); - end if; - -- Create the jump block which controls the finalization flow -- depending on the value of the state counter. @@ -1570,6 +1556,22 @@ package body Exp_Ch7 is Name => New_Reference_To (RTE (RE_Abort_Undefer), Loc))); end if; + -- The local exception does not need to be reraised for library-level + -- finalizers. Note that this action must be carried out after object + -- clean up, secondary stack release and abort undeferral. Generate: + + -- if Raised and then not Abort then + -- Raise_From_Controlled_Operation (E); + -- end if; + + if Has_Ctrl_Objs + and then Exceptions_OK + and then not For_Package + then + Append_To (Finalizer_Stmts, + Build_Raise_Statement (Finalizer_Data)); + end if; + -- Generate: -- procedure Fin_Id is -- Abort : constant Boolean := Triggered_By_Abort; @@ -1590,6 +1592,7 @@ package body Exp_Ch7 is -- <finalization statements> -- Added if Has_Ctrl_Objs -- <stack release> -- Added if Mark_Id exists -- Abort_Undefer; -- Added if abort is allowed + -- <exception propagation> -- Added if Has_Ctrl_Objs -- end Fin_Id; -- Create the body of the finalizer diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb index 66fd9e20e38..692752944ca 100644 --- a/gcc/ada/lib-xref.adb +++ b/gcc/ada/lib-xref.adb @@ -2441,11 +2441,13 @@ package body Lib.Xref is (Int (Get_Logical_Line_Number (XE.Key.Loc))); Write_Info_Char (XE.Key.Typ); - if Is_Overloadable (XE.Key.Ent) - and then Is_Imported (XE.Key.Ent) - and then XE.Key.Typ = 'b' - then - Output_Import_Export_Info (XE.Key.Ent); + if Is_Overloadable (XE.Key.Ent) then + if (Is_Imported (XE.Key.Ent) and then XE.Key.Typ = 'b') + or else + (Is_Exported (XE.Key.Ent) and then XE.Key.Typ = 'i') + then + Output_Import_Export_Info (XE.Key.Ent); + end if; end if; Write_Info_Nat (Int (Get_Column_Number (XE.Key.Loc))); diff --git a/gcc/ada/prj-attr.adb b/gcc/ada/prj-attr.adb index 8fefe66ae10..0321533fc18 100644 --- a/gcc/ada/prj-attr.adb +++ b/gcc/ada/prj-attr.adb @@ -351,6 +351,16 @@ package body Prj.Attr is "SVvcs_log_check#" & "SVdocumentation_dir#" & + -- package Install + + "Pinstall#" & + "SVprefix#" & + "SVsources_subdir#" & + "SVexec_subdir#" & + "SVlib_subdir#" & + "SVproject_subdir#" & + "SVactive#" & + -- package Stack "Pstack#" & diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb index 11239f8f233..be79b34b272 100644 --- a/gcc/ada/sem_ch10.adb +++ b/gcc/ada/sem_ch10.adb @@ -6211,6 +6211,13 @@ package body Sem_Ch10 is Set_Is_Potentially_Use_Visible (Unit_Name, False); Set_Is_Immediately_Visible (Unit_Name, False); + + -- If the unit is a wrapper package, the subprogram instance is + -- what must be removed from visibility. + + if Is_Wrapper_Package (Unit_Name) then + Set_Is_Immediately_Visible (Current_Entity (Unit_Name), False); + end if; end Remove_Unit_From_Visibility; -------- diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 757ea700bb0..2b038fa51c9 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -3655,10 +3655,21 @@ package body Sem_Prag is Comp_Unit := Get_Source_Unit (E); Set_Convention_From_Pragma (E); - -- Treat a pragma Import as an implicit body, for GPS use + -- Treat a pragma Import as an implicit body, and pragma import + -- as implicit reference (for navigation in GPS). if Prag_Id = Pragma_Import then Generate_Reference (E, Id, 'b'); + + -- For exported entities we restrict the generation of references + -- to entities exported to foreign languages since entities + -- exported to Ada do not provide further information to GPS and + -- add undesired references to the output of the gnatxref tool. + + elsif Prag_Id = Pragma_Export + and then Convention (E) /= Convention_Ada + then + Generate_Reference (E, Id, 'i'); end if; -- Loop through the homonyms of the pragma argument's entity diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 86805d6f92a..b33cffef79c 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -853,9 +853,11 @@ package body Sem_Res is Prev (Nod); end loop; - -- If no raise statement, give warning + -- If no raise statement, give warning. We look at the + -- original node, because in the case of "raise ... with + -- ...", the node has been transformed into a call. - exit when Nkind (Nod) /= N_Raise_Statement + exit when Nkind (Original_Node (Nod)) /= N_Raise_Statement and then (Nkind (Nod) not in N_Raise_xxx_Error or else Present (Condition (Nod))); diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl index c402967e733..b8e381520b7 100644 --- a/gcc/ada/snames.ads-tmpl +++ b/gcc/ada/snames.ads-tmpl @@ -1099,6 +1099,7 @@ package Snames is -- The names with the -- GB annotation are only used in gprbuild. + Name_Active : constant Name_Id := N + $; Name_Aggregate : constant Name_Id := N + $; Name_Archive_Builder : constant Name_Id := N + $; Name_Archive_Builder_Append_Option : constant Name_Id := N + $; @@ -1130,6 +1131,7 @@ package Snames is Name_Excluded_Source_Files : constant Name_Id := N + $; Name_Excluded_Source_List_File : constant Name_Id := N + $; Name_Exec_Dir : constant Name_Id := N + $; + Name_Exec_Subdir : constant Name_Id := N + $; Name_Executable : constant Name_Id := N + $; Name_Executable_Suffix : constant Name_Id := N + $; Name_Extends : constant Name_Id := N + $; @@ -1151,11 +1153,13 @@ package Snames is Name_Include_Path : constant Name_Id := N + $; Name_Include_Path_File : constant Name_Id := N + $; Name_Inherit_Source_Path : constant Name_Id := N + $; + Name_Install : constant Name_Id := N + $; Name_Languages : constant Name_Id := N + $; Name_Language_Kind : constant Name_Id := N + $; Name_Leading_Library_Options : constant Name_Id := N + $; Name_Leading_Required_Switches : constant Name_Id := N + $; Name_Leading_Switches : constant Name_Id := N + $; + Name_Lib_Subdir : constant Name_Id := N + $; Name_Library : constant Name_Id := N + $; Name_Library_Ali_Dir : constant Name_Id := N + $; Name_Library_Auto_Init : constant Name_Id := N + $; @@ -1216,6 +1220,7 @@ package Snames is Name_Project_Dir : constant Name_Id := N + $; Name_Project_Files : constant Name_Id := N + $; Name_Project_Path : constant Name_Id := N + $; + Name_Project_Subdir : constant Name_Id := N + $; Name_Response_File_Format : constant Name_Id := N + $; Name_Response_File_Switches : constant Name_Id := N + $; Name_Roots : constant Name_Id := N + $; -- GB @@ -1232,6 +1237,7 @@ package Snames is Name_Source_File_Switches : constant Name_Id := N + $; Name_Source_Files : constant Name_Id := N + $; Name_Source_List_File : constant Name_Id := N + $; + Name_Sources_Subdir : constant Name_Id := N + $; Name_Spec : constant Name_Id := N + $; Name_Spec_Suffix : constant Name_Id := N + $; Name_Specification : constant Name_Id := N + $; diff --git a/gcc/ada/xref_lib.adb b/gcc/ada/xref_lib.adb index 9db1643d51f..4ff1cdc4fcf 100644 --- a/gcc/ada/xref_lib.adb +++ b/gcc/ada/xref_lib.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2011, Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2012, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -1105,9 +1105,10 @@ package body Xref_Lib is -- Imported entities might special indication as to their external -- name: - -- 5U14*Foo2 5>20 6b<c,myfoo2>22 + -- 5U14*Foo2 5>20 6b<c,myfoo2>22 # Imported entity + -- 5U14*Foo2 5>20 6i<c,myfoo2>22 # Exported entity - if R_Type = 'b' + if (R_Type = 'b' or else R_Type = 'i') and then Ali (Ptr) = '<' then while Ptr <= Ali'Last |