|
clang 23.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, IntrusiveRefCntPtr< llvm::vfs::FileSystem > BaseFS) | |
| Construct a dependency scanning worker. | |
| ~DependencyScanningWorker () | |
| bool | computeDependencies (StringRef WorkingDirectory, ArrayRef< std::string > CommandLine, DependencyConsumer &DepConsumer, DependencyActionController &Controller, DiagnosticConsumer &DiagConsumer, llvm::IntrusiveRefCntPtr< llvm::vfs::OverlayFileSystem > OverlayFS=nullptr) |
| Run the dependency scanning worker for the given frontend command-line, and report the discovered dependencies to the provided consumer. | |
| bool | computeDependencies (StringRef WorkingDirectory, ArrayRef< ArrayRef< std::string > > CommandLines, DependencyConsumer &DepConsumer, DependencyActionController &Controller, DiagnosticConsumer &DiagConsumer, llvm::IntrusiveRefCntPtr< llvm::vfs::OverlayFileSystem > OverlayFS=nullptr) |
| Run the dependency scanning tool for all given frontend command-lines, and report the discovered dependencies to the provided consumer. | |
| bool | initializeCompilerInstanceWithContext (StringRef CWD, ArrayRef< std::string > CommandLine, DiagnosticConsumer &DC) |
| The three method below implements a new interface for by name dependency scanning. | |
| bool | initializeCompilerInstanceWithContext (StringRef CWD, ArrayRef< std::string > CommandLine, std::unique_ptr< DiagnosticsEngineWithDiagOpts > DiagEngineWithCmdAndOpts, IntrusiveRefCntPtr< llvm::vfs::OverlayFileSystem > OverlayFS) |
| Initializing the context and the compiler instance. | |
| bool | computeDependenciesByNameWithContext (StringRef ModuleName, DependencyConsumer &Consumer, DependencyActionController &Controller) |
| Performaces dependency scanning for the module whose name is specified. | |
| bool | finalizeCompilerInstanceWithContext () |
| Finalizes the diagnostics engine and deletes the compiler instance. | |
| llvm::vfs::FileSystem & | getVFS () const |
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 85 of file DependencyScanningWorker.h.
| DependencyScanningWorker::DependencyScanningWorker | ( | DependencyScanningService & | Service, |
| IntrusiveRefCntPtr< llvm::vfs::FileSystem > | BaseFS ) |
Construct a dependency scanning worker.
| Service | The parent service. Must outlive the worker. |
| BaseFS | The filesystem for the worker to use. |
Definition at line 22 of file DependencyScanningWorker.cpp.
|
default |
| bool DependencyScanningWorker::computeDependencies | ( | StringRef | WorkingDirectory, |
| ArrayRef< ArrayRef< std::string > > | CommandLines, | ||
| DependencyConsumer & | DepConsumer, | ||
| DependencyActionController & | Controller, | ||
| DiagnosticConsumer & | DiagConsumer, | ||
| llvm::IntrusiveRefCntPtr< llvm::vfs::OverlayFileSystem > | OverlayFS = nullptr ) |
Run the dependency scanning tool for all given frontend command-lines, and report the discovered dependencies to the provided consumer.
OverlayFS should be based on 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 instead.
DiagConsumer), true otherwise. Definition at line 68 of file DependencyScanningWorker.cpp.
References createAndRunToolInvocation(), clang::DiagnosticConsumer::finish(), clang::dependencies::DependencyConsumer::handleBuildCommand(), clang::dependencies::DependencyScanningAction::hasDiagConsumerFinished(), clang::dependencies::DependencyScanningAction::hasScanned(), clang::Success, and clang::dependencies::VFS.
| bool DependencyScanningWorker::computeDependencies | ( | StringRef | WorkingDirectory, |
| ArrayRef< std::string > | CommandLine, | ||
| DependencyConsumer & | DepConsumer, | ||
| DependencyActionController & | Controller, | ||
| DiagnosticConsumer & | DiagConsumer, | ||
| llvm::IntrusiveRefCntPtr< llvm::vfs::OverlayFileSystem > | OverlayFS = nullptr ) |
Run the dependency scanning worker for the given frontend command-line, and report the discovered dependencies to the provided consumer.
OverlayFS should be based on 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 instead.
DiagConsumer), true otherwise. Definition at line 58 of file DependencyScanningWorker.cpp.
References computeDependencies().
Referenced by computeDependencies().
| bool DependencyScanningWorker::computeDependenciesByNameWithContext | ( | StringRef | ModuleName, |
| DependencyConsumer & | Consumer, | ||
| DependencyActionController & | Controller ) |
Performaces dependency scanning for the module whose name is specified.
| ModuleName | The name of the module whose dependency will be scanned. |
| Consumer | The dependency consumer that stores the results. |
| Controller | The controller for the dependency scanning action. |
Definition at line 136 of file DependencyScanningWorker.cpp.
| bool DependencyScanningWorker::finalizeCompilerInstanceWithContext | ( | ) |
Finalizes the diagnostics engine and deletes the compiler instance.
Definition at line 143 of file DependencyScanningWorker.cpp.
|
inline |
Definition at line 173 of file DependencyScanningWorker.h.
| bool DependencyScanningWorker::initializeCompilerInstanceWithContext | ( | StringRef | CWD, |
| ArrayRef< std::string > | CommandLine, | ||
| DiagnosticConsumer & | DC ) |
The three method below implements a new interface for by name dependency scanning.
They together enable the dependency scanning worker to more effectively perform scanning for a sequence of modules by name when the CWD and CommandLine do not change across the queries. The initialization function asks the client for a DiagnosticsConsumer that it direct the diagnostics to.
Initializing the context and the compiler instance.
| CWD | The current working directory used during the scan. |
| CommandLine | The commandline used for the scan. |
Definition at line 115 of file DependencyScanningWorker.cpp.
References initializeCompilerInstanceWithContext(), and clang::dependencies::initVFSForByNameScanning().
Referenced by initializeCompilerInstanceWithContext().
| bool DependencyScanningWorker::initializeCompilerInstanceWithContext | ( | StringRef | CWD, |
| ArrayRef< std::string > | CommandLine, | ||
| std::unique_ptr< DiagnosticsEngineWithDiagOpts > | DiagEngineWithCmdAndOpts, | ||
| IntrusiveRefCntPtr< llvm::vfs::OverlayFileSystem > | OverlayFS ) |
Initializing the context and the compiler instance.
| CWD | The current working directory used during the scan. |
| CommandLine | The commandline used for the scan. |
| DiagEngineWithCmdAndOpts | Preconfigured diagnostics engine and options associated with the cc1 command line. |
| FS | The overlay file system to use for this compiler instance. |
Definition at line 126 of file DependencyScanningWorker.cpp.