]> gcc.gnu.org Git - gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Tue, 12 Jun 2012 10:12:40 +0000 (12:12 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 12 Jun 2012 10:12:40 +0000 (12:12 +0200)
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

gcc/ada/ChangeLog
gcc/ada/exp_ch7.adb
gcc/ada/lib-xref.adb
gcc/ada/prj-attr.adb
gcc/ada/sem_ch10.adb
gcc/ada/sem_prag.adb
gcc/ada/sem_res.adb
gcc/ada/snames.ads-tmpl
gcc/ada/xref_lib.adb

index 7eab91e039b780ca34b8912954b0f5ff55e75bbd..8ffc81c6b8d8c4bebc28a6a219088f1982a6f7cd 100644 (file)
@@ -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
index 6c42ad6f826ea7ee3b86dee8edcaeef63b10eb41..f42cb814202692b0c4c68d2635e456273091ff1b 100644 (file)
@@ -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
index 66fd9e20e38ef4ab47fa48ec2eb2fbd4964f7d85..692752944ca73b8e26d73376285b3453cbd74c95 100644 (file)
@@ -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)));
index 8fefe66ae10874d2fe8b0433fee551d3a829c8bf..0321533fc18e2ce9caca1588385a607ccda4984e 100644 (file)
@@ -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#" &
index 11239f8f2331e118f64ac254d1eea1c7bc7a8ec3..be79b34b2729efdfad842d0a3885e2a5af405ab5 100644 (file)
@@ -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;
 
    --------
index 757ea700bb06ceb29b5cd7ae470a73be55901ec5..2b038fa51c9d7e4963d4d3308135d51097b5665c 100644 (file)
@@ -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
index 86805d6f92a5eb5fe192209ea80a6e3deee58855..b33cffef79c546ff09ba75c16bc6464d6b12188a 100644 (file)
@@ -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)));
index c402967e7330e8adf67fa1b0cac1c51c7f03ecef..b8e381520b72c58f0da5b263b86e209e1b85bb7a 100644 (file)
@@ -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 + $;
index 9db1643d51f36d2aae7d048155ba12aec5f6b635..4ff1cdc4fcfa375b784c4b76098a7c93bf448ccb 100644 (file)
@@ -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
This page took 0.089735 seconds and 5 git commands to generate.