aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r--gcc/ada/gcc-interface/utils.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 1031ee9..2e81c18 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -1795,7 +1795,7 @@ value_factor_p (tree value, HOST_WIDE_INT factor)
return false;
}
-/* Given 2 consecutive field decls PREV_FIELD and CURR_FIELD, return true
+/* Given two consecutive field decls PREV_FIELD and CURR_FIELD, return true
unless we can prove these 2 fields are laid out in such a way that no gap
exist between the end of PREV_FIELD and the beginning of CURR_FIELD. OFFSET
is the distance in bits between the end of PREV_FIELD and the starting
@@ -1841,7 +1841,7 @@ potential_alignment_gap (tree prev_field, tree curr_field, tree offset)
return true;
}
-/* Returns a LABEL_DECL node for LABEL_NAME. */
+/* Return a LABEL_DECL node for LABEL_NAME. */
tree
create_label_decl (tree label_name)
@@ -1856,24 +1856,26 @@ create_label_decl (tree label_name)
return label_decl;
}
-/* Returns 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
node), PARAM_DECL_LIST is the list of the subprogram arguments (a list of
PARM_DECL nodes chained through the TREE_CHAIN field).
- INLINE_FLAG, PUBLIC_FLAG, EXTERN_FLAG, and ATTR_LIST are used to set the
- appropriate fields in the FUNCTION_DECL. GNAT_NODE gives the location. */
+ 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 for the position of the decl. */
tree
-create_subprog_decl (tree subprog_name, tree asm_name,
- tree subprog_type, tree param_decl_list, bool inline_flag,
- bool public_flag, bool extern_flag,
- struct attrib *attr_list, Node_Id gnat_node)
+create_subprog_decl (tree subprog_name, tree asm_name, tree subprog_type,
+ tree param_decl_list, bool inline_flag, bool public_flag,
+ bool extern_flag, bool artificial_flag,
+ struct attrib *attr_list, Node_Id gnat_node)
{
tree subprog_decl = build_decl (input_location, FUNCTION_DECL, subprog_name,
subprog_type);
tree result_decl = build_decl (input_location, RESULT_DECL, NULL_TREE,
TREE_TYPE (subprog_type));
+ DECL_ARGUMENTS (subprog_decl) = param_decl_list;
/* If this is a non-inline function nested inside an inlined external
function, we cannot honor both requests without cloning the nested
@@ -1887,13 +1889,15 @@ create_subprog_decl (tree subprog_name, tree asm_name,
&& DECL_EXTERNAL (current_function_decl))
DECL_DECLARED_INLINE_P (current_function_decl) = 0;
- DECL_EXTERNAL (subprog_decl) = extern_flag;
- TREE_PUBLIC (subprog_decl) = public_flag;
- TREE_READONLY (subprog_decl) = TYPE_READONLY (subprog_type);
+ DECL_ARTIFICIAL (subprog_decl) = artificial_flag;
+ DECL_EXTERNAL (subprog_decl) = extern_flag;
+ DECL_DECLARED_INLINE_P (subprog_decl) = inline_flag;
+ DECL_NO_INLINE_WARNING_P (subprog_decl) = inline_flag && artificial_flag;
+
+ TREE_PUBLIC (subprog_decl) = public_flag;
+ TREE_READONLY (subprog_decl) = TYPE_READONLY (subprog_type);
TREE_THIS_VOLATILE (subprog_decl) = TYPE_VOLATILE (subprog_type);
TREE_SIDE_EFFECTS (subprog_decl) = TYPE_VOLATILE (subprog_type);
- DECL_DECLARED_INLINE_P (subprog_decl) = inline_flag;
- DECL_ARGUMENTS (subprog_decl) = param_decl_list;
DECL_ARTIFICIAL (result_decl) = 1;
DECL_IGNORED_P (result_decl) = 1;