[cfe-commits] patch: add "suitably aligned" value to TargetInfo

Eli Friedman eli.friedman at gmail.com
Thu Dec 15 19:18:20 PST 2011


On Thu, Dec 15, 2011 at 7:11 PM, Nick Lewycky <nlewycky at google.com> wrote:
> On 15 December 2011 19:07, Eli Friedman <eli.friedman at gmail.com> wrote:
>>
>> On Thu, Dec 15, 2011 at 6:49 PM, Nick Lewycky <nlewycky at google.com> wrote:
>> > The attached patch adds a method to Basic/TargetInfo to return the
>> > suitable
>> > alignment, above which any object is considered over-aligned. This value
>> > is
>> > also equal to the amount of alignment you're guaranteed to get out of
>> > malloc
>> > and equal to alignof(std::max_align_t).
>>
>> Looks like some irrelevant whitespace changes snuck in.
>
>
> I don't think so? The change to PS3PPU is not functional, but I had to audit
> it for this change anyways and I'm not going to notice and not fix the
> 80-column violation and the misaligned string.

A separate commit would be nice, but fine either way.

>> I haven't
>> looked carefully at the values you've chosen for various targets, but
>> otherwise looks okay.  What are you planning on using this for?
>
>
> I have a diagnostic in the works that warns about using global operator new
> to construct an over-aligned object. This is PR9527 (except that I'm warning
> on the site of the "new Cls" expr, not upon completion of the class).
>
> I'm mostly concerned about getting the right value for the various targets.

Okay.

-Eli




More information about the cfe-commits mailing list