[clang-scan-deps] Implementation of dependency scanner over minimized sources
authorAlex Lorenz <arphaman@gmail.com>
Tue, 6 Aug 2019 20:43:25 +0000 (20:43 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Tue, 6 Aug 2019 20:43:25 +0000 (20:43 +0000)
commite1f4c4aad27992d6b8a0b8d85af42c14fa68c298
tree82d894bcc36d70ad55cf69960f89683730a99578
parente4bd38478b38ab752af54b380da9f265fd90ba72
[clang-scan-deps] Implementation of dependency scanner over minimized sources

This commit implements the fast dependency scanning mode in clang-scan-deps: the
preprocessing is done on files that are minimized using the dependency directives source minimizer.

A shared file system cache is used to ensure that the file system requests and source minimization
is performed only once. The cache assumes that the underlying filesystem won't change during the course
of the scan (or if it will, it will not affect the output), and it can't be evicted. This means that the
service and workers can be used for a single run of a dependency scanner, and can't be reused across multiple,
incremental runs. This is something that we'll most likely support in the future though.
Note that the driver still utilizes the underlying real filesystem.

This commit is also still missing the fast skipped PP block skipping optimization that I mentioned at EuroLLVM talk.
Additionally, the file manager is still not reused by the threads as well.

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

llvm-svn: 368086
17 files changed:
clang/include/clang/Basic/FileManager.h
clang/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h [new file with mode: 0644]
clang/include/clang/Tooling/DependencyScanning/DependencyScanningService.h [new file with mode: 0644]
clang/include/clang/Tooling/DependencyScanning/DependencyScanningWorker.h
clang/lib/Tooling/DependencyScanning/CMakeLists.txt
clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp [new file with mode: 0644]
clang/lib/Tooling/DependencyScanning/DependencyScanningService.cpp [new file with mode: 0644]
clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
clang/test/ClangScanDeps/Inputs/frameworks/Framework.framework/Headers/Framework.h [new file with mode: 0644]
clang/test/ClangScanDeps/Inputs/frameworks/Framework.framework/PrivateHeaders/PrivateHeader.h [new file with mode: 0644]
clang/test/ClangScanDeps/Inputs/header_stat_before_open_cdb.json [new file with mode: 0644]
clang/test/ClangScanDeps/Inputs/vfsoverlay.yaml [new file with mode: 0644]
clang/test/ClangScanDeps/Inputs/vfsoverlay_cdb.json [new file with mode: 0644]
clang/test/ClangScanDeps/header_stat_before_open.m [new file with mode: 0644]
clang/test/ClangScanDeps/regular_cdb.cpp
clang/test/ClangScanDeps/vfsoverlay.cpp [new file with mode: 0644]
clang/tools/clang-scan-deps/ClangScanDeps.cpp