[PATCH] Make Preprocessor::Lex non-recursive

Eli Friedman eli.friedman at gmail.com
Wed Sep 18 16:11:45 PDT 2013

On Wed, Sep 18, 2013 at 3:45 PM, Richard Smith <richard at metafoo.co.uk>wrote:

> On Wed, Sep 18, 2013 at 3:44 PM, Richard Smith <richard at metafoo.co.uk>wrote:
>> A modules-related change seems to have slipped into
>> lib/Frontend/CompilerInstance.cpp
Ah, yes, thanks; fixed in my local copy.

>> The IsAtStartOfLine FIXME concerns me a little. Token.h says:
>>     StartOfLine   = 0x01,  // At start of line or only after whitespace.
>> ... which implies to me that the intent was that it be false if there's a
>> preceding EMPTY macro. I'm not sure if that's what the existing users of
>> the macro want, though.
> Um, users of the flag.

The current users of the flag expect the current behavior, which ignores
empty macros.  The canonical example is PrintPreprocessedOutput, which uses
it to indicate whether it needs to insert a newline between two tokens, the
behavior being tested in test/Preprocessor/hash_line.c.  This patch doesn't
change our behavior here outside of the IDENTITY() case.  I'll update the

What happens if the Lex call in isNextPPTokenLParen returns false?
Lex never returns false if we're lexing in raw mode.  I'll add an assertion
to that effect.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130918/58ad6372/attachment.html>

More information about the cfe-commits mailing list