Commit 7d76717d by Eric Botcazou Committed by Eric Botcazou

gigi.h (create_subprog_decl): Replace TREE_CHAIN with DECL_CHAIN in comment.

	* gcc-interface/gigi.h (create_subprog_decl): Replace TREE_CHAIN with
	DECL_CHAIN in comment.
	* gcc-interface/trans.c (gigi): Likewise.
	(Attribute_to_gnu): Likewise.
	(build_function_stub): Likewise.
	(gnat_to_gnu): Likewise.
	* gcc-interface/utils.c (create_subprog_decl): Likewise.
	(convert_vms_descriptor64): Likewise.
	(convert_vms_descriptor32): Likewise.

From-SVN: r179185
parent 42acad07
2011-09-26 Eric Botcazou <ebotcazou@adacore.com> 2011-09-26 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/gigi.h (create_subprog_decl): Replace TREE_CHAIN with
DECL_CHAIN in comment.
* gcc-interface/trans.c (gigi): Likewise.
(Attribute_to_gnu): Likewise.
(build_function_stub): Likewise.
(gnat_to_gnu): Likewise.
* gcc-interface/utils.c (create_subprog_decl): Likewise.
(convert_vms_descriptor64): Likewise.
(convert_vms_descriptor32): Likewise.
2011-09-26 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (assoc_to_constructor): Minor tweaks. * gcc-interface/trans.c (assoc_to_constructor): Minor tweaks.
* gcc-interface/utils2.c (build_simple_component_ref): Fix formatting * gcc-interface/utils2.c (build_simple_component_ref): Fix formatting
issues. Use COMPLETE_TYPE_P in assertion. Also set TREE_READONLY if issues. Use COMPLETE_TYPE_P in assertion. Also set TREE_READONLY if
......
...@@ -671,7 +671,7 @@ extern tree create_label_decl (tree label_name); ...@@ -671,7 +671,7 @@ extern tree create_label_decl (tree label_name);
/* Return a FUNCTION_DECL node. SUBPROG_NAME is the name of the subprogram, /* Return a FUNCTION_DECL node. SUBPROG_NAME is the name of the subprogram,
ASM_NAME is its assembler name, SUBPROG_TYPE is its type (a FUNCTION_TYPE ASM_NAME is its assembler name, SUBPROG_TYPE is its type (a FUNCTION_TYPE
node), PARAM_DECL_LIST is the list of the subprogram arguments (a list of node), PARAM_DECL_LIST is the list of the subprogram arguments (a list of
PARM_DECL nodes chained through the TREE_CHAIN field). PARM_DECL nodes chained through the DECL_CHAIN field).
INLINE_FLAG, PUBLIC_FLAG, EXTERN_FLAG, ARTIFICIAL_FLAG and ATTR_LIST are INLINE_FLAG, PUBLIC_FLAG, EXTERN_FLAG, ARTIFICIAL_FLAG and ATTR_LIST are
used to set the appropriate fields in the FUNCTION_DECL. GNAT_NODE is used to set the appropriate fields in the FUNCTION_DECL. GNAT_NODE is
......
...@@ -540,7 +540,7 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name ATTRIBUTE_UNUSED, ...@@ -540,7 +540,7 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name ATTRIBUTE_UNUSED,
tree field tree field
= create_field_decl (NULL_TREE, ptr_void_ftype, fdesc_type_node, = create_field_decl (NULL_TREE, ptr_void_ftype, fdesc_type_node,
NULL_TREE, NULL_TREE, 0, 1); NULL_TREE, NULL_TREE, 0, 1);
TREE_CHAIN (field) = field_list; DECL_CHAIN (field) = field_list;
field_list = field; field_list = field;
elt->index = field; elt->index = field;
elt->value = null_node; elt->value = null_node;
...@@ -1286,7 +1286,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) ...@@ -1286,7 +1286,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
+ TARGET_VTABLE_USES_DESCRIPTORS - 1); + TARGET_VTABLE_USES_DESCRIPTORS - 1);
for (gnu_field = TYPE_FIELDS (gnu_result_type), i = 0; for (gnu_field = TYPE_FIELDS (gnu_result_type), i = 0;
i < TARGET_VTABLE_USES_DESCRIPTORS; i < TARGET_VTABLE_USES_DESCRIPTORS;
gnu_field = TREE_CHAIN (gnu_field), i++) gnu_field = DECL_CHAIN (gnu_field), i++)
{ {
if (build_descriptor) if (build_descriptor)
{ {
...@@ -1420,7 +1420,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) ...@@ -1420,7 +1420,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
{ {
gnu_type = TYPE_OBJECT_RECORD_TYPE (gnu_type); gnu_type = TYPE_OBJECT_RECORD_TYPE (gnu_type);
if (attribute != Attr_Max_Size_In_Storage_Elements) if (attribute != Attr_Max_Size_In_Storage_Elements)
gnu_type = TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (gnu_type))); gnu_type = TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (gnu_type)));
} }
/* If we're looking for the size of a field, return the field size. /* If we're looking for the size of a field, return the field size.
...@@ -2567,8 +2567,8 @@ build_function_stub (tree gnu_subprog, Entity_Id gnat_subprog) ...@@ -2567,8 +2567,8 @@ build_function_stub (tree gnu_subprog, Entity_Id gnat_subprog)
for (gnu_stub_param = DECL_ARGUMENTS (gnu_stub_decl), for (gnu_stub_param = DECL_ARGUMENTS (gnu_stub_decl),
gnu_subprog_param = DECL_ARGUMENTS (gnu_subprog); gnu_subprog_param = DECL_ARGUMENTS (gnu_subprog);
gnu_stub_param; gnu_stub_param;
gnu_stub_param = TREE_CHAIN (gnu_stub_param), gnu_stub_param = DECL_CHAIN (gnu_stub_param),
gnu_subprog_param = TREE_CHAIN (gnu_subprog_param)) gnu_subprog_param = DECL_CHAIN (gnu_subprog_param))
{ {
if (DECL_BY_DESCRIPTOR_P (gnu_stub_param)) if (DECL_BY_DESCRIPTOR_P (gnu_stub_param))
{ {
...@@ -4695,7 +4695,7 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -4695,7 +4695,7 @@ gnat_to_gnu (Node_Id gnat_node)
if (TREE_CODE (gnu_result_type) == RECORD_TYPE if (TREE_CODE (gnu_result_type) == RECORD_TYPE
&& TYPE_CONTAINS_TEMPLATE_P (gnu_result_type)) && TYPE_CONTAINS_TEMPLATE_P (gnu_result_type))
gnu_aggr_type gnu_aggr_type
= TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (gnu_result_type))); = TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (gnu_result_type)));
else if (TREE_CODE (gnu_result_type) == VECTOR_TYPE) else if (TREE_CODE (gnu_result_type) == VECTOR_TYPE)
gnu_aggr_type = TYPE_REPRESENTATIVE_ARRAY (gnu_result_type); gnu_aggr_type = TYPE_REPRESENTATIVE_ARRAY (gnu_result_type);
......
...@@ -1861,7 +1861,7 @@ create_label_decl (tree label_name) ...@@ -1861,7 +1861,7 @@ create_label_decl (tree label_name)
/* Return a FUNCTION_DECL node. SUBPROG_NAME is the name of the subprogram, /* Return a FUNCTION_DECL node. SUBPROG_NAME is the name of the subprogram,
ASM_NAME is its assembler name, SUBPROG_TYPE is its type (a FUNCTION_TYPE ASM_NAME is its assembler name, SUBPROG_TYPE is its type (a FUNCTION_TYPE
node), PARAM_DECL_LIST is the list of the subprogram arguments (a list of node), PARAM_DECL_LIST is the list of the subprogram arguments (a list of
PARM_DECL nodes chained through the TREE_CHAIN field). PARM_DECL nodes chained through the DECL_CHAIN field).
INLINE_FLAG, PUBLIC_FLAG, EXTERN_FLAG, ARTIFICIAL_FLAG and ATTR_LIST are INLINE_FLAG, PUBLIC_FLAG, EXTERN_FLAG, ARTIFICIAL_FLAG and ATTR_LIST are
used to set the appropriate fields in the FUNCTION_DECL. GNAT_NODE is used to set the appropriate fields in the FUNCTION_DECL. GNAT_NODE is
...@@ -3039,10 +3039,10 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) ...@@ -3039,10 +3039,10 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
else if (TYPE_IS_FAT_POINTER_P (gnu_type)) else if (TYPE_IS_FAT_POINTER_P (gnu_type))
{ {
tree p_array_type = TREE_TYPE (TYPE_FIELDS (gnu_type)); tree p_array_type = TREE_TYPE (TYPE_FIELDS (gnu_type));
tree p_bounds_type = TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (gnu_type))); tree p_bounds_type = TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (gnu_type)));
tree template_type = TREE_TYPE (p_bounds_type); tree template_type = TREE_TYPE (p_bounds_type);
tree min_field = TYPE_FIELDS (template_type); tree min_field = TYPE_FIELDS (template_type);
tree max_field = TREE_CHAIN (TYPE_FIELDS (template_type)); tree max_field = DECL_CHAIN (TYPE_FIELDS (template_type));
tree template_tree, template_addr, aflags, dimct, t, u; tree template_tree, template_addr, aflags, dimct, t, u;
/* See the head comment of build_vms_descriptor. */ /* See the head comment of build_vms_descriptor. */
int iklass = TREE_INT_CST_LOW (DECL_INITIAL (klass)); int iklass = TREE_INT_CST_LOW (DECL_INITIAL (klass));
...@@ -3079,11 +3079,11 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) ...@@ -3079,11 +3079,11 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
/* If so, there is already a template in the descriptor and /* If so, there is already a template in the descriptor and
it is located right after the POINTER field. The fields are it is located right after the POINTER field. The fields are
64bits so they must be repacked. */ 64bits so they must be repacked. */
t = TREE_CHAIN (pointer); t = DECL_CHAIN (pointer);
lfield = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE); lfield = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
lfield = convert (TREE_TYPE (TYPE_FIELDS (template_type)), lfield); lfield = convert (TREE_TYPE (TYPE_FIELDS (template_type)), lfield);
t = TREE_CHAIN (t); t = DECL_CHAIN (t);
ufield = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE); ufield = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
ufield = convert ufield = convert
(TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (template_type))), ufield); (TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (template_type))), ufield);
...@@ -3091,7 +3091,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) ...@@ -3091,7 +3091,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
/* Build the template in the form of a constructor. */ /* Build the template in the form of a constructor. */
v = VEC_alloc (constructor_elt, gc, 2); v = VEC_alloc (constructor_elt, gc, 2);
CONSTRUCTOR_APPEND_ELT (v, TYPE_FIELDS (template_type), lfield); CONSTRUCTOR_APPEND_ELT (v, TYPE_FIELDS (template_type), lfield);
CONSTRUCTOR_APPEND_ELT (v, TREE_CHAIN (TYPE_FIELDS (template_type)), CONSTRUCTOR_APPEND_ELT (v, DECL_CHAIN (TYPE_FIELDS (template_type)),
ufield); ufield);
template_tree = gnat_build_constructor (template_type, v); template_tree = gnat_build_constructor (template_type, v);
...@@ -3109,7 +3109,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) ...@@ -3109,7 +3109,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
aflags = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE); aflags = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
/* The DIMCT field is the next field in the descriptor after /* The DIMCT field is the next field in the descriptor after
aflags. */ aflags. */
t = TREE_CHAIN (t); t = DECL_CHAIN (t);
dimct = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE); dimct = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
/* Raise CONSTRAINT_ERROR if either more than 1 dimension /* Raise CONSTRAINT_ERROR if either more than 1 dimension
or FL_COEFF or FL_BOUNDS not set. */ or FL_COEFF or FL_BOUNDS not set. */
...@@ -3131,7 +3131,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) ...@@ -3131,7 +3131,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
lfield = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE); lfield = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
lfield = convert (TREE_TYPE (TYPE_FIELDS (template_type)), lfield); lfield = convert (TREE_TYPE (TYPE_FIELDS (template_type)), lfield);
t = TREE_CHAIN (t); t = DECL_CHAIN (t);
ufield = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE); ufield = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
ufield = convert ufield = convert
(TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (template_type))), ufield); (TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (template_type))), ufield);
...@@ -3193,10 +3193,10 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) ...@@ -3193,10 +3193,10 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
else if (TYPE_IS_FAT_POINTER_P (gnu_type)) else if (TYPE_IS_FAT_POINTER_P (gnu_type))
{ {
tree p_array_type = TREE_TYPE (TYPE_FIELDS (gnu_type)); tree p_array_type = TREE_TYPE (TYPE_FIELDS (gnu_type));
tree p_bounds_type = TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (gnu_type))); tree p_bounds_type = TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (gnu_type)));
tree template_type = TREE_TYPE (p_bounds_type); tree template_type = TREE_TYPE (p_bounds_type);
tree min_field = TYPE_FIELDS (template_type); tree min_field = TYPE_FIELDS (template_type);
tree max_field = TREE_CHAIN (TYPE_FIELDS (template_type)); tree max_field = DECL_CHAIN (TYPE_FIELDS (template_type));
tree template_tree, template_addr, aflags, dimct, t, u; tree template_tree, template_addr, aflags, dimct, t, u;
/* See the head comment of build_vms_descriptor. */ /* See the head comment of build_vms_descriptor. */
int iklass = TREE_INT_CST_LOW (DECL_INITIAL (klass)); int iklass = TREE_INT_CST_LOW (DECL_INITIAL (klass));
...@@ -3231,7 +3231,7 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) ...@@ -3231,7 +3231,7 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
u = build_binary_op (EQ_EXPR, boolean_type_node, t, u); u = build_binary_op (EQ_EXPR, boolean_type_node, t, u);
/* If so, there is already a template in the descriptor and /* If so, there is already a template in the descriptor and
it is located right after the POINTER field. */ it is located right after the POINTER field. */
t = TREE_CHAIN (pointer); t = DECL_CHAIN (pointer);
template_tree template_tree
= build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE); = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
/* Otherwise use the {1, LENGTH} template we build above. */ /* Otherwise use the {1, LENGTH} template we build above. */
...@@ -3246,7 +3246,7 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) ...@@ -3246,7 +3246,7 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
t = DECL_CHAIN (DECL_CHAIN (DECL_CHAIN (pointer))); t = DECL_CHAIN (DECL_CHAIN (DECL_CHAIN (pointer)));
aflags = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE); aflags = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
/* The DIMCT field is the 8th field in the descriptor. */ /* The DIMCT field is the 8th field in the descriptor. */
t = TREE_CHAIN (t); t = DECL_CHAIN (t);
dimct = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE); dimct = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
/* Raise CONSTRAINT_ERROR if either more than 1 dimension /* Raise CONSTRAINT_ERROR if either more than 1 dimension
or FL_COEFF or FL_BOUNDS not set. */ or FL_COEFF or FL_BOUNDS not set. */
......
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