Commit b5bba4a6 by Eric Botcazou Committed by Eric Botcazou

exp_dbug.ads: Fix outdated description.

	* exp_dbug.ads: Fix outdated description.  Mention link between XVS
	and XVZ objects.
	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Subtype>: Set
	XVZ variable as unit size of XVS type.
	(maybe_pad_type): Likewise.

From-SVN: r158703
parent 82d6f532
2010-04-25 Eric Botcazou <ebotcazou@adacore.com> 2010-04-25 Eric Botcazou <ebotcazou@adacore.com>
* exp_dbug.ads: Fix outdated description. Mention link between XVS
and XVZ objects.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Subtype>: Set
XVZ variable as unit size of XVS type.
(maybe_pad_type): Likewise.
2010-04-25 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>: Do not * gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>: Do not
use memmove if the array type is bit-packed. use memmove if the array type is bit-packed.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1996-2009, Free Software Foundation, Inc. -- -- Copyright (C) 1996-2010, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -853,16 +853,17 @@ package Exp_Dbug is ...@@ -853,16 +853,17 @@ package Exp_Dbug is
-- The size of the objects typed as x should be obtained from the -- The size of the objects typed as x should be obtained from the
-- structure of x (and x___XVE, if applicable) as for ordinary types -- structure of x (and x___XVE, if applicable) as for ordinary types
-- unless there is a variable named x___XVZ, which, if present, will -- unless there is a variable named x___XVZ, which, if present, will
-- hold the size (in bytes) of x. -- hold the size (in bytes) of x; in this latter case, the size of the
-- x___XVS type will not be a constant but a reference to x___XVZ.
-- The type x will either be a subtype of y (see also Subtypes of -- The type x will either be a subtype of y (see also Subtypes of
-- Variant Records, below) or will contain no fields at all. The layout, -- Variant Records, below) or will contain a single field of type y,
-- types, and positions of these fields will be accurate, if present. -- or no fields at all. The layout, types, and positions of these
-- (Currently, however, the GDB debugger makes no use of x except to -- fields will be accurate, if present. (Currently, however, the GDB
-- determine its size). -- debugger makes no use of x except to determine its size).
-- Among other uses, XVS types are sometimes used to encode -- Among other uses, XVS types are used to encode unconstrained types.
-- unconstrained types. For example, given -- For example, given:
-- --
-- subtype Int is INTEGER range 0..10; -- subtype Int is INTEGER range 0..10;
-- type T1 (N: Int := 0) is record -- type T1 (N: Int := 0) is record
...@@ -873,13 +874,14 @@ package Exp_Dbug is ...@@ -873,13 +874,14 @@ package Exp_Dbug is
-- the element type for AT1 might have a type defined as if it had -- the element type for AT1 might have a type defined as if it had
-- been written: -- been written:
-- --
-- type at1___PAD is record null; end record; -- type at1___PAD is record F : T1; end record;
-- for at1___PAD'Size use 16 * 8; -- for at1___PAD'Size use 16 * 8;
-- --
-- and there would also be -- and there would also be:
-- --
-- type at1___PAD___XVS is record t1: Integer; end record; -- type at1___PAD___XVS is record t1: reft1; end record;
-- type t1 is ... -- type t1 is ...
-- type reft1 is <reference to t1>
-- --
-- Had the subtype Int been dynamic: -- Had the subtype Int been dynamic:
-- --
......
...@@ -3258,9 +3258,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -3258,9 +3258,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
if (definition if (definition
&& TREE_CODE (gnu_size_unit) != INTEGER_CST && TREE_CODE (gnu_size_unit) != INTEGER_CST
&& !CONTAINS_PLACEHOLDER_P (gnu_size_unit)) && !CONTAINS_PLACEHOLDER_P (gnu_size_unit))
create_var_decl (create_concat_name (gnat_entity, "XVZ"), TYPE_SIZE_UNIT (gnu_subtype_marker)
NULL_TREE, sizetype, gnu_size_unit, false, = create_var_decl (create_concat_name (gnat_entity,
false, false, false, NULL, gnat_entity); "XVZ"),
NULL_TREE, sizetype, gnu_size_unit,
false, false, false, false, NULL,
gnat_entity);
} }
/* Now we can finalize it. */ /* Now we can finalize it. */
...@@ -6253,9 +6256,10 @@ maybe_pad_type (tree type, tree size, unsigned int align, ...@@ -6253,9 +6256,10 @@ maybe_pad_type (tree type, tree size, unsigned int align,
add_parallel_type (TYPE_STUB_DECL (record), marker); add_parallel_type (TYPE_STUB_DECL (record), marker);
if (definition && size && TREE_CODE (size) != INTEGER_CST) if (definition && size && TREE_CODE (size) != INTEGER_CST)
create_var_decl (concat_name (name, "XVZ"), NULL_TREE, sizetype, TYPE_SIZE_UNIT (marker)
TYPE_SIZE_UNIT (record), false, false, false, = create_var_decl (concat_name (name, "XVZ"), NULL_TREE, sizetype,
false, NULL, gnat_entity); TYPE_SIZE_UNIT (record), false, false, false,
false, NULL, gnat_entity);
} }
rest_of_record_type_compilation (record); rest_of_record_type_compilation (record);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment