2011-08-05 Emmanuel Briot <briot@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Aug 2011 13:48:46 +0000 (13:48 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Aug 2011 13:48:46 +0000 (13:48 +0000)
* projects.texi: Added reference to the Makefile package.

2011-08-05  Thomas Quinot  <quinot@adacore.com>

* exp_ch7.adb: Minor comment rewording.

2011-08-05  Ed Falis  <falis@adacore.com>

* env.c: Fix comment.

2011-08-05  Hristian Kirtchev  <kirtchev@adacore.com>

* sem_elab.adb (Is_Finalization_Procedure): Reimplemented to avoid
character comparison and rely on concrete entities instead.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177435 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/env.c
gcc/ada/exp_ch7.adb
gcc/ada/projects.texi
gcc/ada/sem_elab.adb

index 2ee5591..ecbcadc 100644 (file)
@@ -1,3 +1,20 @@
+2011-08-05  Emmanuel Briot  <briot@adacore.com>
+
+       * projects.texi: Added reference to the Makefile package.
+
+2011-08-05  Thomas Quinot  <quinot@adacore.com>
+
+       * exp_ch7.adb: Minor comment rewording.
+
+2011-08-05  Ed Falis  <falis@adacore.com>
+
+       * env.c: Fix comment.
+
+2011-08-05  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * sem_elab.adb (Is_Finalization_Procedure): Reimplemented to avoid
+       character comparison and rely on concrete entities instead.
+
 2011-08-05  Ed Schonberg  <schonberg@adacore.com>
 
        * sem_ch3.adb: (Check_Private_Overriding): better error message,
index 9d7301f..1719684 100644 (file)
@@ -63,7 +63,7 @@ extern "C" {
   #elif defined (VTHREADS)
     /* VTHREADS mode applies to both VxWorks 653 and VxWorks MILS. The
        inclusion of vThreadsData.h is necessary to workaround a bug with
-       envLib.h on VxWorks MILS.  */
+       envLib.h on VxWorks MILS and VxWorks 653.  */
     #include <vThreadsData.h>
     #include <envLib.h>
   #else
index 735f865..a537e60 100644 (file)
@@ -2272,7 +2272,7 @@ package body Exp_Ch7 is
 
             function Next_Suitable_Statement (Stmt : Node_Id) return Node_Id;
             --  Given a statement which is part of a list, return the next
-            --  real statement while skipping over generated checks.
+            --  real statement while skipping over dynamic elab checks.
 
             ------------------
             -- Is_Init_Call --
index 4603a4f..2a3e5bc 100644 (file)
@@ -2871,6 +2871,10 @@ The following packages are currently supported in project files
 @item Linker
   This package specifies the options used by the linker.
   @xref{Main Subprograms}.
+@item Makefile
+@cindex Makefile package in projects
+  This package is used by the GPS plugin Makefile.py. See the documentation
+  in that plugin (from GPS: /Tools/Plug-ins).
 @item Metrics
   This package specifies the options used when calling the tool
   @command{gnatmetric} via the @command{gnat} driver. Its attributes
index a5130c1..fab5370 100644 (file)
@@ -2938,13 +2938,45 @@ package body Sem_Elab is
 
    function Is_Finalization_Procedure (Id : Entity_Id) return Boolean is
    begin
-      return
-        Ekind (Id) = E_Procedure
-          and then
-            (Chars (Id) = Name_Finalize
-               or else Is_TSS (Id, TSS_Deep_Finalize))
-          and then Present (First_Formal (Id))
-          and then Needs_Finalization (Etype (First_Formal (Id)));
+      --  Check whether Id is a procedure with at least one parameter
+
+      if Ekind (Id) = E_Procedure
+        and then Present (First_Formal (Id))
+      then
+         declare
+            Typ      : constant Entity_Id := Etype (First_Formal (Id));
+            Deep_Fin : Entity_Id := Empty;
+            Fin      : Entity_Id := Empty;
+
+         begin
+            --  If the type of the first formal does not require finalization
+            --  actions, then this is definitely not [Deep_]Finalize.
+
+            if not Needs_Finalization (Typ) then
+               return False;
+            end if;
+
+            --  At this point we have the following scenario:
+
+            --    procedure Name (Param1 : [in] [out] Ctrl[; Param2 : ...]);
+
+            --  Recover the two possible versions of [Deep_]Finalize using the
+            --  type of the first parameter and compare with the input.
+
+            Deep_Fin := TSS (Typ, TSS_Deep_Finalize);
+
+            if Is_Controlled (Typ) then
+               Fin := Find_Prim_Op (Typ, Name_Finalize);
+            end if;
+
+            return
+                (Present (Deep_Fin) and then Id = Deep_Fin)
+              or else
+                (Present (Fin) and then Id = Fin);
+         end;
+      end if;
+
+      return False;
    end Is_Finalization_Procedure;
 
    ------------------