[cfe-commits] r137653 - in /cfe/trunk:

Richard Smith richard at metafoo.co.uk
Tue Aug 23 05:38:37 PDT 2011


On Sun, August 21, 2011 13:37, Enea Zaffanella wrote:
> Il 15/08/2011 23:04, Richard Smith ha scritto:
>> Author: rsmith
>> Date: Mon Aug 15 16:04:07 2011
>> New Revision: 137653
>>
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=137653&view=rev
>> Log:
>> Track in the AST whether a function is constexpr.
>
> Have you considered using an attribute (rather than a flag) for storing
> the constexpr specifier?

I'm a little concerned about the memory (and to a lesser extent, performance)
impact of this. I expect that the constexpr specifier will be used frequently
(especially in headers) in C++11, and a lot of (implicitly- or
explicitly-)defaulted constructors will be constexpr. It looks like adding the
first Attr to a Decl on a 64-bit platform costs about 48 bytes. However, I
would like to track the location of the 'constexpr' specifier in the AST, and
this seems like a reasonable way of doing it.

I'll do some experimentation with this when more of the constexpr
implementation is in place.

Thanks,
Richard




More information about the cfe-commits mailing list