From 7324247364df0b8e4be9038eea1d8cfc032de677 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Fri, 5 Aug 2011 15:48:46 +0200 Subject: [PATCH] [multiple changes] 2011-08-05 Emmanuel Briot * projects.texi: Added reference to the Makefile package. 2011-08-05 Thomas Quinot * exp_ch7.adb: Minor comment rewording. 2011-08-05 Ed Falis * env.c: Fix comment. 2011-08-05 Hristian Kirtchev * sem_elab.adb (Is_Finalization_Procedure): Reimplemented to avoid character comparison and rely on concrete entities instead. From-SVN: r177435 --- gcc/ada/ChangeLog | 17 ++++++++++++++++ gcc/ada/env.c | 2 +- gcc/ada/exp_ch7.adb | 2 +- gcc/ada/projects.texi | 4 ++++ gcc/ada/sem_elab.adb | 46 ++++++++++++++++++++++++++++++++++++------- 5 files changed, 62 insertions(+), 9 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 2ee55914517..ecbcadc12fd 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,20 @@ +2011-08-05 Emmanuel Briot + + * projects.texi: Added reference to the Makefile package. + +2011-08-05 Thomas Quinot + + * exp_ch7.adb: Minor comment rewording. + +2011-08-05 Ed Falis + + * env.c: Fix comment. + +2011-08-05 Hristian Kirtchev + + * sem_elab.adb (Is_Finalization_Procedure): Reimplemented to avoid + character comparison and rely on concrete entities instead. + 2011-08-05 Ed Schonberg * sem_ch3.adb: (Check_Private_Overriding): better error message, diff --git a/gcc/ada/env.c b/gcc/ada/env.c index 9d7301f1828..1719684034a 100644 --- a/gcc/ada/env.c +++ b/gcc/ada/env.c @@ -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 #include #else diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index 735f86576a0..a537e603c35 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -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 -- diff --git a/gcc/ada/projects.texi b/gcc/ada/projects.texi index 4603a4f9df9..2a3e5bc0d8d 100644 --- a/gcc/ada/projects.texi +++ b/gcc/ada/projects.texi @@ -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 diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb index a5130c15936..fab5370074b 100644 --- a/gcc/ada/sem_elab.adb +++ b/gcc/ada/sem_elab.adb @@ -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; ------------------ -- 2.30.2