Commit 73242473 by Arnaud Charlet

[multiple changes]

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.

From-SVN: r177435
parent 97ed5872
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,
......
......@@ -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
......
......@@ -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 --
......
......@@ -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
......
......@@ -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;
------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment