+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,
#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
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 --
@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
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;
------------------