[cfe-dev] Bug: Lexer::getLocForEndOfToken() returns a position too far for a token which include backslash-newline pairs

John McCall rjmccall at apple.com
Tue Apr 5 10:46:12 PDT 2011


On Apr 5, 2011, at 10:37 AM, Marcin Kowalczyk wrote:
> On Tue, Apr 5, 2011 at 7:34 PM, Ted Kremenek <kremenek at apple.com> wrote:
>> 
>> What is the impact on performance here (if any)?
> 
> I would expect the corrected code to be slightly faster.
> getFileLocWithOffset() does mostly an addition, while
> AdvanceToTokenCharacter() scans the token character by character.

We can say more than that:  the corrected code should really be substantially
faster, because we're basically cutting the amount of work it does in half, but
it doesn't matter because this function is so far from being hot (except maybe
in the rewriter) that it would probably have to intentionally crash the compiler
to have a noticeable impact on compile time.

John.



More information about the cfe-dev mailing list