From: Arnaud Charlet Date: Thu, 15 Dec 2011 11:52:26 +0000 (+0100) Subject: [multiple changes] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d9937d1b3ee90bab59ddc15be59bee877e09778e;p=gcc.git [multiple changes] 2011-12-15 Javier Miranda * exp_attr.adb (Expand_N_Attribute_Reference): For 'alignment applied to a class-wide type under VM targets generate code which invokes the function Get_Alignment to retrieve the value of the alignment from the TSD. * rtsfind.ads (RE_Get_Alignment): New entity. 2011-12-15 Robert Dewar * g-comlin.adb: Fix header. From-SVN: r182365 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 2e39fcc2c0d..d9e3eebfea2 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,15 @@ +2011-12-15 Javier Miranda + + * exp_attr.adb (Expand_N_Attribute_Reference): For 'alignment + applied to a class-wide type under VM targets generate code which + invokes the function Get_Alignment to retrieve the value of the + alignment from the TSD. + * rtsfind.ads (RE_Get_Alignment): New entity. + +2011-12-15 Robert Dewar + + * g-comlin.adb: Fix header. + 2011-12-15 Tristan Gingold * gnatls.adb: Fix typo. diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index 111dc8de02b..ef0e70b59b7 100644 --- a/gcc/ada/exp_attr.adb +++ b/gcc/ada/exp_attr.adb @@ -1120,10 +1120,18 @@ package body Exp_Attr is elsif Is_Class_Wide_Type (Ptyp) then New_Node := - Build_Get_Alignment (Loc, - Make_Attribute_Reference (Loc, - Prefix => Pref, - Attribute_Name => Name_Tag)); + Make_Attribute_Reference (Loc, + Prefix => Pref, + Attribute_Name => Name_Tag); + + if VM_Target = No_VM then + New_Node := Build_Get_Alignment (Loc, New_Node); + else + New_Node := + Make_Function_Call (Loc, + Name => New_Reference_To (RTE (RE_Get_Alignment), Loc), + Parameter_Associations => New_List (New_Node)); + end if; -- Case where the context is a specific integer type with which -- the original attribute was compatible. The function has a diff --git a/gcc/ada/g-comlin.adb b/gcc/ada/g-comlin.adb index 07b01632f99..60dde356d78 100644 --- a/gcc/ada/g-comlin.adb +++ b/gcc/ada/g-comlin.adb @@ -19,10 +19,10 @@ -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- --- In particular, you can freely distribute your programs built with the -- --- GNAT Pro compiler, including any required library run-time units, using -- --- any licensing terms of your choosing. See the AdaCore Software License -- --- for full details. -- +-- You should have received a copy of the GNU General Public License and -- +-- a copy of the GCC Runtime Library Exception along with this program; -- +-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- +-- . -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- diff --git a/gcc/ada/rtsfind.ads b/gcc/ada/rtsfind.ads index e6ae088388c..8cd7771628c 100644 --- a/gcc/ada/rtsfind.ads +++ b/gcc/ada/rtsfind.ads @@ -588,6 +588,7 @@ package Rtsfind is RE_External_Tag, -- Ada.Tags RO_TA_External_Tag, -- Ada.Tags RE_Get_Access_Level, -- Ada.Tags + RE_Get_Alignment, -- Ada.Tags RE_Get_Entry_Index, -- Ada.Tags RE_Get_Offset_Index, -- Ada.Tags RE_Get_Prim_Op_Kind, -- Ada.Tags @@ -1787,6 +1788,7 @@ package Rtsfind is RE_External_Tag => Ada_Tags, RO_TA_External_Tag => Ada_Tags, RE_Get_Access_Level => Ada_Tags, + RE_Get_Alignment => Ada_Tags, RE_Get_Entry_Index => Ada_Tags, RE_Get_Offset_Index => Ada_Tags, RE_Get_Prim_Op_Kind => Ada_Tags,