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>
* 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,
artificial, has_checks and warned_aggressive_loop_optimizations.
(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)
/* Now create the variable or the constant and set various flags. */
gnu_decl
= create_var_decl_1 (gnu_entity_name, gnu_ext_name, gnu_type,
gnu_expr, const_flag, Is_Public (gnat_entity),
imported_p || !definition, static_p,
artificial_p, debug_info_p, !renamed_obj,
attr_list, gnat_entity);
= create_var_decl (gnu_entity_name, gnu_ext_name, gnu_type,
gnu_expr, const_flag, Is_Public (gnat_entity),
imported_p || !definition, static_p,
artificial_p, debug_info_p, attr_list,
gnat_entity, !renamed_obj);
DECL_BY_REF_P (gnu_decl) = used_by_ref;
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);
......@@ -1497,11 +1497,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
|| Is_Aliased (Etype (gnat_entity))))
{
tree gnu_corr_var
= create_var_decl_1 (gnu_entity_name, gnu_ext_name, gnu_type,
gnu_expr, true, Is_Public (gnat_entity),
!definition, static_p, artificial_p,
debug_info_p, false, attr_list,
gnat_entity);
= create_var_decl (gnu_entity_name, gnu_ext_name, gnu_type,
gnu_expr, true, Is_Public (gnat_entity),
!definition, static_p, artificial_p,
debug_info_p, attr_list, gnat_entity,
false);
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,
sizetype is used. */
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.
TYPE_NAME gives the name of the type and TYPE is a ..._TYPE node giving
its data type. */
extern tree create_type_stub_decl (tree type_name, tree type);
/* Return a TYPE_DECL node. TYPE_NAME gives the name of the type and TYPE
is a ..._TYPE node giving its data type. ARTIFICIAL_P is true if the
declaration was generated by the compiler. DEBUG_INFO_P is true if we
need to write debug information about this type. GNAT_NODE is used for
the position of the decl. */
extern tree create_type_decl (tree type_name, tree type, bool artificial_p,
/* Return a TYPE_DECL node suitable for the TYPE_STUB_DECL field of TYPE.
NAME gives the name of the type to be used in the declaration. */
extern tree create_type_stub_decl (tree name, tree type);
/* Return a TYPE_DECL node for TYPE. NAME gives the name of the type to be
used in the declaration. ARTIFICIAL_P is true if the declaration was
generated by the compiler. DEBUG_INFO_P is true if we need to write
debug information about this type. GNAT_NODE is used for the position
of the decl. */
extern tree create_type_decl (tree name, tree type, bool artificial_p,
bool debug_info_p, Node_Id gnat_node);
/* Return a VAR_DECL or CONST_DECL node.
VAR_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
NAME gives the name of the variable. ASM_NAME is its assembler name
(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.
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,
DEBUG_INFO_P is true if we need to write debug information for it.
GNAT_NODE is used for the position of the decl. */
extern tree
create_var_decl_1 (tree var_name, tree asm_name, tree type, tree var_init,
bool const_flag, bool public_flag, bool extern_flag,
bool static_flag, bool artificial_p, bool debug_info_p,
bool const_decl_allowed_p, struct attrib *attr_list,
Node_Id gnat_node);
/* Wrapper around create_var_decl_1 for cases where we don't care whether
a VAR or a CONST decl node is created. */
#define create_var_decl(var_name, asm_name, type, var_init, \
const_flag, public_flag, extern_flag, \
static_flag, artificial_p, debug_info_p,\
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
extern tree create_var_decl (tree name, tree asm_name, tree type, tree init,
bool const_flag, bool public_flag,
bool extern_flag, bool static_flag,
bool artificial_p, bool debug_info_p,
struct attrib *attr_list, Node_Id gnat_node,
bool const_decl_allowed_p = true);
/* Return a FIELD_DECL node. NAME is the field's name, 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,
we should not make a bitfield, which is used by make_aligning_type. */
extern tree create_field_decl (tree field_name, tree field_type,
tree record_type, tree size, tree pos,
int packed, int addressable);
extern tree create_field_decl (tree name, tree type, tree record_type,
tree size, tree pos, int packed,
int addressable);
/* Return a PARM_DECL node. PARAM_NAME is the name of the parameter and
PARAM_TYPE is its type. READONLY is true if the parameter is readonly
(either an In parameter or an address of a pass-by-ref parameter). */
extern tree create_param_decl (tree param_name, tree param_type,
bool readonly);
/* Return a PARM_DECL node. NAME is the name of the parameter and TYPE is
its type. READONLY is true if the parameter is readonly (either an In
parameter or an address of a pass-by-ref parameter). */
extern tree create_param_decl (tree name, tree type, bool readonly);
/* Return a LABEL_DECL with LABEL_NAME. GNAT_NODE is used for the position
of the decl. */
extern tree create_label_decl (tree label_name, Node_Id gnat_node);
/* Return a LABEL_DECL with NAME. GNAT_NODE is used for the position of
the decl. */
extern tree create_label_decl (tree name, Node_Id gnat_node);
/* 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
node), PARAM_DECL_LIST is the list of the subprogram arguments (a list of
PARM_DECL nodes chained through the DECL_CHAIN field).
/* Return a FUNCTION_DECL node. NAME is the name of the subprogram, ASM_NAME
its assembler name, TYPE its type (a FUNCTION_TYPE node), PARAM_DECL_LIST
the list of its parameters (a list of PARM_DECL nodes chained through the
DECL_CHAIN field).
INLINE_STATUS, PUBLIC_FLAG, EXTERN_FLAG and ATTR_LIST are used to set the
appropriate fields in the FUNCTION_DECL.
......@@ -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.
GNAT_NODE is used for the position of the decl. */
extern tree create_subprog_decl (tree subprog_name, tree asm_name,
tree subprog_type, tree param_decl_list,
extern tree create_subprog_decl (tree name, tree asm_name, tree type,
tree param_decl_list,
enum inline_status_t inline_status,
bool public_flag, bool extern_flag,
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