* 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 <dewar@adacore.com>
* g-comlin.adb: Fix header.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182365
138bc75d-0d04-0410-961f-
82ee72b054a4
+2011-12-15 Javier Miranda <miranda@adacore.com>
+
+ * 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 <dewar@adacore.com>
+
+ * g-comlin.adb: Fix header.
+
2011-12-15 Tristan Gingold <gingold@adacore.com>
* gnatls.adb: Fix typo.
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
-- 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 --
+-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
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
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,