|
clang 22.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, std::optional< llvm::MemoryBufferRef > TUBuffer=std::nullopt) |
| Run the dependency scanning tool for a given clang driver command-line, 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 21 of file DependencyScanningWorker.cpp.
|
default |
| bool DependencyScanningWorker::computeDependencies | ( | StringRef | WorkingDirectory, |
| ArrayRef< std::string > | CommandLine, | ||
| DependencyConsumer & | DepConsumer, | ||
| DependencyActionController & | Controller, | ||
| DiagnosticConsumer & | DiagConsumer, | ||
| std::optional< llvm::MemoryBufferRef > | TUBuffer = std::nullopt ) |
Run the dependency scanning tool for a given clang driver command-line, and report the discovered dependencies to the provided consumer.
If TUBuffer is not nullopt, it is used as TU input for the dependency scanning. Otherwise, the input should be included as part of the command-line.
DiagConsumer), true otherwise. Definition at line 140 of file DependencyScanningWorker.cpp.
References clang::dependencies::initVFSForTUBufferScanning().
| 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 177 of file DependencyScanningWorker.cpp.
| bool DependencyScanningWorker::finalizeCompilerInstanceWithContext | ( | ) |
Finalizes the diagnostics engine and deletes the compiler instance.
Definition at line 184 of file DependencyScanningWorker.cpp.
|
inline |
Definition at line 153 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 156 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 167 of file DependencyScanningWorker.cpp.