Commit 49934177 by Gary Dismukes Committed by Arnaud Charlet

layout.adb (Layout_Type): In the case of access-to-subprogram types...

2007-08-14  Gary Dismukes  <dismukes@adacore.com>

	* layout.adb (Layout_Type): In the case of access-to-subprogram types,
	if AAMP_On_Target is True, then the size of the type encompasses two
	addresses (a static link and a subprogram address), except in the case
	of library-level access types.

From-SVN: r127455
parent 6812b99b
...@@ -2373,6 +2373,19 @@ package body Layout is ...@@ -2373,6 +2373,19 @@ package body Layout is
"correspond to C pointer", E); "correspond to C pointer", E);
end if; end if;
-- When the target is AAMP, access-to-subprogram types are fat
-- pointers consisting of the subprogram address and a static
-- link (with the exception of library-level access types,
-- where a simple subprogram address is used).
elsif AAMP_On_Target
and then
(Ekind (E) = E_Anonymous_Access_Subprogram_Type
or else (Ekind (E) = E_Access_Subprogram_Type
and then Present (Enclosing_Subprogram (E))))
then
Init_Size (E, 2 * System_Address_Size);
else else
Init_Size (E, System_Address_Size); Init_Size (E, System_Address_Size);
end if; end if;
...@@ -3084,7 +3097,7 @@ package body Layout is ...@@ -3084,7 +3097,7 @@ package body Layout is
Handled_Statement_Sequence => Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc, Make_Handled_Sequence_Of_Statements (Loc,
Statements => New_List ( Statements => New_List (
Make_Return_Statement (Loc, Make_Simple_Return_Statement (Loc,
Expression => Expr)))); Expression => Expr))));
-- The caller requests that the expression be encapsulated in -- The caller requests that the expression be encapsulated in
...@@ -3106,7 +3119,7 @@ package body Layout is ...@@ -3106,7 +3119,7 @@ package body Layout is
Handled_Statement_Sequence => Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc, Make_Handled_Sequence_Of_Statements (Loc,
Statements => New_List ( Statements => New_List (
Make_Return_Statement (Loc, Expression => Expr)))); Make_Simple_Return_Statement (Loc, Expression => Expr))));
-- No reference to V and function not requested, so create a constant -- No reference to V and function not requested, so create a constant
......
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