[cfe-commits] r61746 - in /cfe/trunk: include/clang/AST/ include/clang/Basic/ include/clang/Parse/ lib/AST/ lib/Parse/ lib/Sema/ test/SemaCXX/
Chris Lattner
clattner at apple.com
Mon Jan 5 22:28:58 PST 2009
On Jan 5, 2009, at 10:26 PM, Douglas Gregor wrote:
>>> Most declarations of a class type will need to perform the check
>>> for a POD type, which is recursive (it's only a POD if all of its
>>> non-static data members are PODs, and so on), so it might be
>>> expensive to compute this property on the fly. Personally, I
>>> prefer the way Sebastian's doing it: there will be quite a few
>>> other class properties like this, too.
>>
>> What if the query is lazy but cached? Many types are defined in
>> headers that are never used, I can't believe that we'd end up
>> querying isPod for all of them...
>
> We could certainly make the query lazy but cached, but why? The most
> expensive check needed to maintain this flag is "if (!T-
> >isPODType())".
I'm not "afraid" of the cost to compute pod-ness eagerly or the bit to
store it in. I'm most interested in getting the "compute whether this
type is pod" code together in one place. However, I can't stomach the
cost of doing a post-pass over the type (instead of doing it on the
fly like Sebastian is doing), so it is probably fine to stay the way
it is now.
-Chris
More information about the cfe-commits
mailing list