clang 23.0.0git
clang::dependencies::DependencyScanningWorker Class Reference

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< 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.
llvm::vfs::FileSystem & getVFS () const

Detailed Description

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 135 of file DependencyScanningWorker.h.

Constructor & Destructor Documentation

◆ DependencyScanningWorker()

DependencyScanningWorker::DependencyScanningWorker ( DependencyScanningService & Service)

Construct a dependency scanning worker.

Parameters
ServiceThe parent service. Must outlive the worker.

Definition at line 22 of file DependencyScanningWorker.cpp.

◆ ~DependencyScanningWorker()

DependencyScanningWorker::~DependencyScanningWorker ( )
default

Member Function Documentation

◆ computeDependencies() [1/2]

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.

Returns
false if any errors occurred (with diagnostics reported to DiagConsumer), true otherwise.

Definition at line 69 of file DependencyScanningWorker.cpp.

References createAndRunToolInvocation(), clang::dependencies::DependencyConsumer::handleBuildCommand(), clang::dependencies::DependencyScanningAction::hasScanned(), clang::Success, and clang::dependencies::VFS.

◆ computeDependencies() [2/2]

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.

Returns
false if any errors occurred (with diagnostics reported to DiagConsumer), true otherwise.

Definition at line 59 of file DependencyScanningWorker.cpp.

References computeDependencies().

Referenced by computeDependencies().

◆ getVFS()

llvm::vfs::FileSystem & clang::dependencies::DependencyScanningWorker::getVFS ( ) const
inline

The documentation for this class was generated from the following files: