diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2010-09-19 13:12:13 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2010-09-19 13:12:13 +0000 |
commit | 50a6af053af7a89702c7093eec85b717257e88bc (patch) | |
tree | 32a41fb13fdcec0a8ebbccafdb8ca11ceb9759ca /gcc/ada/gcc-interface/decl.c | |
parent | b146446c53f525ad953fc7a886baceca17c74e9a (diff) | |
download | gcc-50a6af053af7a89702c7093eec85b717257e88bc.zip gcc-50a6af053af7a89702c7093eec85b717257e88bc.tar.gz gcc-50a6af053af7a89702c7093eec85b717257e88bc.tar.bz2 |
decl.c (gnat_to_gnu_entity): Look into expressions for external constants that are aggregates.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: Look into
expressions for external constants that are aggregates.
* gcc-interface/utils2.c (build_simple_component_ref): If the field
is an inherited component in an extension, look through the extension.
From-SVN: r164414
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 75cdb84..6d77ffb 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -421,17 +421,15 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) } /* If we have an external constant that we are not defining, get the - expression that is was defined to represent. We may throw that - expression away later if it is not a constant. Do not retrieve the - expression if it is an aggregate or allocator, because in complex - instantiation contexts it may not be expanded */ + expression that is was defined to represent. We may throw it away + later if it is not a constant. But do not retrieve the expression + if it is an allocator because the designated type might be dummy + at this point. */ if (!definition - && Present (Expression (Declaration_Node (gnat_entity))) && !No_Initialization (Declaration_Node (gnat_entity)) - && (Nkind (Expression (Declaration_Node (gnat_entity))) - != N_Aggregate) - && (Nkind (Expression (Declaration_Node (gnat_entity))) - != N_Allocator)) + && Present (Expression (Declaration_Node (gnat_entity))) + && Nkind (Expression (Declaration_Node (gnat_entity))) + != N_Allocator) gnu_expr = gnat_to_gnu (Expression (Declaration_Node (gnat_entity))); /* Ignore deferred constant definitions without address clause since |