Commit da01bfee by Eric Botcazou Committed by Eric Botcazou

gigi.h (create_field_decl): Move PACKED parameter.

	* gcc-interface/gigi.h (create_field_decl): Move PACKED parameter.
	* gcc-interface/utils.c (create_field_decl): Move PACKED parameter.
	(rest_of_record_type_compilation): Adjust call to create_field_decl.
	(make_descriptor_field): Likewise and pass correctly typed constants.
	(build_unc_object_type): Likewise.
	(unchecked_convert): Likewise.
	* gcc-interface/decl.c (elaborate_expression_2): New static function.
	(gnat_to_gnu_entity): Use it to make alignment factors explicit.
	Adjust call to create_field_decl.
	(make_aligning_type): Likewise.
	(make_packable_type): Likewise.
	(maybe_pad_type): Likewise.
	(gnat_to_gnu_field): Likewise.
	(components_to_record): Likewise.
	(create_field_decl_from): Likewise.
	(create_variant_part_from): Remove superfluous test.
	* gcc-interface/trans.c (gigi): Adjust call to create_field_decl.

From-SVN: r159181
parent 928dfa4b
2010-05-08 Eric Botcazou <ebotcazou@adacore.com> 2010-05-08 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/gigi.h (create_field_decl): Move PACKED parameter.
* gcc-interface/utils.c (create_field_decl): Move PACKED parameter.
(rest_of_record_type_compilation): Adjust call to create_field_decl.
(make_descriptor_field): Likewise and pass correctly typed constants.
(build_unc_object_type): Likewise.
(unchecked_convert): Likewise.
* gcc-interface/decl.c (elaborate_expression_2): New static function.
(gnat_to_gnu_entity): Use it to make alignment factors explicit.
Adjust call to create_field_decl.
(make_aligning_type): Likewise.
(make_packable_type): Likewise.
(maybe_pad_type): Likewise.
(gnat_to_gnu_field): Likewise.
(components_to_record): Likewise.
(create_field_decl_from): Likewise.
(create_variant_part_from): Remove superfluous test.
* gcc-interface/trans.c (gigi): Adjust call to create_field_decl.
2010-05-08 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/gigi.h (build_unc_object_type): Add DEBUG_INFO_P param. * gcc-interface/gigi.h (build_unc_object_type): Add DEBUG_INFO_P param.
(build_unc_object_type_from_ptr): Likewise. (build_unc_object_type_from_ptr): Likewise.
* gcc-interface/utils.c (build_unc_object_type): Add DEBUG_INFO_P param * gcc-interface/utils.c (build_unc_object_type): Add DEBUG_INFO_P param
......
...@@ -595,15 +595,15 @@ extern void record_global_renaming_pointer (tree decl); ...@@ -595,15 +595,15 @@ extern void record_global_renaming_pointer (tree decl);
extern void invalidate_global_renaming_pointers (void); extern void invalidate_global_renaming_pointers (void);
/* Return a FIELD_DECL node. FIELD_NAME is the field's name, FIELD_TYPE is /* Return a FIELD_DECL node. FIELD_NAME is the field's name, FIELD_TYPE is
its type and RECORD_TYPE is the type of the enclosing record. PACKED is its type and RECORD_TYPE is the type of the enclosing record. If SIZE is
1 if the enclosing record is packed, -1 if it has Component_Alignment of nonzero, it is the specified size of the field. If POS is nonzero, it is
Storage_Unit. If SIZE is nonzero, it is the specified size of the field. the bit position. PACKED is 1 if the enclosing record is packed, -1 if it
If POS is nonzero, it is the bit position. If ADDRESSABLE is nonzero, it has Component_Alignment of Storage_Unit. If ADDRESSABLE is nonzero, it
means we are allowed to take the address of the field; if it is negative, means we are allowed to take the address of the field; if it is negative,
we should not make a bitfield, which is used by make_aligning_type. */ we should not make a bitfield, which is used by make_aligning_type. */
extern tree create_field_decl (tree field_name, tree field_type, extern tree create_field_decl (tree field_name, tree field_type,
tree record_type, int packed, tree size, tree record_type, tree size, tree pos,
tree pos, int addressable); int packed, int addressable);
/* Returns a PARM_DECL node. PARAM_NAME is the name of the parameter, /* Returns a PARM_DECL node. PARAM_NAME is the name of the parameter,
PARAM_TYPE is its type. READONLY is true if the parameter is PARAM_TYPE is its type. READONLY is true if the parameter is
......
...@@ -559,8 +559,9 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name ATTRIBUTE_UNUSED, ...@@ -559,8 +559,9 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name ATTRIBUTE_UNUSED,
for (j = 0; j < TARGET_VTABLE_USES_DESCRIPTORS; j++) for (j = 0; j < TARGET_VTABLE_USES_DESCRIPTORS; j++)
{ {
tree field = create_field_decl (NULL_TREE, ptr_void_ftype, tree field
fdesc_type_node, 0, 0, 0, 1); = create_field_decl (NULL_TREE, ptr_void_ftype, fdesc_type_node,
NULL_TREE, NULL_TREE, 0, 1);
TREE_CHAIN (field) = field_list; TREE_CHAIN (field) = field_list;
field_list = field; field_list = field;
null_list = tree_cons (field, null_node, null_list); null_list = tree_cons (field, null_node, null_list);
......
...@@ -915,9 +915,9 @@ rest_of_record_type_compilation (tree record_type) ...@@ -915,9 +915,9 @@ rest_of_record_type_compilation (tree record_type)
field_name = concat_name (field_name, suffix); field_name = concat_name (field_name, suffix);
} }
new_field = create_field_decl (field_name, field_type, new_field
new_record_type, 0, = create_field_decl (field_name, field_type, new_record_type,
DECL_SIZE (old_field), pos, 0); DECL_SIZE (old_field), pos, 0, 0);
TREE_CHAIN (new_field) = TYPE_FIELDS (new_record_type); TREE_CHAIN (new_field) = TYPE_FIELDS (new_record_type);
TYPE_FIELDS (new_record_type) = new_field; TYPE_FIELDS (new_record_type) = new_field;
...@@ -1439,16 +1439,16 @@ aggregate_type_contains_array_p (tree type) ...@@ -1439,16 +1439,16 @@ aggregate_type_contains_array_p (tree type)
} }
/* Return a FIELD_DECL node. FIELD_NAME is the field's name, FIELD_TYPE is /* Return a FIELD_DECL node. FIELD_NAME is the field's name, FIELD_TYPE is
its type and RECORD_TYPE is the type of the enclosing record. PACKED is its type and RECORD_TYPE is the type of the enclosing record. If SIZE is
1 if the enclosing record is packed, -1 if it has Component_Alignment of nonzero, it is the specified size of the field. If POS is nonzero, it is
Storage_Unit. If SIZE is nonzero, it is the specified size of the field. the bit position. PACKED is 1 if the enclosing record is packed, -1 if it
If POS is nonzero, it is the bit position. If ADDRESSABLE is nonzero, it has Component_Alignment of Storage_Unit. If ADDRESSABLE is nonzero, it
means we are allowed to take the address of the field; if it is negative, means we are allowed to take the address of the field; if it is negative,
we should not make a bitfield, which is used by make_aligning_type. */ we should not make a bitfield, which is used by make_aligning_type. */
tree tree
create_field_decl (tree field_name, tree field_type, tree record_type, create_field_decl (tree field_name, tree field_type, tree record_type,
int packed, tree size, tree pos, int addressable) tree size, tree pos, int packed, int addressable)
{ {
tree field_decl = build_decl (input_location, tree field_decl = build_decl (input_location,
FIELD_DECL, field_name, field_type); FIELD_DECL, field_name, field_type);
...@@ -2919,7 +2919,8 @@ make_descriptor_field (const char *name, tree type, ...@@ -2919,7 +2919,8 @@ make_descriptor_field (const char *name, tree type,
tree rec_type, tree initial) tree rec_type, tree initial)
{ {
tree field tree field
= create_field_decl (get_identifier (name), type, rec_type, 0, 0, 0, 0); = create_field_decl (get_identifier (name), type, rec_type, NULL_TREE,
NULL_TREE, 0, 0);
DECL_INITIAL (field) = initial; DECL_INITIAL (field) = initial;
return field; return field;
...@@ -3311,10 +3312,12 @@ build_unc_object_type (tree template_type, tree object_type, tree name, ...@@ -3311,10 +3312,12 @@ build_unc_object_type (tree template_type, tree object_type, tree name,
bool debug_info_p) bool debug_info_p)
{ {
tree type = make_node (RECORD_TYPE); tree type = make_node (RECORD_TYPE);
tree template_field = create_field_decl (get_identifier ("BOUNDS"), tree template_field
template_type, type, 0, 0, 0, 1); = create_field_decl (get_identifier ("BOUNDS"), template_type, type,
tree array_field = create_field_decl (get_identifier ("ARRAY"), object_type, NULL_TREE, NULL_TREE, 0, 1);
type, 0, 0, 0, 1); tree array_field
= create_field_decl (get_identifier ("ARRAY"), object_type, type,
NULL_TREE, NULL_TREE, 0, 1);
TYPE_NAME (type) = name; TYPE_NAME (type) = name;
TYPE_CONTAINS_TEMPLATE_P (type) = 1; TYPE_CONTAINS_TEMPLATE_P (type) = 1;
...@@ -4363,8 +4366,8 @@ unchecked_convert (tree type, tree expr, bool notrunc_p) ...@@ -4363,8 +4366,8 @@ unchecked_convert (tree type, tree expr, bool notrunc_p)
GET_MODE_BITSIZE (TYPE_MODE (type)))) GET_MODE_BITSIZE (TYPE_MODE (type))))
{ {
tree rec_type = make_node (RECORD_TYPE); tree rec_type = make_node (RECORD_TYPE);
tree field = create_field_decl (get_identifier ("OBJ"), type, tree field = create_field_decl (get_identifier ("OBJ"), type, rec_type,
rec_type, 1, 0, 0, 0); NULL_TREE, NULL_TREE, 1, 0);
TYPE_FIELDS (rec_type) = field; TYPE_FIELDS (rec_type) = field;
layout_type (rec_type); layout_type (rec_type);
...@@ -4380,9 +4383,8 @@ unchecked_convert (tree type, tree expr, bool notrunc_p) ...@@ -4380,9 +4383,8 @@ unchecked_convert (tree type, tree expr, bool notrunc_p)
GET_MODE_BITSIZE (TYPE_MODE (etype)))) GET_MODE_BITSIZE (TYPE_MODE (etype))))
{ {
tree rec_type = make_node (RECORD_TYPE); tree rec_type = make_node (RECORD_TYPE);
tree field tree field = create_field_decl (get_identifier ("OBJ"), etype, rec_type,
= create_field_decl (get_identifier ("OBJ"), etype, rec_type, NULL_TREE, NULL_TREE, 1, 0);
1, 0, 0, 0);
TYPE_FIELDS (rec_type) = field; TYPE_FIELDS (rec_type) = field;
layout_type (rec_type); layout_type (rec_type);
......
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