diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2012-02-15 08:39:04 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2012-02-15 08:39:04 +0000 |
commit | 0029bafd89b2bd403d96a053acefc2d341b85788 (patch) | |
tree | da3e0cc5d7128e03e92bf08e1b69abfabef2b3dc /gcc | |
parent | 4a582c9fda392a8218c427c60fe6378956de1831 (diff) | |
download | gcc-0029bafd89b2bd403d96a053acefc2d341b85788.zip gcc-0029bafd89b2bd403d96a053acefc2d341b85788.tar.gz gcc-0029bafd89b2bd403d96a053acefc2d341b85788.tar.bz2 |
trans.c (gnat_to_gnu): If the type is tagged, mark it as used for debugging purposes.
* gcc-interface/trans.c (gnat_to_gnu) <N_Qualified_Expression>: If the
type is tagged, mark it as used for debugging purposes.
<N_Allocator>: Likewise for a qualified expression.
From-SVN: r184258
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/trans.c | 20 |
2 files changed, 21 insertions, 7 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 9b62238..04a66c5 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,8 +1,14 @@ 2012-02-15 Eric Botcazou <ebotcazou@adacore.com> + * gcc-interface/trans.c (gnat_to_gnu) <N_Qualified_Expression>: If the + type is tagged, mark it as used for debugging purposes. + <N_Allocator>: Likewise for a qualified expression. + +2012-02-15 Eric Botcazou <ebotcazou@adacore.com> + * gcc-interface/trans.c (call_to_gnu): Create the temporary for the return value in the by-reference return type case if this isn't the - expression of an object declaration. Tidy up. + expression of an object declaration. Tidy up. 2012-02-09 Tristan Gingold <gingold@adacore.com> diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index e310004..a99c967 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -5518,6 +5518,13 @@ gnat_to_gnu (Node_Id gnat_node) gnu_result = gnat_to_gnu (Expression (gnat_node)); gnu_result_type = get_unpadded_type (Etype (gnat_node)); + /* If this is a qualified expression for a tagged type, we mark the type + as used. Because of polymorphism, this might be the only reference to + the tagged type in the program while objects have it as dynamic type. + The debugger needs to see it to display these objects properly. */ + if (kind == N_Qualified_Expression && Is_Tagged_Type (Etype (gnat_node))) + used_types_insert (gnu_result_type); + gnu_result = convert_with_check (Etype (gnat_node), gnu_result, Do_Overflow_Check (gnat_node), @@ -5865,18 +5872,19 @@ gnat_to_gnu (Node_Id gnat_node) if (Is_Elementary_Type (gnat_desig_type) || Is_Constrained (gnat_desig_type)) - { - gnu_type = gnat_to_gnu_type (gnat_desig_type); - gnu_init = convert (gnu_type, gnu_init); - } + gnu_type = gnat_to_gnu_type (gnat_desig_type); else { gnu_type = gnat_to_gnu_type (Etype (Expression (gnat_temp))); if (TREE_CODE (gnu_type) == UNCONSTRAINED_ARRAY_TYPE) gnu_type = TREE_TYPE (gnu_init); - - gnu_init = convert (gnu_type, gnu_init); } + + /* See the N_Qualified_Expression case for the rationale. */ + if (Is_Tagged_Type (gnat_desig_type)) + used_types_insert (gnu_type); + + gnu_init = convert (gnu_type, gnu_init); } else gcc_unreachable (); |