Commit 77022fa8 by Eric Botcazou Committed by Eric Botcazou

ada-tree.h (DECL_HAS_REP_P): Delete.

	* gcc-interface/ada-tree.h (DECL_HAS_REP_P): Delete.
	* gcc-interface/decl.c (gnat_to_gnu_entity): Add support for extension
	of types with unknown discriminants.
	(substitute_in_type): Rewrite and restrict to formal substitutions.
	* gcc-interface/utils.c (create_field_decl): Do not set DECL_HAS_REP_P.
	(update_pointer_to): Update comment.

From-SVN: r146447
parent d9d3eaab
2009-04-20 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/ada-tree.h (DECL_HAS_REP_P): Delete.
* gcc-interface/decl.c (gnat_to_gnu_entity): Add support for extension
of types with unknown discriminants.
(substitute_in_type): Rewrite and restrict to formal substitutions.
* gcc-interface/utils.c (create_field_decl): Do not set DECL_HAS_REP_P.
(update_pointer_to): Update comment.
2009-04-20 Ed Schonberg <schonberg@adacore.com> 2009-04-20 Ed Schonberg <schonberg@adacore.com>
* sem_ch8.adb (Use_One_Package): In an instance, if two * sem_ch8.adb (Use_One_Package): In an instance, if two
...@@ -249,9 +249,6 @@ struct lang_type GTY(()) {tree t; }; ...@@ -249,9 +249,6 @@ struct lang_type GTY(()) {tree t; };
is readonly. Used mostly for fat pointers. */ is readonly. Used mostly for fat pointers. */
#define DECL_POINTS_TO_READONLY_P(NODE) DECL_LANG_FLAG_4 (NODE) #define DECL_POINTS_TO_READONLY_P(NODE) DECL_LANG_FLAG_4 (NODE)
/* Nonzero in a FIELD_DECL if there was a record rep clause. */
#define DECL_HAS_REP_P(NODE) DECL_LANG_FLAG_5 (FIELD_DECL_CHECK (NODE))
/* Nonzero in a PARM_DECL if we are to pass by descriptor. */ /* Nonzero in a PARM_DECL if we are to pass by descriptor. */
#define DECL_BY_DESCRIPTOR_P(NODE) DECL_LANG_FLAG_5 (PARM_DECL_CHECK (NODE)) #define DECL_BY_DESCRIPTOR_P(NODE) DECL_LANG_FLAG_5 (PARM_DECL_CHECK (NODE))
......
...@@ -1521,8 +1521,6 @@ create_field_decl (tree field_name, tree field_type, tree record_type, ...@@ -1521,8 +1521,6 @@ create_field_decl (tree field_name, tree field_type, tree record_type,
pos_from_bit (&DECL_FIELD_OFFSET (field_decl), pos_from_bit (&DECL_FIELD_OFFSET (field_decl),
&DECL_FIELD_BIT_OFFSET (field_decl), &DECL_FIELD_BIT_OFFSET (field_decl),
DECL_OFFSET_ALIGN (field_decl), pos); DECL_OFFSET_ALIGN (field_decl), pos);
DECL_HAS_REP_P (field_decl) = 1;
} }
/* In addition to what our caller says, claim the field is addressable if we /* In addition to what our caller says, claim the field is addressable if we
...@@ -3606,10 +3604,7 @@ update_pointer_to (tree old_type, tree new_type) ...@@ -3606,10 +3604,7 @@ update_pointer_to (tree old_type, tree new_type)
bounds_field, NULL_TREE); bounds_field, NULL_TREE);
/* Create the new array for the new PLACEHOLDER_EXPR and make pointers /* Create the new array for the new PLACEHOLDER_EXPR and make pointers
to the dummy array point to it. to the dummy array point to it. */
??? This is now the only use of substitute_in_type, which is a very
"heavy" routine to do this, it should be replaced at some point. */
update_pointer_to update_pointer_to
(TREE_TYPE (TREE_TYPE (array_field)), (TREE_TYPE (TREE_TYPE (array_field)),
substitute_in_type (TREE_TYPE (TREE_TYPE (TYPE_FIELDS (new_ptr))), substitute_in_type (TREE_TYPE (TREE_TYPE (TYPE_FIELDS (new_ptr))),
......
2009-04-20 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/discr11.ad[sb]: New test.
* gnat.dg/discr11_pkg.ads: New helper.
2009-04-20 Ira Rosen <irar@il.ibm.com> 2009-04-20 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/39675 PR tree-optimization/39675
......
-- { dg-do compile }
package body Discr11 is
function Create return DT_2 is
begin
return DT_2'(DT_1'(Create) with More => 1234);
end;
end Discr11;
with Discr11_Pkg; use Discr11_Pkg;
package Discr11 is
type DT_2 is new DT_1 with record
More : Integer;
end record;
function Create return DT_2;
end Discr11;
package Discr11_Pkg is
type DT_1 (<>) is tagged private;
function Create return DT_1;
private
type DT_1 (Size : Positive) is tagged record
Data : String (1 .. Size);
end record;
end Discr11_Pkg;
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