Commit 1399d355 by Arnaud Charlet

[multiple changes]

2014-07-30  Bob Duff  <duff@adacore.com>

	* exp_ch6.adb (Add_Task_Actuals_To_Build_In_Place_Call): New
	parameter Chain to be used in the allocator case.
	(Make_Build_In_Place_Call_In_Allocator): If the allocated object
	has tasks, wrap the code in a block that will activate them,
	including the usual finalization code to kill them off in case
	of exception or abort.

2014-07-30  Robert Dewar  <dewar@adacore.com>

	* treepr.adb, treepr.ads; Reorganize documentation for new pp routines
	Remove renamings (don't work for gdb).
	(par): New synonym for p (avoid gdb ambiguities).
	* inline.adb, sem_ch6.adb, sem_ch13.adb: Minor reformatting.

From-SVN: r213249
parent 6be44a9a
2014-07-30 Bob Duff <duff@adacore.com>
* exp_ch6.adb (Add_Task_Actuals_To_Build_In_Place_Call): New
parameter Chain to be used in the allocator case.
(Make_Build_In_Place_Call_In_Allocator): If the allocated object
has tasks, wrap the code in a block that will activate them,
including the usual finalization code to kill them off in case
of exception or abort.
2014-07-30 Robert Dewar <dewar@adacore.com>
* treepr.adb, treepr.ads; Reorganize documentation for new pp routines
Remove renamings (don't work for gdb).
(par): New synonym for p (avoid gdb ambiguities).
* inline.adb, sem_ch6.adb, sem_ch13.adb: Minor reformatting.
2014-07-30 Bob Duff <duff@adacore.com>
* exp_ch9.ads, sem_prag.adb, exp_ch4.adb, sem_ch13.adb: Minor comment
fixes.
* treepr.ads, treepr.adb (ppp): Make this debugging routine
......
......@@ -1490,12 +1490,11 @@ package body Inline is
function Has_Some_Contract (Id : Entity_Id) return Boolean is
Items : constant Node_Id := Contract (Id);
begin
return Present (Items)
and then (Present (Pre_Post_Conditions (Items))
or else Present (Contract_Test_Cases (Items))
or else Present (Classifications (Items)));
and then (Present (Pre_Post_Conditions (Items)) or else
Present (Contract_Test_Cases (Items)) or else
Present (Classifications (Items)));
end Has_Some_Contract;
--------------------------
......@@ -1559,6 +1558,10 @@ package body Inline is
Id := Body_Id;
end if;
-- General note. The following comments clearly say what cannot be
-- inlined, but they do not give any clue on the motivation for the
-- exclusion. It would be good to document the motivations ???
-- Do not inline unit-level subprograms
if Nkind (Parent (Id)) = N_Defining_Program_Unit_Name then
......@@ -1588,6 +1591,8 @@ package body Inline is
then
return False;
-- Do not inline generic subprogram instances
elsif Is_Generic_Instance (Spec_Id) then
return False;
......
......@@ -2013,7 +2013,6 @@ package body Sem_Ch13 is
declare
Discard : Entity_Id;
pragma Warnings (Off, Discard);
begin
if Restricted_Profile then
Discard := RTE (RE_Activate_Restricted_Tasks);
......
......@@ -2169,7 +2169,7 @@ package body Sem_Ch6 is
function Body_Has_Contract return Boolean;
-- Check whether unanalyzed body has an aspect or pragma that may
-- generate a SPARK contrac.
-- generate a SPARK contract.
procedure Check_Anonymous_Return;
-- Ada 2005: if a function returns an access type that denotes a task,
......@@ -2363,13 +2363,13 @@ package body Sem_Ch6 is
while Present (A_Spec) loop
A := Get_Aspect_Id (Chars (Identifier (A_Spec)));
if A = Aspect_Contract_Cases
or else A = Aspect_Depends
or else A = Aspect_Global
or else A = Aspect_Pre
or else A = Aspect_Precondition
or else A = Aspect_Post
or else A = Aspect_Postcondition
if A = Aspect_Contract_Cases or else
A = Aspect_Depends or else
A = Aspect_Global or else
A = Aspect_Pre or else
A = Aspect_Precondition or else
A = Aspect_Post or else
A = Aspect_Postcondition
then
return True;
end if;
......@@ -2378,7 +2378,7 @@ package body Sem_Ch6 is
end loop;
end if;
-- Check for pragmas that may generate a contract.
-- Check for pragmas that may generate a contract
if Present (Decls) then
Decl := First (Decls);
......@@ -2386,13 +2386,13 @@ package body Sem_Ch6 is
if Nkind (Decl) = N_Pragma then
P_Id := Get_Pragma_Id (Pragma_Name (Decl));
if P_Id = Pragma_Contract_Cases
or else P_Id = Pragma_Depends
or else P_Id = Pragma_Global
or else P_Id = Pragma_Pre
or else P_Id = Pragma_Precondition
or else P_Id = Pragma_Post
or else P_Id = Pragma_Postcondition
if P_Id = Pragma_Contract_Cases or else
P_Id = Pragma_Depends or else
P_Id = Pragma_Global or else
P_Id = Pragma_Pre or else
P_Id = Pragma_Precondition or else
P_Id = Pragma_Post or else
P_Id = Pragma_Postcondition
then
return True;
end if;
......
......@@ -236,6 +236,18 @@ package body Treepr is
end case;
end p;
---------
-- par --
---------
function par (N : Union_Id) return Node_Or_Entity_Id renames p;
--------
-- pe --
--------
procedure pe (N : Union_Id) renames pn;
--------
-- pl --
--------
......@@ -314,6 +326,18 @@ package body Treepr is
end case;
end pn;
--------
-- pp --
--------
procedure pp (N : Union_Id) renames pn;
---------
-- ppp --
---------
procedure ppp (N : Union_Id) renames pt;
----------------
-- Print_Char --
----------------
......
......@@ -60,22 +60,33 @@ package Treepr is
-- Prints the subtree consisting of the given element list and all its
-- referenced descendants.
-- The following debugging procedures are intended to be called from gdb
-- The following debugging procedures are intended to be called from gdb.
-- Note that in several cases there are synonyms which represent historical
-- development, and we keep them because some people are used to them!
function p (N : Union_Id) return Node_Or_Entity_Id;
function par (N : Union_Id) return Node_Or_Entity_Id;
pragma Export (Ada, p);
-- Returns parent of a list or node (depending on the value of N). If N
pragma Export (Ada, par);
-- Return parent of a list or node (depending on the value of N). If N
-- is neither a list nor a node id, then prints a message to that effect
-- and returns Empty.
procedure pn (N : Union_Id);
-- Prints a node, node list, uint, or anything else that falls under
procedure pp (N : Union_Id);
procedure pe (N : Union_Id);
pragma Export (Ada, pn);
pragma Export (Ada, pp);
pragma Export (Ada, pe);
-- Print a node, node list, uint, or anything else that falls under
-- the definition of Union_Id. Historically this was only for printing
-- nodes, hence the name.
procedure pt (N : Union_Id);
procedure ppp (N : Union_Id);
pragma Export (Ada, pt);
-- Same as pn, except prints subtrees. For Nodes, it is exactly the same
pragma Export (Ada, ppp);
-- Same as pn/pp, except prints subtrees. For Nodes, it is exactly the same
-- as Print_Node_Subtree. For Elists it is the same as Print_Elist_Subtree.
-- For Lists, it is the same as Print_Tree_List. If given anything other
-- than a Node, List, or Elist, same effect as pn.
......@@ -87,9 +98,4 @@ package Treepr is
-- on the left and add a minus sign. This just saves some typing in the
-- debugger.
procedure pe (N : Union_Id) renames pt;
procedure pp (N : Union_Id) renames pn;
procedure ppp (N : Union_Id) renames pt;
-- Synonyms retained for historical reasons
end Treepr;
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