diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-10 11:35:08 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-10 11:35:08 +0000 |
commit | bde997b14f7789a8894154c58528c8ac5859beec (patch) | |
tree | eb51c7f72d8cc87b357039832b52bc246eb4bd9c /gcc/ada | |
parent | 0318c61afcf275173ab45c40bc9fd9b956289e66 (diff) | |
download | gcc-bde997b14f7789a8894154c58528c8ac5859beec.tar.gz |
* gcc-interface/decl.c (gnat_to_gnu_entity): Do not set DECL_ARTIFICIAL
on the reused DECL node coming from a renamed object.
Set DECL_IGNORED_P on the DECL node built for renaming entities if they
don't need debug info.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166530 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 16 |
2 files changed, 17 insertions, 6 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index c768d867423..0e522fddee1 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2010-11-10 Eric Botcazou <ebotcazou@adacore.com> + + * gcc-interface/decl.c (gnat_to_gnu_entity): Do not set DECL_ARTIFICIAL + on the reused DECL node coming from a renamed object. + Set DECL_IGNORED_P on the DECL node built for renaming entities if they + don't need debug info. + 2010-11-09 Eric Botcazou <ebotcazou@adacore.com> * gcc-interface/utils.c (save_gnu_tree): Improve comments. diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index c2b82786a84..71816538682 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -4894,13 +4894,17 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) Set_RM_Size (gnat_entity, annotate_value (rm_size (gnu_type))); } - if (!Comes_From_Source (gnat_entity) && DECL_P (gnu_decl)) - DECL_ARTIFICIAL (gnu_decl) = 1; + /* 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)) + { + if (!Comes_From_Source (gnat_entity)) + DECL_ARTIFICIAL (gnu_decl) = 1; - if (!debug_info_p && DECL_P (gnu_decl) - && TREE_CODE (gnu_decl) != FUNCTION_DECL - && No (Renamed_Object (gnat_entity))) - DECL_IGNORED_P (gnu_decl) = 1; + if (!debug_info_p && TREE_CODE (gnu_decl) != FUNCTION_DECL) + DECL_IGNORED_P (gnu_decl) = 1; + } /* If we haven't already, associate the ..._DECL node that we just made with the input GNAT entity node. */ |