summaryrefslogtreecommitdiffstats
path: root/clang/test/ClangScanDeps/regular_cdb.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang][ScanDeps] Fix issue with multiple commands with the same input.Michael Spencer2019-10-311-3/+6
| | | | | | | | | | | | | | | | | | | Previously, given a CompilationDatabase with two commands for the same source file we would report that file twice with the union of the dependencies for each command both times. This was due to the way `ClangTool` runs actions given an input source file (see the comment in `DependencyScanningTool.cpp`). This commit adds a `SingleCommandCompilationDatabase` that is created with each `CompileCommand` in the original CDB, which is then used for each `ClangTool` invocation. This gives us a single run of `DependencyScanningAction` per `CompileCommand`. I looked at using `AllTUsToolExecutor` which is a parallel tool executor, but I'm not sure it's suitable for `clang-scan-deps` as it does a lot more sharing of state than `AllTUsToolExecutor` expects. Differential Revision: https://reviews.llvm.org/D69643
* [clang-scan-deps] Add dependency targetsJan Korous2019-09-121-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D67475 llvm-svn: 371697
* [clang-scan-deps] add skip excluded conditional preprocessor block ↵Alex Lorenz2019-09-111-0/+2
| | | | | | | | | | | | | | | preprocessing optimization This commit adds an optimization to clang-scan-deps and clang's preprocessor that skips excluded preprocessor blocks by bumping the lexer pointer, and not lexing the tokens until reaching appropriate #else/#endif directive. The skip positions and lexer offsets are computed when the file is minimized, directly from the minimized tokens. On an 18-core iMacPro with macOS Catalina Beta I got 10-15% speed-up from this optimization when running clang-scan-deps on the compilation database for a recent LLVM and Clang (3511 files). Differential Revision: https://reviews.llvm.org/D67127 llvm-svn: 371656
* [clang-scan-deps][NFC] Fix tests - prevent FileCheck matching test dir pathJan Korous2019-09-111-6/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D67379 llvm-svn: 371578
* clang-scan-deps: do not spawn threads when LLVM_ENABLE_THREADS is disabledAlex Lorenz2019-08-131-1/+0
| | | | llvm-svn: 368640
* Mark clang-scan-deps test as requiring thread supportReid Kleckner2019-08-081-0/+1
| | | | | | | Otherwise the test calls a pure virtual method and crashes. Perhaps this could be improved. llvm-svn: 368354
* [clang-scan-deps] Implementation of dependency scanner over minimized sourcesAlex Lorenz2019-08-061-3/+9
| | | | | | | | | | | | | | | | | | | 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
* [clang-scan-deps] print the dependencies to stdoutAlex Lorenz2019-06-211-11/+20
| | | | | | | | and remove the need to use -MD options in the CDB Differential Revision: https://reviews.llvm.org/D63579 llvm-svn: 364088
* [clang-scan-deps] initial outline of the tool that runs preprocessor to findAlex Lorenz2019-06-121-0/+27
dependencies over a JSON compilation database This commit introduces an outline for the clang-scan-deps tool that will be used to implement fast dependency discovery phase using implicit modules for explicit module builds. The initial version of the tool works by computing non-modular header dependencies for files in the compilation database without any optimizations (i.e. without source minimization from r362459). The tool spawns a number of worker threads to run the clang compiler workers in parallel. The immediate goal for clang-scan-deps is to create a ClangScanDeps library which will be used to build up this tool to use the source minimization and caching multi-threaded filesystem to implement the optimized non-incremental dependency scanning phase for a non-modular build. This will allow us to do benchmarks and comparisons for performance that the minimization and caching give us Differential Revision: https://reviews.llvm.org/D60233 llvm-svn: 363204
OpenPOWER on IntegriCloud