This is the mail archive of the
mailing list for the GCC project.
Re: Speed up some token processing
Nathan Sidwell <firstname.lastname@example.org> writes:
>> The major concern I have is that TV_LEX and TV_CPP are now not
>> usefully distinguishable. Perhaps we should remove one of them? Or
>> both, since timevar operations have substantial overhead and so the
>> numbers we get from them are probably not meaningful when they're
>> pushed and popped on every token?
> This is most likely correct. Can we address that in a separate patch?
>> Also, could you talk a little about the rationale for the testsuite
> Sure. Prior to this patch, '#' and '##' would be passed through
> to the C parser (whereas they'd be eaten by the C++ lexer). For both
> lexers, '@' would be eaten. This patch eats all those stray tokens before
> they hit the parser. The parser therefore didn't resynchronize the same
> way as before, so I inserted the dummy variable declarations to allow
> it to do error recovery before getting to the next stray token. (I'd
> forgotten that this patch changed that behaviour when writing it up, sorry.)
Okay, that makes sense. I don't think it's a big deal if the error
recovery behavior changes like that.
Patch is approved, if it hasn't been already.