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] Implement pragma Default_Storage_Pool


This patch implements AI05-0193-1, which introduces a new attribute
Max_Alignment_For_Allocation, analogous to Max_Size_In_Storage_Elements, but
for alignment instead of size. It returns an upper bound on the Alignment that
can be passed to Allocate.

The following test should run silently.

gnatmake -gnat2012 -gnata -g test_max_alignment_for_allocation.adb

procedure Test_Max_Alignment_For_Allocation is
begin
   pragma Assert (String'Alignment = 1);
   pragma Assert (String'Max_Alignment_For_Allocation = 16);
   null;
end Test_Max_Alignment_For_Allocation;

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

2010-10-19  Bob Duff  <duff@adacore.com>

	* sem_attr.adb (Eval_Attribute): Implement Max_Alignment_For_Allocation
	attribute.
	* exp_attr.adb (Expand_N_Attribute_Reference): Add
	Attribute_Max_Alignment_For_Allocation to the case statement.
	* snames.ads-tmpl (Name_Max_Alignment_For_Allocation,
	Attribute_Max_Alignment_For_Allocation): New attribute name.

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]