llvm-project/clang/lib/Tooling
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
..
ASTDiff
Core [libtooling][clang-tidy] Fix diagnostics not highlighting fed SourceRanges 2021-04-10 16:43:44 +02:00
DependencyScanning [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
DumpTool [clang] NFC: Extract DiagnosticOptions parsing 2021-09-02 14:37:14 +02:00
Inclusions Revert "[clang-format] SortIncludes should support "@import" lines in Objective-C" 2022-04-28 11:00:32 +02:00
Refactoring [clang-rename] Handle designated initializers. 2021-04-12 13:15:14 -07:00
Syntax Reapply [pseudo] Move pseudoparser from clang to clang-tools-extra" 2022-03-16 01:10:55 +01:00
Transformer [libTooling] Support TransformerResult<void> in consumer callbacks 2022-03-28 15:39:46 +00:00
AllTUsExecution.cpp ADT: Allow IntrusiveRefCntPtr construction from std::unique_ptr, NFC 2020-12-08 17:33:19 -08:00
ArgumentsAdjusters.cpp [clang][deps] Move stripping of diagnostic serialization from `clang-scan-deps` to `DependencyScanning` library 2021-06-14 12:23:32 +02:00
CMakeLists.txt [cmake] use project relative paths when generating ASTNodeAPI.json 2021-11-15 12:35:34 +01:00
CommonOptionsParser.cpp [clang] Replace report_fatal_error(std::string) uses with report_fatal_error(Twine) 2021-10-06 11:43:19 +01:00
CompilationDatabase.cpp [CompilationDatabase] Pass Twine by const reference instead of by value. NFCI. 2021-01-07 12:53:28 +00:00
EmptyNodeIntrospection.inc.in [AST] Add DeclarationNameInfo to node introspection 2021-04-25 12:12:03 +01:00
Execution.cpp
ExpandResponseFilesCompilationDatabase.cpp [Support] Expand `<CFGDIR>` as the base directory in configuration files. 2021-12-30 13:43:47 -05:00
FileMatchTrie.cpp [clang][Tooling] Try to avoid file system access if there is no record for the file in compile_commads.json 2020-07-17 18:49:14 +02:00
FixIt.cpp
GuessTargetAndModeCompilationDatabase.cpp
InterpolatingCompilationDatabase.cpp compile commands header to source heuristic lower-cases filenames before inferring file types 2022-04-25 20:40:56 +02:00
JSONCompilationDatabase.cpp [clang][Tooling] Use Windows command lines on all Windows, except Cygwin 2021-10-13 22:55:14 +03:00
NodeIntrospection.cpp [AST] Sort introspection results without instantiating other data 2021-04-23 16:21:01 +01:00
Refactoring.cpp
RefactoringCallbacks.cpp
StandaloneExecution.cpp
Tooling.cpp [clang][tooling] Properly initialize DiagnosticsEngine for cc1 command-line construction 2021-09-10 13:54:24 +02:00