Commit 6249559b by Eric Botcazou Committed by Eric Botcazou

gigi.h (create_var_decl_1): Rename into...

	* gcc-interface/gigi.h (create_var_decl_1): Rename into...
	(create_var_decl): ...this.  Add default value for last parameter.
	(create_type_stub_decl): Adjust.
	(create_type_decl): Likewise.
	(create_field_decl): Likewise.
	(create_param_decl): Likewise.
	(create_label_decl): Likewise.
	(create_subprog_decl): Likewise.
	* gcc-interface/utils.c (create_var_decl_1): Rename into...
	(create_var_decl): ...this.  Rename var_name into name and var_init
	into init, move const_decl_allowed_p last and adjust accordingly.
	(create_type_stub_decl): Rename type_name into name and adjust.
	(create_type_decl): Likewise.
	(create_field_decl): Likewise for field_name and field_type.
	(create_param_decl): Likewise for param_name and param_type.
	(create_label_decl): Likewise for label_name.
	(create_subprog_decl): Likewise for subprog_name and subprog_type.
	* gcc-interface/decl.c (gnat_to_gnu_entity): Adjust couple of calls
	to create_var_decl_1.

From-SVN: r225002
parent 66cc6273
2015-06-26 Eric Botcazou <ebotcazou@adacore.com> 2015-06-26 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/gigi.h (create_var_decl_1): Rename into...
(create_var_decl): ...this. Add default value for last parameter.
(create_type_stub_decl): Adjust.
(create_type_decl): Likewise.
(create_field_decl): Likewise.
(create_param_decl): Likewise.
(create_label_decl): Likewise.
(create_subprog_decl): Likewise.
* gcc-interface/utils.c (create_var_decl_1): Rename into...
(create_var_decl): ...this. Rename var_name into name and var_init
into init, move const_decl_allowed_p last and adjust accordingly.
(create_type_stub_decl): Rename type_name into name and adjust.
(create_type_decl): Likewise.
(create_field_decl): Likewise for field_name and field_type.
(create_param_decl): Likewise for param_name and param_type.
(create_label_decl): Likewise for label_name.
(create_subprog_decl): Likewise for subprog_name and subprog_type.
* gcc-interface/decl.c (gnat_to_gnu_entity): Adjust couple of calls
to create_var_decl_1.
2015-06-26 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (loop_info_d): Add low_bound, high_bound, * gcc-interface/trans.c (loop_info_d): Add low_bound, high_bound,
artificial, has_checks and warned_aggressive_loop_optimizations. artificial, has_checks and warned_aggressive_loop_optimizations.
(gigi): Set warn_aggressive_loop_optimizations to 0. (gigi): Set warn_aggressive_loop_optimizations to 0.
......
...@@ -1444,11 +1444,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -1444,11 +1444,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* Now create the variable or the constant and set various flags. */ /* Now create the variable or the constant and set various flags. */
gnu_decl gnu_decl
= create_var_decl_1 (gnu_entity_name, gnu_ext_name, gnu_type, = create_var_decl (gnu_entity_name, gnu_ext_name, gnu_type,
gnu_expr, const_flag, Is_Public (gnat_entity), gnu_expr, const_flag, Is_Public (gnat_entity),
imported_p || !definition, static_p, imported_p || !definition, static_p,
artificial_p, debug_info_p, !renamed_obj, artificial_p, debug_info_p, attr_list,
attr_list, gnat_entity); gnat_entity, !renamed_obj);
DECL_BY_REF_P (gnu_decl) = used_by_ref; DECL_BY_REF_P (gnu_decl) = used_by_ref;
DECL_POINTS_TO_READONLY_P (gnu_decl) = used_by_ref && inner_const_flag; DECL_POINTS_TO_READONLY_P (gnu_decl) = used_by_ref && inner_const_flag;
DECL_CAN_NEVER_BE_NULL_P (gnu_decl) = Can_Never_Be_Null (gnat_entity); DECL_CAN_NEVER_BE_NULL_P (gnu_decl) = Can_Never_Be_Null (gnat_entity);
...@@ -1497,11 +1497,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -1497,11 +1497,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
|| Is_Aliased (Etype (gnat_entity)))) || Is_Aliased (Etype (gnat_entity))))
{ {
tree gnu_corr_var tree gnu_corr_var
= create_var_decl_1 (gnu_entity_name, gnu_ext_name, gnu_type, = create_var_decl (gnu_entity_name, gnu_ext_name, gnu_type,
gnu_expr, true, Is_Public (gnat_entity), gnu_expr, true, Is_Public (gnat_entity),
!definition, static_p, artificial_p, !definition, static_p, artificial_p,
debug_info_p, false, attr_list, debug_info_p, attr_list, gnat_entity,
gnat_entity); false);
SET_DECL_CONST_CORRESPONDING_VAR (gnu_decl, gnu_corr_var); SET_DECL_CONST_CORRESPONDING_VAR (gnu_decl, gnu_corr_var);
} }
......
...@@ -654,23 +654,22 @@ extern tree create_index_type (tree min, tree max, tree index, ...@@ -654,23 +654,22 @@ extern tree create_index_type (tree min, tree max, tree index,
sizetype is used. */ sizetype is used. */
extern tree create_range_type (tree type, tree min, tree max); extern tree create_range_type (tree type, tree min, tree max);
/* Return a TYPE_DECL node suitable for the TYPE_STUB_DECL field of a type. /* Return a TYPE_DECL node suitable for the TYPE_STUB_DECL field of TYPE.
TYPE_NAME gives the name of the type and TYPE is a ..._TYPE node giving NAME gives the name of the type to be used in the declaration. */
its data type. */ extern tree create_type_stub_decl (tree name, tree type);
extern tree create_type_stub_decl (tree type_name, tree type);
/* Return a TYPE_DECL node for TYPE. NAME gives the name of the type to be
/* Return a TYPE_DECL node. TYPE_NAME gives the name of the type and TYPE used in the declaration. ARTIFICIAL_P is true if the declaration was
is a ..._TYPE node giving its data type. ARTIFICIAL_P is true if the generated by the compiler. DEBUG_INFO_P is true if we need to write
declaration was generated by the compiler. DEBUG_INFO_P is true if we debug information about this type. GNAT_NODE is used for the position
need to write debug information about this type. GNAT_NODE is used for of the decl. */
the position of the decl. */ extern tree create_type_decl (tree name, tree type, bool artificial_p,
extern tree create_type_decl (tree type_name, tree type, bool artificial_p,
bool debug_info_p, Node_Id gnat_node); bool debug_info_p, Node_Id gnat_node);
/* Return a VAR_DECL or CONST_DECL node. /* Return a VAR_DECL or CONST_DECL node.
VAR_NAME gives the name of the variable. ASM_NAME is its assembler name NAME gives the name of the variable. ASM_NAME is its assembler name
(if provided). TYPE is its data type (a GCC ..._TYPE node). VAR_INIT is (if provided). TYPE is its data type (a GCC ..._TYPE node). INIT is
the GCC tree for an optional initial expression; NULL_TREE if none. the GCC tree for an optional initial expression; NULL_TREE if none.
CONST_FLAG is true if this variable is constant, in which case we might CONST_FLAG is true if this variable is constant, in which case we might
...@@ -691,49 +690,37 @@ extern tree create_type_decl (tree type_name, tree type, bool artificial_p, ...@@ -691,49 +690,37 @@ extern tree create_type_decl (tree type_name, tree type, bool artificial_p,
DEBUG_INFO_P is true if we need to write debug information for it. DEBUG_INFO_P is true if we need to write debug information for it.
GNAT_NODE is used for the position of the decl. */ GNAT_NODE is used for the position of the decl. */
extern tree extern tree create_var_decl (tree name, tree asm_name, tree type, tree init,
create_var_decl_1 (tree var_name, tree asm_name, tree type, tree var_init, bool const_flag, bool public_flag,
bool const_flag, bool public_flag, bool extern_flag, bool extern_flag, bool static_flag,
bool static_flag, bool artificial_p, bool debug_info_p, bool artificial_p, bool debug_info_p,
bool const_decl_allowed_p, struct attrib *attr_list, struct attrib *attr_list, Node_Id gnat_node,
Node_Id gnat_node); bool const_decl_allowed_p = true);
/* Wrapper around create_var_decl_1 for cases where we don't care whether /* Return a FIELD_DECL node. NAME is the field's name, TYPE is its type and
a VAR or a CONST decl node is created. */ RECORD_TYPE is the type of the enclosing record. If SIZE is nonzero, it
#define create_var_decl(var_name, asm_name, type, var_init, \ is the specified size of the field. If POS is nonzero, it is the bit
const_flag, public_flag, extern_flag, \ position. PACKED is 1 if the enclosing record is packed, -1 if it has
static_flag, artificial_p, debug_info_p,\ Component_Alignment of Storage_Unit. If ADDRESSABLE is nonzero, it
attr_list, gnat_node) \
create_var_decl_1 (var_name, asm_name, type, var_init, \
const_flag, public_flag, extern_flag, \
static_flag, artificial_p, debug_info_p, \
true, attr_list, gnat_node)
/* 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. If SIZE is
nonzero, it is the specified size of the field. If POS is nonzero, it is
the bit position. PACKED is 1 if the enclosing record is packed, -1 if 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 name, tree type, tree record_type,
tree record_type, tree size, tree pos, tree size, tree pos, int packed,
int packed, int addressable); int addressable);
/* Return a PARM_DECL node. PARAM_NAME is the name of the parameter and /* Return a PARM_DECL node. NAME is the name of the parameter and TYPE is
PARAM_TYPE is its type. READONLY is true if the parameter is readonly its type. READONLY is true if the parameter is readonly (either an In
(either an In parameter or an address of a pass-by-ref parameter). */ parameter or an address of a pass-by-ref parameter). */
extern tree create_param_decl (tree param_name, tree param_type, extern tree create_param_decl (tree name, tree type, bool readonly);
bool readonly);
/* Return a LABEL_DECL with LABEL_NAME. GNAT_NODE is used for the position /* Return a LABEL_DECL with NAME. GNAT_NODE is used for the position of
of the decl. */ the decl. */
extern tree create_label_decl (tree label_name, Node_Id gnat_node); extern tree create_label_decl (tree name, Node_Id gnat_node);
/* Return a FUNCTION_DECL node. SUBPROG_NAME is the name of the subprogram, /* Return a FUNCTION_DECL node. NAME is the name of the subprogram, ASM_NAME
ASM_NAME is its assembler name, SUBPROG_TYPE is its type (a FUNCTION_TYPE its assembler name, TYPE its type (a FUNCTION_TYPE node), PARAM_DECL_LIST
node), PARAM_DECL_LIST is the list of the subprogram arguments (a list of the list of its parameters (a list of PARM_DECL nodes chained through the
PARM_DECL nodes chained through the DECL_CHAIN field). DECL_CHAIN field).
INLINE_STATUS, PUBLIC_FLAG, EXTERN_FLAG and ATTR_LIST are used to set the INLINE_STATUS, PUBLIC_FLAG, EXTERN_FLAG and ATTR_LIST are used to set the
appropriate fields in the FUNCTION_DECL. appropriate fields in the FUNCTION_DECL.
...@@ -743,8 +730,8 @@ extern tree create_label_decl (tree label_name, Node_Id gnat_node); ...@@ -743,8 +730,8 @@ extern tree create_label_decl (tree label_name, Node_Id gnat_node);
DEBUG_INFO_P is true if we need to write debug information for it. DEBUG_INFO_P is true if we need to write debug information for it.
GNAT_NODE is used for the position of the decl. */ GNAT_NODE is used for the position of the decl. */
extern tree create_subprog_decl (tree subprog_name, tree asm_name, extern tree create_subprog_decl (tree name, tree asm_name, tree type,
tree subprog_type, tree param_decl_list, tree param_decl_list,
enum inline_status_t inline_status, enum inline_status_t inline_status,
bool public_flag, bool extern_flag, bool public_flag, bool extern_flag,
bool artificial_p, bool debug_info_p, bool artificial_p, bool debug_info_p,
......
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