diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-07-12 18:49:30 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-07-12 18:49:30 +0000 |
commit | 03569eaabceb14a20e23d043135fdccbc7309a96 (patch) | |
tree | f606419347f942c53e6940a4ec9aab79550c080b /include/clang/Lex/Preprocessor.h | |
parent | 1982c18522a4aefd57207bbd2d66d93945c41f92 (diff) |
If we are past tok::eof and in caching lex mode, avoid caching repeated tok::eofs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108175 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/Preprocessor.h')
-rw-r--r-- | include/clang/Lex/Preprocessor.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h index f90cb0a687..6c9b9fb96e 100644 --- a/include/clang/Lex/Preprocessor.h +++ b/include/clang/Lex/Preprocessor.h @@ -871,7 +871,11 @@ private: //===--------------------------------------------------------------------===// // Caching stuff. void CachingLex(Token &Result); - bool InCachingLexMode() const { return CurPPLexer == 0 && CurTokenLexer == 0;} + bool InCachingLexMode() const { + // If the Lexer pointers are 0 and IncludeMacroStack is empty, it means + // that we are past EOF, not that we are in CachingLex mode. + return CurPPLexer == 0 && CurTokenLexer == 0 && !IncludeMacroStack.empty(); + } void EnterCachingLexMode(); void ExitCachingLexMode() { if (InCachingLexMode()) |