Sent from my iPhone
On Sep 6, 2011, at 10:59 AM, Argyrios Kyrtzidis <[email protected]> wrote: > On Aug 26, 2011, at 11:37 PM, Douglas Gregor wrote: > >> Author: dgregor >> Date: Sat Aug 27 01:37:51 2011 >> New Revision: 138704 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=138704&view=rev >> Log: >> Take an entirely different approach to handling the "parsing" of >> __import__ within the preprocessor, since the prior one foolishly >> assumed that Preprocessor::Lex() was re-entrant. We now handle >> __import__ at the top level (only), after macro expansion. This should >> fix the buildbot failures. >> > > [...] > >> /// Lex - To lex a token from the preprocessor, just pull a token from the >> /// current lexer or macro object. >> void Lex(Token &Result) { >> + ++LexDepth; >> if (CurLexer) >> CurLexer->Lex(Result); >> else if (CurPTHLexer) >> @@ -539,6 +543,11 @@ >> CurTokenLexer->Lex(Result); >> else >> CachingLex(Result); >> + --LexDepth; >> + >> + // If we have the __import__ keyword, handle the module import now. >> + if (Result.getKind() == tok::kw___import__ && LexDepth == 0) >> + HandleModuleImport(Result); >> } > > Lex() is one of those super hot methods, is it possible to avoid this > modification ? I get about -5.5% for -Eonly of Cocoa.h if I remove the > additions in Lex(). Ouch. I'll find another way. _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
