[Ada] restore setting of DECL_ARTIFICIAL & DECL_IGNORED_P

Eric Botcazou ebotcazou@adacore.com
Fri Jun 19 20:35:00 GMT 2015


After the merge of the debug-early branch, the Ada compiler now sets the 
DECL_ARTIFICIAL and DECL_IGNORED_P flags too late for them to be taken into 
account by the debug back-end.

Only for variables actually.  In fact the current state of affairs is a bit 
convoluted: for types, we set DECL_ARTIFICIAL & DECL_IGNORED_P at creation 
time (create_type_decl takes corresponding parameters), for subprograms we 
only set DECL_ARTIFICIAL at creation time (create_subprog_decl takes the 
corresponding parameter) but setting DECL_IGNORED_P late still works, for 
variables we set nothing at creation time and this is now broken.

Tested on x86_64-suse-linux, applied on the mainline.


2015-06-19  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/gigi.h (record_builtin_type): Adjust comment.
	(tree create_type_decl): Likewise.
	(create_var_decl_1): Add artificial_p and debug_info_p parameters.
	(create_var_decl): Likewise.
	(create_true_var_decl): Delete.
	(create_subprog_decl): Add debug_info_p parameter.
	* gcc-interface/decl.c (gnat_to_gnu_entity): Add artificial_p local
	variable and use it throughout.  Remove DECL_ARTIFICIAL settings.
	<E_Variable>: Adjust calls to create_var_decl and create_var_decl_1.
	Remove DECL_IGNORED_P settings.
	<E_Enumeration_Type>: Likewise.
	<E_Record_Type>: Likewise.
	<E_Subprogram_Type>: Likewise.  Remove artificial_flag local variable.
	Adjust call to create_subprog_decl.
	(get_minimal_subprog_decl): Likewise.
	(elaborate_expression_1): Adjust call to create_var_decl.
	* gcc-interface/trans.c (gigi): Adjust calls to create_var_decl and
	create_subprog_decl.  Remove DECL_ARTIFICIAL & DECL_IGNORED_P settings.
	* gcc-interface/utils.c (maybe_pad_type): Likewise.
	(record_builtin_type): Adjust comment.
	(create_type_stub_decl): Remove obsolete comment.
	(create_var_decl_1): Add artificial_p and debug_info_p parameters.
	Set DECL_ARTIFICIAL and DECL_IGNORED_P accordingly.
	(create_subprog_decl): Add debug_info_p parameter.  Set DECL_IGNORED_P
	accordingly.


2015-06-19  Eric Botcazou  <ebotcazou@adacore.com>

	* gnat.dg/specs/debug1.ads: Adjust.


-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 39012 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150619/f2df639c/attachment.bin>


More information about the Gcc-patches mailing list