summaryrefslogtreecommitdiffstats
path: root/clang/test/ClangScanDeps
Commit message (Collapse)AuthorAgeFilesLines
* Revert "[clang][clang-scan-deps] Aggregate the full dependency information."Michael Spencer2019-12-112-146/+59
| | | | | | This reverts commit f978ea498309adaebab8fbf1cd6e520e7e0e11f1. It broke clang-ppc64be-linux, but not sure why yet.
* [clang][clang-scan-deps] Aggregate the full dependency information.Michael Spencer2019-12-112-59/+146
| | | | Differential Revision: https://reviews.llvm.org/D70268
* [clang-scan-deps] do not skip empty #if/#elif in the minimizer to avoid ↵Alex Lorenz2019-12-022-0/+45
| | | | | | | | | | missing `__has_include` dependencies This patch makes the minimizer more conservative to avoid missing dependency files that are brought in by __has_include PP expressions that occur in a condition of an #if/#elif that was previously skipped. The __has_include PP expressions can be used in an #if/#elif either directly, or through macro expansion, so we can't detect them at the time of minimization. Differential Revision: https://reviews.llvm.org/D70936
* [clang][ScanDeps] Fix issue with multiple commands with the same input.Michael Spencer2019-10-313-3/+15
| | | | | | | | | | | | | | | | | | | 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
* Disable new clang-scan-deps test on Windows due to backslash path matching ↵Reid Kleckner2019-10-301-0/+3
| | | | problems
* [clang][clang-scan-deps] Add support for extracting full module dependencies.Michael Spencer2019-10-301-0/+74
| | | | | | | | | | | This is a recommit of d8a4ef0e685c with the nondeterminism fixed. This adds experimental support for extracting a Clang module dependency graph from a compilation database. The output format is experimental and will change. It is currently a concatenation of JSON outputs for each compilation. Future patches will change this to deduplicate modules between compilations. Differential Revision: https://reviews.llvm.org/D69420
* Revert "[clang][clang-scan-deps] Add support for extracting full module ↵Michael Spencer2019-10-301-74/+0
| | | | | | | | dependencies." This reverts commit d8a4ef0e685cec1fc73d4953b48220b649d05b40. This commit broke some of the bots. I believe it's due to nondeterminism. Will fix and recommit.
* [clang][clang-scan-deps] Add support for extracting full module dependencies.Michael Spencer2019-10-301-0/+74
| | | | | | | | | This adds experimental support for extracting a Clang module dependency graph from a compilation database. The output format is experimental and will change. It is currently a concatenation of JSON outputs for each compilation. Future patches will change this to deduplicate modules between compilations. Differential Revision: https://reviews.llvm.org/D69420
* [clang][clang-scan-deps] Add -fcxx-modules to test for Darwin.Michael Spencer2019-10-281-2/+2
|
* [clang-scan-deps] Add basic support for modules.Michael Spencer2019-10-243-0/+61
| | | | | | | | | | | | | | | | | | | | This fixes two issues that prevent simple uses of modules from working. * We would previously minimize _every_ file opened by clang, even module maps and module pcm files. Now we only minimize files with known extensions. It would be better if we knew which files clang intended to open as a source file, but this works for now. * We previously cached every lookup, even failed lookups. This is a problem because clang stats the module cache directory before building a module and creating that directory. If we cache that failure then the subsequent pcm load doesn't see the module cache and fails. Overall this still leaves us building minmized modules on disk during scanning. This will need to be improved eventually for performance, but this is correct, and works for now. Differential Revision: https://reviews.llvm.org/D68835
* Revert "Include sanitize blacklist and other extra deps as part of scan-deps ↵Kousik Kumar2019-10-173-22/+0
| | | | | | | | | | | | | | | | | | output" This test is failing on Windows bots, revert for now (will check the right fix and retry the patch). Summary: This reverts commit 962ca076e51c25a7a08f4e0d329c65328a635bdb. Reviewers: Bigcheese, jkorous, arphaman Subscribers: dexonsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69079 llvm-svn: 375079
* Include sanitize blacklist and other extra deps as part of scan-deps outputKousik Kumar2019-10-173-0/+22
| | | | | | | | | | | | | | | | | Summary: Clang's -M mode includes these extra dependencies in its output and clang-scan-deps should have equivalent behavior, so adding these extradeps to output just like how its being done for ".d" file generation mode. Reviewers: arphaman, dexonsmith, Bigcheese, jkorous Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69017 llvm-svn: 375074
* [NFC] Fix ClangScanDeps/static-analyzer.c test on WindowsJan Korous2019-10-141-3/+3
| | | | | | Follow-up to c5d14b5c6fa llvm-svn: 374821
* [clang-scan-deps] Support for clang --analyze in clang-scan-depsJan Korous2019-10-142-0/+23
| | | | | | | | | | | | | | | The goal is to have 100% fidelity in clang-scan-deps behavior when --analyze is present in compilation command. At the same time I don't want to break clang-tidy which expects __static_analyzer__ macro defined as built-in. I introduce new cc1 options (-setup-static-analyzer) that controls the macro definition and is conditionally set in driver. Differential Revision: https://reviews.llvm.org/D68093 llvm-svn: 374815
* In openFileForRead don't cache erroneous entries if the error relates to ↵Kousik Kumar2019-10-102-0/+28
| | | | | | | | | | | | | | | | | | | | them being directories. Add tests. Summary: It seems that when the CachingFileSystem is first given a file to open that is actually a directory, it incorrectly caches that path to be errenous and throws an error when subsequently a directory open call is made for the same path. This change makes it so that we do NOT cache a path if it turns out we asked for a file when its a directory. Reviewers: arphaman Subscribers: dexonsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68193 llvm-svn: 374366
* [clang-scan-deps] strip the --serialize-diagnostics argumentAlex Lorenz2019-09-212-0/+18
| | | | | | | This ensures that clang-scan-deps won't write out diagnostics when scanning dependencies. llvm-svn: 372444
* [clang-scan-deps] Fix for headers having the same name as a directoryAlex Lorenz2019-09-133-0/+25
| | | | | | | | | | | | Scan deps tool crashes when called on a C++ file, containing an include that has the same name as a directory. The tool crashes since it finds foo/dir and tries to read that as a file and fails. Patch by: kousikk (Kousik Kumar) Differential Revision: https://reviews.llvm.org/D67091 llvm-svn: 371903
* [clang-scan-deps] remove dots and dots dots from the reported file ↵Alex Lorenz2019-09-121-1/+1
| | | | | | | | | | dependency paths This resolves differences observed on LLVM + Clang when running the comparison between canonical dependencies (full preprocessing, no file manager reused), and dependencies obtained when the file manager was reused between the full preprocessing invocations. llvm-svn: 371751
* [clang-scan-deps] Add dependency targetsJan Korous2019-09-127-9/+10
| | | | | | 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-1113-34/+34
| | | | | | Differential Revision: https://reviews.llvm.org/D67379 llvm-svn: 371578
* Introduce a DirectoryEntryRef that stores both a reference and anAlex Lorenz2019-08-312-3/+2
| | | | | | | | | | | | | | accessed name to the directory entry This commit introduces a parallel API that returns a DirectoryEntryRef to the FileManager, similar to the parallel FileEntryRef API. All uses will have to be update in follow-up patches. The immediate use of the new API in this patch fixes the issue where a file manager was reused in clang-scan-deps, but reported an different file path whenever a framework lookup was done through a symlink. Differential Revision: https://reviews.llvm.org/D67026 llvm-svn: 370562
* [clang-scan-deps] reuse the file manager across invocations ofAlex Lorenz2019-08-294-0/+72
| | | | | | | | | | | | | | | | the dependency scanner on a single worker thread This behavior can be controlled using the new `-reuse-filemanager` clang-scan-deps option. By default the file manager is reused. The added test/ClangScanDeps/symlink.cpp is able to pass with the reused filemanager after the related FileEntryRef changes landed earlier. The test test/ClangScanDeps/subframework_header_dir_symlink.m still fails when the file manager is reused (I run the FileCheck with not to make it PASS). I will address this in a follow-up patch that improves the DirectoryEntry name modelling in the FileManager. llvm-svn: 370420
* 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
* fix clang-scan-deps test to match filepaths on WindowsAlex Lorenz2019-08-061-2/+2
| | | | llvm-svn: 368092
* [clang-scan-deps] Implementation of dependency scanner over minimized sourcesAlex Lorenz2019-08-068-3/+74
| | | | | | | | | | | | | | | | | | | 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] use `-Wno-error` when scanning for dependenciesAlex Lorenz2019-07-033-0/+24
| | | | | | | | | Warnings can be promoted to errors. But that shouldn't prevent us from getting the dependencies! Differential Revision: https://reviews.llvm.org/D64149 llvm-svn: 365065
* [clang-scan-deps] Introduce the DependencyScanning library with theAlex Lorenz2019-06-262-1/+22
| | | | | | | | | | | | | thread worker code and better error handling This commit extracts out the code that will powers the fast scanning worker into a new file in a new DependencyScanning library. The error and output handling is improved so that the clients can gather errors/results from the worker directly. Differential Revision: https://reviews.llvm.org/D63681 llvm-svn: 364474
* [clang-scan-deps] print the dependencies to stdoutAlex Lorenz2019-06-212-14/+23
| | | | | | | | and remove the need to use -MD options in the CDB Differential Revision: https://reviews.llvm.org/D63579 llvm-svn: 364088
* [test] NFC, udpate clang-scan-deps tests to not use -c to avoid driver ↵Alex Lorenz2019-06-181-2/+2
| | | | | | | | issues when no integrated assembler is present Caught by Douglas Yung. llvm-svn: 363742
* [clang-scan-deps] initial outline of the tool that runs preprocessor to findAlex Lorenz2019-06-124-0/+43
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