]> granicus.if.org Git - clang/commit
[Lex] Allow to consume tokens while preprocessing
authorIlya Biryukov <ibiryukov@google.com>
Fri, 17 May 2019 09:32:05 +0000 (09:32 +0000)
committerIlya Biryukov <ibiryukov@google.com>
Fri, 17 May 2019 09:32:05 +0000 (09:32 +0000)
commita3c314617033ec86c5a4eac093e301b359c48c9d
treeae6fdb4c15a2de1ce9cb25fd2ac5d5aa37b47fca
parent786546290e1a65c82093c02bbf7f3c7724afa8ca
[Lex] Allow to consume tokens while preprocessing

Summary:
By adding a hook to consume all tokens produced by the preprocessor.
The intention of this change is to make it possible to consume the
expanded tokens without re-runnig the preprocessor with minimal changes
to the preprocessor and minimal performance penalty when preprocessing
without recording the tokens.

The added hook is very low-level and reconstructing the expanded token
stream requires more work in the client code, the actual algorithm to
collect the tokens using this hook can be found in the follow-up change.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: eraman, nemanjai, kbarton, jsji, riccibruno, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D59885

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361007 91177308-0d34-0410-b5e6-96231b3b80d8
25 files changed:
include/clang/Lex/Preprocessor.h
include/clang/Lex/Token.h
include/clang/Lex/TokenLexer.h
include/clang/Parse/Parser.h
lib/Frontend/PrintPreprocessedOutput.cpp
lib/Lex/MacroArgs.cpp
lib/Lex/PPCaching.cpp
lib/Lex/PPDirectives.cpp
lib/Lex/PPLexerChange.cpp
lib/Lex/PPMacroExpansion.cpp
lib/Lex/Pragma.cpp
lib/Lex/Preprocessor.cpp
lib/Lex/TokenLexer.cpp
lib/Parse/ParseCXXInlineMethods.cpp
lib/Parse/ParseDecl.cpp
lib/Parse/ParseDeclCXX.cpp
lib/Parse/ParseExpr.cpp
lib/Parse/ParseExprCXX.cpp
lib/Parse/ParseObjc.cpp
lib/Parse/ParseOpenMP.cpp
lib/Parse/ParsePragma.cpp
lib/Parse/ParseStmtAsm.cpp
lib/Parse/ParseTemplate.cpp
lib/Parse/Parser.cpp
lib/Rewrite/HTMLRewrite.cpp