diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-08-14 08:48:36 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-08-14 08:48:36 +0000 |
commit | 545c2c196a6a31ee9d5a831e16e55bb5e2cf072c (patch) | |
tree | 4ff1df77a957d6fa0797933f264656e3ee411144 /gcc/ada/layout.adb | |
parent | 3355b3b1f288c4f896f12cb973ec1926aee8bb55 (diff) | |
download | gcc-545c2c196a6a31ee9d5a831e16e55bb5e2cf072c.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127455 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/layout.adb')
-rw-r--r-- | gcc/ada/layout.adb | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/gcc/ada/layout.adb b/gcc/ada/layout.adb index faff2d5edc0..baafca0ca52 100644 --- a/gcc/ada/layout.adb +++ b/gcc/ada/layout.adb @@ -2373,6 +2373,19 @@ package body Layout is "correspond to C pointer", E); 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 Init_Size (E, System_Address_Size); end if; @@ -3084,7 +3097,7 @@ package body Layout is Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, Statements => New_List ( - Make_Return_Statement (Loc, + Make_Simple_Return_Statement (Loc, Expression => Expr)))); -- The caller requests that the expression be encapsulated in @@ -3106,7 +3119,7 @@ package body Layout is Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, 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 |