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

Nick Lewycky nlewycky at google.com
Thu Dec 15 19:11:54 PST 2011


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.

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.

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20111215/5438c325/attachment.html>


More information about the cfe-commits mailing list