aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/decl.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2008-11-06 11:51:11 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2008-11-06 11:51:11 +0000
commit8d3323ded5f5707cf7faffa50925e9b22334eeec (patch)
treee694d5e18e099bc7b8c033c2307780963d572f6e /gcc/ada/gcc-interface/decl.c
parentbaf6e6a838df2137989ae6301150b1c0ddd0b87c (diff)
downloadgcc-8d3323ded5f5707cf7faffa50925e9b22334eeec.zip
gcc-8d3323ded5f5707cf7faffa50925e9b22334eeec.tar.gz
gcc-8d3323ded5f5707cf7faffa50925e9b22334eeec.tar.bz2
decl.c (gnat_to_gnu_entity): If not optimizing...
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Out_Parameter>: If not optimizing, create a PARM_DECL pointing to the VAR_DECL for debugging purposes. From-SVN: r141639
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r--gcc/ada/gcc-interface/decl.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index cdee227..188b896 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -1318,6 +1318,24 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
get_block_jmpbuf_decl ())),
gnat_entity);
+ /* If we are defining an Out parameter and we're not optimizing,
+ create a fake PARM_DECL for debugging purposes and make it
+ point to the VAR_DECL. Suppress debug info for the latter
+ but make sure it will still live on the stack so it can be
+ accessed from within the debugger through the PARM_DECL. */
+ if (kind == E_Out_Parameter && definition && !optimize)
+ {
+ tree param = create_param_decl (gnu_entity_id, gnu_type, false);
+ gnat_pushdecl (param, gnat_entity);
+ SET_DECL_VALUE_EXPR (param, gnu_decl);
+ DECL_HAS_VALUE_EXPR_P (param) = 1;
+ if (debug_info_p)
+ debug_info_p = false;
+ else
+ DECL_IGNORED_P (param) = 1;
+ TREE_ADDRESSABLE (gnu_decl) = 1;
+ }
+
/* If this is a public constant or we're not optimizing and we're not
making a VAR_DECL for it, make one just for export or debugger use.
Likewise if the address is taken or if either the object or type is