Commit b8a93198 by Arnaud Charlet

[multiple changes]

2011-09-06  Steve Baird  <baird@adacore.com>

	* einfo.ads (Extra_Accessibility): Update associated comment to use
	the term "present" correctly ("present" just means that it is not
	an error to query the value of the attribute - it does not imply
	that the value must be non-null).
	(Extra_Constrained): Ditto.
	(Is_Visible_Formal): Ditto.
	(Extra_Accessibility_Of_Result) Ditto; also add Inline pragma.
	(Set_Extra_Accessibility_Of_Result): Add Inline pragma.
	* exp_ch4.adb (Expand_Allocator_Expression): Improve a comment.
	* exp_ch6.adb (Expand_Call): The callee may require an
	Extra_Accessibility_Of_Result actual parameter even if Ada_Version
	< Ada_2012. This can occur if the callee is exported from a Gnat
	runtimes unit. Also improve a comment.

2011-09-06  Hristian Kirtchev  <kirtchev@adacore.com>

	* exp_ch7.adb: Add with and use clauses for Get_Targ.
	(Alignment_Of): Rename formal parameter Some_Typ
	to Typ, update related comment. Use the allocator alignment on
	strict alignment targets such as SPARC.
	(Double_Alignment_Of): Rename formal parameter Some_Typ to Typ, update
	related comment.

2011-09-06  Gary Dismukes  <dismukes@adacore.com>

	* sem_ch9.adb (Check_Interfaces): Test
	Is_Limited_Type rather than Is_Limited_Record when checking that
	the partial view of a synchronized full view must be limited.

2011-09-06  Emmanuel Briot  <briot@adacore.com>

	* g-comlin.adb (Free): Fix memory leak.

From-SVN: r178569
parent ebf494ec
2011-09-06 Steve Baird <baird@adacore.com>
* einfo.ads (Extra_Accessibility): Update associated comment to use
the term "present" correctly ("present" just means that it is not
an error to query the value of the attribute - it does not imply
that the value must be non-null).
(Extra_Constrained): Ditto.
(Is_Visible_Formal): Ditto.
(Extra_Accessibility_Of_Result) Ditto; also add Inline pragma.
(Set_Extra_Accessibility_Of_Result): Add Inline pragma.
* exp_ch4.adb (Expand_Allocator_Expression): Improve a comment.
* exp_ch6.adb (Expand_Call): The callee may require an
Extra_Accessibility_Of_Result actual parameter even if Ada_Version
< Ada_2012. This can occur if the callee is exported from a Gnat
runtimes unit. Also improve a comment.
2011-09-06 Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch7.adb: Add with and use clauses for Get_Targ.
(Alignment_Of): Rename formal parameter Some_Typ
to Typ, update related comment. Use the allocator alignment on
strict alignment targets such as SPARC.
(Double_Alignment_Of): Rename formal parameter Some_Typ to Typ, update
related comment.
2011-09-06 Gary Dismukes <dismukes@adacore.com>
* sem_ch9.adb (Check_Interfaces): Test
Is_Limited_Type rather than Is_Limited_Record when checking that
the partial view of a synchronized full view must be limited.
2011-09-06 Emmanuel Briot <briot@adacore.com>
* g-comlin.adb (Free): Fix memory leak.
2011-09-06 Robert Dewar <dewar@adacore.com> 2011-09-06 Robert Dewar <dewar@adacore.com>
* sem_util.adb, exp_ch6.adb: Minor reformatting and code reorganization. * sem_util.adb, exp_ch6.adb: Minor reformatting and code reorganization.
......
...@@ -1120,9 +1120,9 @@ package Einfo is ...@@ -1120,9 +1120,9 @@ package Einfo is
-- or entry. Returns Empty if there are no extra formals. -- or entry. Returns Empty if there are no extra formals.
-- Extra_Accessibility (Node13) -- Extra_Accessibility (Node13)
-- Present in formal parameters in the non-generic case if expansion is -- Present in formal parameters in the non-generic case. Normally Empty,
-- active. Normally Empty, but if a parameter is one for which a dynamic -- but if expansion is active, and a parameter is one for which a
-- accessibility check is required, then an extra formal of type -- dynamic accessibility check is required, then an extra formal of type
-- Natural is created (see description of field Extra_Formal), and the -- Natural is created (see description of field Extra_Formal), and the
-- Extra_Accessibility field of the formal parameter points to the entity -- Extra_Accessibility field of the formal parameter points to the entity
-- for this extra formal. Also present in variables when compiling -- for this extra formal. Also present in variables when compiling
...@@ -1133,16 +1133,16 @@ package Einfo is ...@@ -1133,16 +1133,16 @@ package Einfo is
-- Extra_Accessibility_Of_Result (Node19) -- Extra_Accessibility_Of_Result (Node19)
-- Present in (non-generic) Function, Operator, and Subprogram_Type -- Present in (non-generic) Function, Operator, and Subprogram_Type
-- entities if expansion is active. Normally Empty, but if a function is -- entities. Normally Empty, but if expansion is active, and a function
-- one for which "the accessibility level of the result ... determined -- is one for which "the accessibility level of the result ... determined
-- by the point of call" (AI05-0234) is needed, then an extra formal of -- by the point of call" (AI05-0234) is needed, then an extra formal of
-- subtype Natural is created (see description of field Extra_Formal), -- subtype Natural is created (see description of field Extra_Formal),
-- and the Extra_Accessibility_Of_Result field of the function points to -- and the Extra_Accessibility_Of_Result field of the function points to
-- the entity for this extra formal. -- the entity for this extra formal.
-- Extra_Constrained (Node23) -- Extra_Constrained (Node23)
-- Present in formal parameters in the non-generic case if expansion is -- Present in formal parameters in the non-generic case. Normally Empty,
-- active. Normally Empty, but if a parameter is one for which a dynamic -- but if expansion is active and a parameter is one for which a dynamic
-- indication of its constrained status is required, then an extra formal -- indication of its constrained status is required, then an extra formal
-- of type Boolean is created (see description of field Extra_Formal), -- of type Boolean is created (see description of field Extra_Formal),
-- and the Extra_Constrained field of the formal parameter points to the -- and the Extra_Constrained field of the formal parameter points to the
...@@ -2853,11 +2853,10 @@ package Einfo is ...@@ -2853,11 +2853,10 @@ package Einfo is
-- visible by selected notation, or not. -- visible by selected notation, or not.
-- Is_Visible_Formal (Flag206) -- Is_Visible_Formal (Flag206)
-- Present in all entities. Set for instances of the formals of a formal -- Present in all entities. Set True for instances of the formals of a
-- package. Indicates that the entity must be made visible in the body -- formal package. Indicates that the entity must be made visible in the
-- of the instance, to reproduce the visibility of the generic. This -- body of the instance, to reproduce the visibility of the generic.
-- simplifies visibility settings in instance bodies. -- This simplifies visibility settings in instance bodies.
-- ??? confusion in above comments between being present and being set
-- Is_VMS_Exception (Flag133) -- Is_VMS_Exception (Flag133)
-- Present in all entities. Set only for exception entities where the -- Present in all entities. Set only for exception entities where the
...@@ -7373,6 +7372,7 @@ package Einfo is ...@@ -7373,6 +7372,7 @@ package Einfo is
pragma Inline (Esize); pragma Inline (Esize);
pragma Inline (Exception_Code); pragma Inline (Exception_Code);
pragma Inline (Extra_Accessibility); pragma Inline (Extra_Accessibility);
pragma Inline (Extra_Accessibility_Of_Result);
pragma Inline (Extra_Constrained); pragma Inline (Extra_Constrained);
pragma Inline (Extra_Formal); pragma Inline (Extra_Formal);
pragma Inline (Extra_Formals); pragma Inline (Extra_Formals);
...@@ -7817,6 +7817,7 @@ package Einfo is ...@@ -7817,6 +7817,7 @@ package Einfo is
pragma Inline (Set_Esize); pragma Inline (Set_Esize);
pragma Inline (Set_Exception_Code); pragma Inline (Set_Exception_Code);
pragma Inline (Set_Extra_Accessibility); pragma Inline (Set_Extra_Accessibility);
pragma Inline (Set_Extra_Accessibility_Of_Result);
pragma Inline (Set_Extra_Constrained); pragma Inline (Set_Extra_Constrained);
pragma Inline (Set_Extra_Formal); pragma Inline (Set_Extra_Formal);
pragma Inline (Set_Extra_Formals); pragma Inline (Set_Extra_Formals);
......
...@@ -765,8 +765,6 @@ package body Exp_Ch4 is ...@@ -765,8 +765,6 @@ package body Exp_Ch4 is
-- Start of processing for Expand_Allocator_Expression -- Start of processing for Expand_Allocator_Expression
begin begin
-- Messy???
-- In the case of an Ada2012 allocator whose initial value comes from a -- In the case of an Ada2012 allocator whose initial value comes from a
-- function call, pass "the accessibility level determined by the point -- function call, pass "the accessibility level determined by the point
-- of call" (AI05-0234) to the function. Conceptually, this belongs in -- of call" (AI05-0234) to the function. Conceptually, this belongs in
......
...@@ -2753,8 +2753,7 @@ package body Exp_Ch6 is ...@@ -2753,8 +2753,7 @@ package body Exp_Ch6 is
-- "accessibility level determined by the point of call" (AI05-0234) -- "accessibility level determined by the point of call" (AI05-0234)
-- passed in to it, then pass it in. -- passed in to it, then pass it in.
if Ada_Version >= Ada_2012 if Ekind_In (Subp, E_Function, E_Operator, E_Subprogram_Type)
and then Ekind_In (Subp, E_Function, E_Operator, E_Subprogram_Type)
and then Present (Extra_Accessibility_Of_Result (Subp)) and then Present (Extra_Accessibility_Of_Result (Subp))
then then
declare declare
...@@ -2781,8 +2780,6 @@ package body Exp_Ch6 is ...@@ -2781,8 +2780,6 @@ package body Exp_Ch6 is
case Nkind (Ancestor) is case Nkind (Ancestor) is
when N_Allocator => when N_Allocator =>
-- Messy code, could use a cleanup???
-- At this point, we'd like to assign -- At this point, we'd like to assign
-- Level := Dynamic_Accessibility_Level (Ancestor); -- Level := Dynamic_Accessibility_Level (Ancestor);
......
...@@ -41,6 +41,7 @@ with Exp_Disp; use Exp_Disp; ...@@ -41,6 +41,7 @@ with Exp_Disp; use Exp_Disp;
with Exp_Tss; use Exp_Tss; with Exp_Tss; use Exp_Tss;
with Exp_Util; use Exp_Util; with Exp_Util; use Exp_Util;
with Freeze; use Freeze; with Freeze; use Freeze;
with Get_Targ; use Get_Targ;
with Lib; use Lib; with Lib; use Lib;
with Nlists; use Nlists; with Nlists; use Nlists;
with Nmake; use Nmake; with Nmake; use Nmake;
...@@ -7033,38 +7034,46 @@ package body Exp_Ch7 is ...@@ -7033,38 +7034,46 @@ package body Exp_Ch7 is
Desg_Typ : Entity_Id; Desg_Typ : Entity_Id;
Obj_Expr : Node_Id; Obj_Expr : Node_Id;
function Alignment_Of (Some_Typ : Entity_Id) return Node_Id; function Alignment_Of (Typ : Entity_Id) return Node_Id;
-- Subsidiary routine, generate the following attribute reference: -- Subsidiary routine, generate the following attribute reference:
-- --
-- Some_Typ'Alignment -- Typ'Alignment
function Double_Alignment_Of (Some_Typ : Entity_Id) return Node_Id; function Double_Alignment_Of (Typ : Entity_Id) return Node_Id;
-- Subsidiary routine, generate the following expression: -- Subsidiary routine, generate the following expression:
-- --
-- 2 * Some_Typ'Alignment -- 2 * Typ'Alignment
------------------ ------------------
-- Alignment_Of -- -- Alignment_Of --
------------------ ------------------
function Alignment_Of (Some_Typ : Entity_Id) return Node_Id is function Alignment_Of (Typ : Entity_Id) return Node_Id is
begin begin
return -- Strict alignment targets such as SPARC ignore the alignment of the
Make_Attribute_Reference (Loc, -- index type and use the system allocator alignment instead.
Prefix => New_Reference_To (Some_Typ, Loc),
Attribute_Name => Name_Alignment); if Target_Strict_Alignment then
return Make_Integer_Literal (Loc, Get_System_Allocator_Alignment);
else
return
Make_Attribute_Reference (Loc,
Prefix => New_Reference_To (Typ, Loc),
Attribute_Name => Name_Alignment);
end if;
end Alignment_Of; end Alignment_Of;
------------------------- -------------------------
-- Double_Alignment_Of -- -- Double_Alignment_Of --
------------------------- -------------------------
function Double_Alignment_Of (Some_Typ : Entity_Id) return Node_Id is function Double_Alignment_Of (Typ : Entity_Id) return Node_Id is
begin begin
return return
Make_Op_Multiply (Loc, Make_Op_Multiply (Loc,
Left_Opnd => Make_Integer_Literal (Loc, 2), Left_Opnd => Make_Integer_Literal (Loc, 2),
Right_Opnd => Alignment_Of (Some_Typ)); Right_Opnd => Alignment_Of (Typ));
end Double_Alignment_Of; end Double_Alignment_Of;
-- Start of processing for Make_Finalize_Address_Stmts -- Start of processing for Make_Finalize_Address_Stmts
......
...@@ -2982,6 +2982,7 @@ package body GNAT.Command_Line is ...@@ -2982,6 +2982,7 @@ package body GNAT.Command_Line is
Free (Config.Sections); Free (Config.Sections);
Free (Config.Usage); Free (Config.Usage);
Free (Config.Help); Free (Config.Help);
Free (Config.Help_Msg);
if Config.Aliases /= null then if Config.Aliases /= null then
for A in Config.Aliases'Range loop for A in Config.Aliases'Range loop
...@@ -3037,6 +3038,8 @@ package body GNAT.Command_Line is ...@@ -3037,6 +3038,8 @@ package body GNAT.Command_Line is
end if; end if;
Free (Config.Usage); Free (Config.Usage);
Free (Config.Help);
Free (Config.Help_Msg);
Config.Usage := new String'(Usage); Config.Usage := new String'(Usage);
Config.Help := new String'(Help); Config.Help := new String'(Help);
Config.Help_Msg := new String'(Help_Msg); Config.Help_Msg := new String'(Help_Msg);
......
...@@ -2381,7 +2381,7 @@ package body Sem_Ch9 is ...@@ -2381,7 +2381,7 @@ package body Sem_Ch9 is
-- declaration must be limited. -- declaration must be limited.
if Present (Interface_List (N)) if Present (Interface_List (N))
and then not Is_Limited_Record (Priv_T) and then not Is_Limited_Type (Priv_T)
then then
Error_Msg_Sloc := Sloc (Priv_T); Error_Msg_Sloc := Sloc (Priv_T);
Error_Msg_N ("(Ada 2005) limited type declaration expected for " & Error_Msg_N ("(Ada 2005) limited type declaration expected for " &
......
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