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/decl.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/decl.c')
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 185df85..c8e662e 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -3934,6 +3934,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) bool public_flag = Is_Public (gnat_entity) || imported_p; bool extern_flag = (Is_Public (gnat_entity) && !definition) || imported_p; + bool artificial_flag = !Comes_From_Source (gnat_entity); /* The semantics of "pure" in Ada essentially matches that of "const" in the back-end. In particular, both properties are orthogonal to the "nothrow" property if the EH circuitry is explicit in the @@ -4379,9 +4380,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) } else if (kind == E_Subprogram_Type) - gnu_decl = create_type_decl (gnu_entity_name, gnu_type, attr_list, - !Comes_From_Source (gnat_entity), - debug_info_p, gnat_entity); + gnu_decl + = create_type_decl (gnu_entity_name, gnu_type, attr_list, + artificial_flag, debug_info_p, gnat_entity); else { if (has_stub) @@ -4389,21 +4390,21 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) gnu_stub_name = gnu_ext_name; gnu_ext_name = create_concat_name (gnat_entity, "internal"); public_flag = false; + artificial_flag = true; } - gnu_decl = create_subprog_decl (gnu_entity_name, gnu_ext_name, - gnu_type, gnu_param_list, - inline_flag, public_flag, - extern_flag, attr_list, - gnat_entity); + gnu_decl + = create_subprog_decl (gnu_entity_name, gnu_ext_name, gnu_type, + gnu_param_list, inline_flag, public_flag, + extern_flag, artificial_flag, attr_list, + gnat_entity); if (has_stub) { tree gnu_stub_decl = create_subprog_decl (gnu_entity_name, gnu_stub_name, gnu_stub_type, gnu_stub_param_list, - inline_flag, true, - extern_flag, attr_list, - gnat_entity); + inline_flag, true, extern_flag, + false, attr_list, gnat_entity); SET_DECL_FUNCTION_STUB (gnu_decl, gnu_stub_decl); } @@ -4928,14 +4929,16 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) } /* If we really have a ..._DECL node, set a couple of flags on it. But we - cannot do that if we are reusing the ..._DECL node made for a renamed - object, since the predicates don't apply to it but to GNAT_ENTITY. */ - if (DECL_P (gnu_decl) && !(Present (Renamed_Object (gnat_entity)) && saved)) + cannot do so if we are reusing the ..._DECL node made for an alias or a + renamed object as the predicates don't apply to it but to GNAT_ENTITY. */ + if (DECL_P (gnu_decl) + && !Present (Alias (gnat_entity)) + && !(Present (Renamed_Object (gnat_entity)) && saved)) { if (!Comes_From_Source (gnat_entity)) DECL_ARTIFICIAL (gnu_decl) = 1; - if (!debug_info_p && TREE_CODE (gnu_decl) != FUNCTION_DECL) + if (!debug_info_p) DECL_IGNORED_P (gnu_decl) = 1; } |