|
clang 24.0.0git
|
An individual dependency scanning worker that is able to run on its own thread. More...
#include "clang/DependencyScanning/DependencyScanningWorker.h"
Public Member Functions | |
| DependencyScanningWorker (DependencyScanningService &Service) | |
| Construct a dependency scanning worker. | |
| ~DependencyScanningWorker () | |
| bool | computeDependencies (StringRef WorkingDirectory, ArrayRef< ArrayRef< std::string > > CommandLines, DependencyConsumer &DepConsumer, DependencyActionController &Controller, DiagnosticConsumer &DiagConsumer, IntrusiveRefCntPtr< llvm::vfs::FileSystem > OverlayFS=nullptr) |
| Run the dependency scanning tool for all given frontend command-lines, and report the discovered dependencies to the provided consumer. | |
| bool | computeDependenciesByName (StringRef CWD, ArrayRef< std::string > CC1CommandLine, IntrusiveRefCntPtr< llvm::vfs::FileSystem > OverlayFS, DiagnosticConsumer &DiagConsumer, DependencyActionController &Controller, llvm::function_ref< std::optional< std::string >()> getNextName, DependencyConsumer &DepConsumer) |
| By-name scanning over a single cc1 command line. | |
| IntrusiveRefCntPtr< llvm::vfs::FileSystem > | makeEffectiveVFS (StringRef WorkingDirectory, IntrusiveRefCntPtr< llvm::vfs::FileSystem > OverlayFS=nullptr) const |
| Creates the effective VFS that will be used for the scan. | |
| llvm::vfs::TracingFileSystem * | getTracingVFS () const |
| Returns the worker tracing VFS, if it was requested via the service. | |
Static Public Attributes | |
| static const int32_t | MaxNumOfByNameQueries = 1 << 16 |
Friends | |
| class | CompilerInstanceWithContext |
An individual dependency scanning worker that is able to run on its own thread.
The worker computes the dependencies for the input files by preprocessing sources either using a fast mode where the source files are minimized, or using the regular processing run.
Definition at line 45 of file DependencyScanningWorker.h.
| DependencyScanningWorker::DependencyScanningWorker | ( | DependencyScanningService & | Service | ) |
Construct a dependency scanning worker.
| Service | The parent service. Must outlive the worker. |
Definition at line 992 of file DependencyScanningWorker.cpp.
|
default |
| bool DependencyScanningWorker::computeDependencies | ( | StringRef | WorkingDirectory, |
| ArrayRef< ArrayRef< std::string > > | CommandLines, | ||
| DependencyConsumer & | DepConsumer, | ||
| DependencyActionController & | Controller, | ||
| DiagnosticConsumer & | DiagConsumer, | ||
| IntrusiveRefCntPtr< llvm::vfs::FileSystem > | OverlayFS = nullptr ) |
Run the dependency scanning tool for all given frontend command-lines, and report the discovered dependencies to the provided consumer.
The OverlayFS will be used to call makeEffectiveVFS().
DiagConsumer), true otherwise. Definition at line 1031 of file DependencyScanningWorker.cpp.
References any(), canonicalizeDefines(), createCompilerInvocation(), clang::CompilerInstance::createDiagnostics(), clang::dependencies::createScanningDiagOptions(), clang::dependencies::DependencyConsumer::handleBuildCommand(), clang::dependencies::CompilerInstanceWithContext::initializeFromCC1Commandline(), clang::dependencies::Macros, makeEffectiveVFS(), clang::Result, and clang::Success.
| bool DependencyScanningWorker::computeDependenciesByName | ( | StringRef | CWD, |
| ArrayRef< std::string > | CC1CommandLine, | ||
| IntrusiveRefCntPtr< llvm::vfs::FileSystem > | OverlayFS, | ||
| DiagnosticConsumer & | DiagConsumer, | ||
| DependencyActionController & | Controller, | ||
| llvm::function_ref< std::optional< std::string >()> | getNextName, | ||
| DependencyConsumer & | DepConsumer ) |
By-name scanning over a single cc1 command line.
Builds a scanning session local to this call, then pulls module names from getNextName until it returns std::nullopt. Results flow to DepConsumer (per-name status via finishQuery); diagnostics flow to DiagConsumer.
Definition at line 1096 of file DependencyScanningWorker.cpp.
References clang::CompilerInstance::createDiagnostics(), clang::dependencies::createScanningDiagOptions(), clang::dependencies::DependencyConsumer::finishQuery(), clang::dependencies::CompilerInstanceWithContext::initializeFromCC1Commandline(), makeEffectiveVFS(), and clang::Success.
|
inline |
Returns the worker tracing VFS, if it was requested via the service.
Definition at line 89 of file DependencyScanningWorker.h.
| IntrusiveRefCntPtr< llvm::vfs::FileSystem > DependencyScanningWorker::makeEffectiveVFS | ( | StringRef | WorkingDirectory, |
| IntrusiveRefCntPtr< llvm::vfs::FileSystem > | OverlayFS = nullptr ) const |
Creates the effective VFS that will be used for the scan.
If provided, OverlayFS will be overlaid on top of the Worker's dependency scanning file-system and can be used to provide any input specified on the command-line as in-memory file. If no overlay file-system is provided, the Worker's dependency scanning file-system is used directly.
Definition at line 1017 of file DependencyScanningWorker.cpp.
Referenced by computeDependencies(), and computeDependenciesByName().
|
friend |
Definition at line 112 of file DependencyScanningWorker.h.
References CompilerInstanceWithContext.
Referenced by CompilerInstanceWithContext.
|
static |
Definition at line 100 of file DependencyScanningWorker.h.
Referenced by clang::dependencies::CompilerInstanceWithContext::computeDependencies(), and initVFSForByNameScanning().