diff options
author | Gary Dismukes <dismukes@adacore.com> | 2007-08-14 10:48:36 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2007-08-14 10:48:36 +0200 |
commit | 4993417734d33d95cc9e41bf3db65b869331135e (patch) | |
tree | 4ff1df77a957d6fa0797933f264656e3ee411144 | |
parent | 6812b99bfefb741cadac6c5eba5a7446af820b62 (diff) | |
download | gcc-4993417734d33d95cc9e41bf3db65b869331135e.zip gcc-4993417734d33d95cc9e41bf3db65b869331135e.tar.gz gcc-4993417734d33d95cc9e41bf3db65b869331135e.tar.bz2 |
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
-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 faff2d5..baafca0 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 |