llvm-project/clang/lib/Lex
Argyrios Kyrtzidis b4c83a13f6 [Tooling/DependencyScanning & Preprocessor] Refactor dependency scanning to produce pre-lexed preprocessor directive tokens, instead of minimized sources
This is a commit with the following changes:

* Remove `ExcludedPreprocessorDirectiveSkipMapping` and related functionality

Removes `ExcludedPreprocessorDirectiveSkipMapping`; its intended benefit for fast skipping of excluded directived blocks
will be superseded by a follow-up patch in the series that will use dependency scanning lexing for the same purpose.

* Refactor dependency scanning to produce pre-lexed preprocessor directive tokens, instead of minimized sources

Replaces the "source minimization" mechanism with a mechanism that produces lexed dependency directives tokens.

* Make the special lexing for dependency scanning a first-class feature of the `Preprocessor` and `Lexer`

This is bringing the following benefits:

    * Full access to the preprocessor state during dependency scanning. E.g. a component can see what includes were taken and where they were located in the actual sources.
    * Improved performance for dependency scanning. Measurements with a release+thin-LTO build shows ~ -11% reduction in wall time.
    * Opportunity to use dependency scanning lexing to speed-up skipping of excluded conditional blocks during normal preprocessing (as follow-up, not part of this patch).

For normal preprocessing measurements show differences are below the noise level.

Since, after this change, we don't minimize sources and pass them in place of the real sources, `DependencyScanningFilesystem` is not technically necessary, but it has valuable performance benefits for caching file `stat`s along with the results of scanning the sources. So the setup of using the `DependencyScanningFilesystem` during a dependency scan remains.

Differential Revision: https://reviews.llvm.org/D125486
Differential Revision: https://reviews.llvm.org/D125487
Differential Revision: https://reviews.llvm.org/D125488
2022-05-26 12:50:06 -07:00
..
CMakeLists.txt [Tooling/DependencyScanning] Rename refactorings towards transitioning dependency scanning to use pre-lexed preprocessor directive tokens 2022-05-26 12:49:51 -07:00
DependencyDirectivesScanner.cpp [Tooling/DependencyScanning & Preprocessor] Refactor dependency scanning to produce pre-lexed preprocessor directive tokens, instead of minimized sources 2022-05-26 12:50:06 -07:00
HeaderMap.cpp [clang][lex] Remark on search path usage 2021-10-12 12:20:55 +02:00
HeaderSearch.cpp [clang] Track how headers get included generally during lookup time 2022-05-04 09:52:31 -07:00
InitHeaderSearch.cpp [PS5] Add basic PS5 driver behavior 2022-04-14 12:45:33 -07:00
Lexer.cpp [Tooling/DependencyScanning & Preprocessor] Refactor dependency scanning to produce pre-lexed preprocessor directive tokens, instead of minimized sources 2022-05-26 12:50:06 -07:00
LiteralSupport.cpp [Lex] Don't assert when decoding invalid UCNs. 2022-05-06 08:51:42 +02:00
MacroArgs.cpp
MacroInfo.cpp [Preprocessor] Reduce the memory overhead of `#define` directives (Recommit) 2022-02-14 09:27:44 -08:00
ModuleMap.cpp [clang][lex] NFCI: Use FileEntryRef in ModuleMap::diagnoseHeaderInclusion() 2022-04-20 20:27:13 +02:00
PPCaching.cpp [clang] Introduce SourceLocation::[U]IntTy typedefs. 2021-07-21 10:45:46 +01:00
PPCallbacks.cpp
PPConditionalDirectiveRecord.cpp Add support for #elifdef and #elifndef 2021-05-27 08:57:47 -04:00
PPDirectives.cpp [Tooling/DependencyScanning & Preprocessor] Refactor dependency scanning to produce pre-lexed preprocessor directive tokens, instead of minimized sources 2022-05-26 12:50:06 -07:00
PPExpressions.cpp [clang][preprocessor] Fix unsigned-ness of utf8 char literals 2022-05-13 07:57:10 +02:00
PPLexerChange.cpp [Tooling/DependencyScanning & Preprocessor] Refactor dependency scanning to produce pre-lexed preprocessor directive tokens, instead of minimized sources 2022-05-26 12:50:06 -07:00
PPMacroExpansion.cpp [clang] Fix __has_builtin 2022-05-19 11:34:42 -04:00
Pragma.cpp [NFC][Clang][Pragma] Remove unused variables 2022-04-24 14:50:59 +08:00
PreprocessingRecord.cpp [clang][lex] NFCI: Use FileEntryRef in PPCallbacks::InclusionDirective() 2022-04-14 10:46:12 +02:00
Preprocessor.cpp [Tooling/DependencyScanning & Preprocessor] Refactor dependency scanning to produce pre-lexed preprocessor directive tokens, instead of minimized sources 2022-05-26 12:50:06 -07:00
PreprocessorLexer.cpp [clang][lex] NFC: Use FileEntryRef in PreprocessorLexer::getFileEntry() 2022-04-15 15:16:17 +02:00
ScratchBuffer.cpp SourceManager: Make LastLineNoContentCache and ContentCache::SourceLineCache mutable, NFC 2020-10-23 13:22:47 -04:00
TokenConcatenation.cpp
TokenLexer.cpp [clang] Use llvm::reverse (NFC) 2021-12-17 16:51:42 -08:00
UnicodeCharSets.h Support Unicode 14 identifiers 2021-09-16 13:21:27 -04:00