[cfe-commits] r65570 - in /cfe/trunk: include/clang/Analysis/ include/clang/Basic/ include/clang/Driver/ include/clang/Parse/ lib/Analysis/ lib/Basic/ lib/Driver/ lib/Parse/ lib/Rewrite/ lib/Sema/ test/Parser/ test/SemaTemplate/

Sebastian Redl sebastian.redl at getdesigned.at
Fri Feb 27 10:34:11 PST 2009


Douglas Gregor wrote:
> On Feb 26, 2009, at 10:22 PM, Chris Lattner wrote:
>
>   
>>> +  // PrevTokLocation - The location of the token we previously
>>> +  // consumed. This token is used for diagnostics where we  
>>> expected to
>>> +  // see a token following another token (e.g., the ';' at the end  
>>> of
>>> +  // a statement).
>>> +  SourceLocation PrevTokLocation;
>>>       
>> Have you measured the perf impact of adding this?  I expect that  
>> this is just as expensive as adding one-token lookahead to the  
>> parser, and is not something that should be done lightly.  Notably,  
>> this impacts *all* reads from the preprocessor, not just the ones  
>> that could need the info.
>>     
>
> It's a copy of a 32-bit integer... but I'll check.
>
>   
Note that your code is not the only part to benefit from this. I added
some pretty ugly hacks to some functions when I implemented Declarator
source ranges, because I didn't dare add this variable. If this stays
in, I can remove those hacks.

Sebastian



More information about the cfe-commits mailing list