[cfe-commits] r155988 - /cfe/trunk/lib/Parse/Parser.cpp

Richard Smith richard at metafoo.co.uk
Wed May 2 13:19:52 PDT 2012


On Wed, May 2, 2012 at 7:34 AM, Douglas Gregor <dgregor at apple.com> wrote:

> Author: dgregor
> Date: Wed May  2 09:34:16 2012
> New Revision: 155988
>
> URL: http://llvm.org/viewvc/llvm-project?rev=155988&view=rev
> Log:
> Replace a ConsumeAnyToken() call with ConsumeToken() when we know
> we're looking at a normal token. Tiny positive impact -fsyntax-only
> time for <rdar://problem/11004361>.
>

If we no longer intend to ensure ConsumeCodeCompletionToken() is called to
consume a code_completion token, is there any value in keeping it around as
a separate function?

(I also wonder why we have a separate ConsumeStringToken function, given
that it does nothing special since translation phase 6 is performed
manually within the parser...)


> Modified:
>    cfe/trunk/lib/Parse/Parser.cpp
>
> Modified: cfe/trunk/lib/Parse/Parser.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=155988&r1=155987&r2=155988&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Parse/Parser.cpp (original)
> +++ cfe/trunk/lib/Parse/Parser.cpp Wed May  2 09:34:16 2012
> @@ -185,7 +185,7 @@
>
>  bool Parser::ExpectAndConsumeSemi(unsigned DiagID) {
>   if (Tok.is(tok::semi) || Tok.is(tok::code_completion)) {
> -    ConsumeAnyToken();
> +    ConsumeToken();
>     return false;
>   }
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120502/e6971103/attachment.html>


More information about the cfe-commits mailing list