This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Null variant discriminant-checking functions needed for front-end layout


Tested on i686-linux, commited on trunk

Discriminant-checking functions are normally not needed for a variant with
no components, so their generation was suppressed to eliminate the dead
code. However, when front-end type layout is enabled (such as for the
AAMP target), size functions are generated for variant records that depend
on being able to call the discriminant-checking functions of all variants.
Now, when the layout flag is set, the functions are now generated in all
cases.

See gnat.dg/specs/empty_variants.ads

2008-05-20  Gary Dismukes  <dismukes@adacore.com>
	    Hristian Kirtchev  <kirtchev@adacore.com>

	* exp_ch3.adb
	(Expand_N_Object_Declaration): Correct the condition which triggers the
	generation of a call to Displace when initializing a class-wide object.
	(Build_Dcheck_Functions): Build discriminant-checking for null variants
	when Frontend_Layout_On_Target is true to ensure that they're available
	for calling when a record variant size function is built in Layout.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]