diff options
author | Daniel Dunbar <daniel@zuster.org> | 2012-11-13 19:12:37 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2012-11-13 19:12:37 +0000 |
commit | 6e649737898ffb627c377fd8fa0a437d0a42ae4a (patch) | |
tree | 3d6329011b1ce91f0d114acfe9c015794721c004 /lib/Lex/Lexer.cpp | |
parent | e5afdcfd6a80efc20b0a2e5bde806c08c3bda887 (diff) |
Revert r167801, "[preprocessor] When #including something that contributes no
tokens at all,". This change broke External/Nurbs in LLVM test-suite.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167858 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Lexer.cpp')
-rw-r--r-- | lib/Lex/Lexer.cpp | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp index 6917645ca4..bf0883e12a 100644 --- a/lib/Lex/Lexer.cpp +++ b/lib/Lex/Lexer.cpp @@ -2594,14 +2594,8 @@ LexNextToken: // Read the PP instance variable into an automatic variable, because // LexEndOfFile will often delete 'this'. Preprocessor *PPCache = PP; - bool EnableIncludedEOFCache = EnableIncludedEOF; if (LexEndOfFile(Result, CurPtr-1)) // Retreat back into the file. return; // Got a token to return. - - if (EnableIncludedEOFCache) { - Result.setKind(tok::included_eof); - return; - } assert(PPCache && "Raw buffer::LexEndOfFile should return a token"); return PPCache->Lex(Result); } @@ -3239,21 +3233,5 @@ HandleDirective: } goto LexNextToken; // GCC isn't tail call eliminating. } - - if (PreprocessorLexer *PPLex = PP->getCurrentLexer()) { - // If we #include something that contributes no tokens at all, return with - // a tok::included_eof instead of recursively continuing lexing. - // This avoids a stack overflow with a sequence of many empty #includes. - PPLex->setEnableIncludedEOF(true); - PP->Lex(Result); - if (Result.isNot(tok::included_eof)) { - if (Result.isNot(tok::eof) && Result.isNot(tok::eod)) - PPLex->setEnableIncludedEOF(false); - return; - } - if (PP->isCurrentLexer(this)) - goto LexNextToken; - } - return PP->Lex(Result); } |