[cfe-commits] [PATCH] Supporting __declspec(align)

John McCall rjmccall at apple.com
Wed Jun 6 18:20:51 PDT 2012


On Jun 6, 2012, at 5:23 PM, Aaron Ballman wrote:
> On Mon, Jun 4, 2012 at 4:17 PM, Aaron Ballman <aaron at aaronballman.com> wrote:
>> This patch is to fix PR12631, and basically just turns on existing
>> functionality.  __declspec(align)'s behavior (documented on MSDN here:
>> <http://msdn.microsoft.com/en-us/library/83ythb65(v=vs.100).aspx>)
>> matches what we already support for __attribute__((aligned)).  I've
>> also included a test case to ensure the behavior matches expectations.

__attribute__((aligned)) is a little funny in that it's got multiple spellings
("align" and "aligned") and takes 0 or 1 arguments.  I think this patch will
make us accept "__declspec(align)" and "__declspec(aligned(16))";  I
assume that the latter is wrong and the former might be wrong.

In either case, you should be able to filter these easily by checking the
identifier info on the parsed attribute, as well as whether it has an
argument.  Please also test these possibilities.

John.



More information about the cfe-commits mailing list