[cfe-commits] r79941 - in /cfe/trunk: lib/Analysis/CFG.cpp test/SemaTemplate/fun-template-def.cpp
Douglas Gregor
dgregor at apple.com
Tue Aug 25 16:39:43 PDT 2009
On Aug 25, 2009, at 10:40 AM, Chris Lattner wrote:
>
> On Aug 25, 2009, at 8:30 AM, Douglas Gregor wrote:
>
>>>
>>> Ok point taken. Here's another way to look at it: is it
>>> worthwhile (in terms of compile time) to check all uninstantiated
>>> templates? It would be better to only do these "heavier" semantic
>>> checks on inline functions and templates that are actually used in
>>> a translation unit rather than in every translation unit that they
>>> are parsed in. This applies equally well to C inline functions as
>>> it does to all the fun C++ stuff, it's just that C++ will suffer
>>> more if we don't do something like this.
>>>
>>> Thoughts?
>>
>>
>> I find these checks useful (as a programmer), as much in
>> uninstantiated templates and inline functions as anywhere else.
>> However, I suggest that we delay this discussion until we can
>> quantify the actual compile-time cost on, e.g., <algorithm>,
>> <numeric>, or <iostream>.
>
> I don't disagree about either point. :) I'm just saying that one
> way to reduce the cost is to only check each inline function in
> translation units that use them. This doesn't help library authors,
> but does help application authors who (presumably) use every inline
> function at least once in their program.
Oh, I agree with you. But we're talking about a tradeoff between early
detection of problems and performance, but I don't know what we're
gaining on the performance end.
> Deferring it is fine with me though :)
It's in my calendar to revisit at the point when I think we'll be able
to parse <algorithm> well enough to measure something :)
- Doug
More information about the cfe-commits
mailing list