diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2011-04-22 17:35:08 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2011-04-22 17:35:08 +0000 |
commit | 7d7fcb08c3e4f48c061a1987ec2445a11560c4e6 (patch) | |
tree | 3835a433d75a82dc790e95c7b83470ce5a833abe /gcc/ada/gcc-interface/utils.c | |
parent | 1b5f5069484e7b96a0e7f07db7cd014f61af0b4d (diff) | |
download | gcc-7d7fcb08c3e4f48c061a1987ec2445a11560c4e6.zip gcc-7d7fcb08c3e4f48c061a1987ec2445a11560c4e6.tar.gz gcc-7d7fcb08c3e4f48c061a1987ec2445a11560c4e6.tar.bz2 |
gigi.h (create_subprog_decl): Add ARTIFICIAL_FLAG parameter.
* gcc-interface/gigi.h (create_subprog_decl): Add ARTIFICIAL_FLAG
parameter.
* gcc-interface/utils.c (create_subprog_decl): Likewise. Set
DECL_ARTIFICIAL and DECL_NO_INLINE_WARNING_P on the DECL accordingly.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Subprogram_Type>: Add
ARTIFICIAL_FLAG local variable and pass it to create_subprog_decl.
<all>: Do not set flags on the reused DECL node coming from an alias.
Set DECL_IGNORED_P on the DECL node built for subprograms if they
don't need debug info here...
* gcc-interface/trans.c (Subprogram_Body_to_gnu): ...and not here.
(gigi): Adjust calls to create_subprog_decl.
(build_raise_check): Likewise.
(establish_gnat_vms_condition_handler): Likewise.
(Compilation_Unit_to_gnu): Likewise.
(gnat_to_gnu): Likewise.
From-SVN: r172862
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 32 |
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; |