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] Speed improvements for controlled types


This patch changes the implementation of controlled types so that in simple
cases, they are just as efficient as noncontrolled types where initialization
and cleanup is done by hand.

Tested on x86_64-pc-linux-gnu, committed on trunk

2015-05-27  Bob Duff  <duff@adacore.com>

	* exp_ch3.adb (Build_Array_Init_Proc, Build_Record_Init_Proc):
	Inline init_procs when the type has controlled parts. Remove
	obsolete comments about those init_procs -- init_procs for
	such types are no longer complex. A typical init_proc just
	initializes the 'Tag field, and calls the parent init_proc
	(e.g. for Limited_Controlled), which calls the grandparent
	(for Root_Controlled), which does nothing. This all boils down
	to one instruction when inlined.
	* exp_ch7.adb (Create_Finalizer): Inline the finalizer.

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]