diff options
author | Richard Kenner <kenner@adacore.com> | 2020-05-04 09:47:30 -0400 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-07-06 07:34:59 -0400 |
commit | 3e6bb105d309430c6a96caaa9c0693cad935a09a (patch) | |
tree | a63f5109e627c44d8efd8f646c880a2c3d5c8d11 /gcc | |
parent | f5b65fab88022c4dcfaa9020ecbc7719e92ca53a (diff) | |
download | gcc-3e6bb105d309430c6a96caaa9c0693cad935a09a.zip gcc-3e6bb105d309430c6a96caaa9c0693cad935a09a.tar.gz gcc-3e6bb105d309430c6a96caaa9c0693cad935a09a.tar.bz2 |
[Ada] Refine use of access types in unnesting
gcc/ada/
* exp_unst.adb (Needs_Fat_Pointer): Don't check for formal.
(Unnest_Subprogram): Use 'Unchecked_Access instead of 'Access
when populating activation record.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/exp_unst.adb | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb index c922300..e530a94 100644 --- a/gcc/ada/exp_unst.adb +++ b/gcc/ada/exp_unst.adb @@ -251,18 +251,14 @@ package body Exp_Unst is ----------------------- function Needs_Fat_Pointer (E : Entity_Id) return Boolean is - Typ : Entity_Id; - begin - if Is_Formal (E) then - Typ := Etype (E); - if Is_Private_Type (Typ) and then Present (Full_View (Typ)) then - Typ := Full_View (Typ); - end if; + Typ : Entity_Id := Etype (E); - return Is_Array_Type (Typ) and then not Is_Constrained (Typ); - else - return False; + begin + if Is_Private_Type (Typ) and then Present (Full_View (Typ)) then + Typ := Full_View (Typ); end if; + + return Is_Array_Type (Typ) and then not Is_Constrained (Typ); end Needs_Fat_Pointer; ---------------- @@ -2084,7 +2080,7 @@ package body Exp_Unst is -- or else 'Access for unconstrained array if Needs_Fat_Pointer (Ent) then - Attr := Name_Access; + Attr := Name_Unchecked_Access; else Attr := Name_Address; end if; |