clang 22.0.0git
clang::tooling::dependencies::DependencyScanningWorker Class Reference

An individual dependency scanning worker that is able to run on its own thread. More...

#include "clang/Tooling/DependencyScanning/DependencyScanningWorker.h"

Public Member Functions

 DependencyScanningWorker (DependencyScanningService &Service, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS)
 Construct a dependency scanning worker.
bool computeDependencies (StringRef WorkingDirectory, const std::vector< 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 computeDependencies (StringRef WorkingDirectory, const std::vector< std::string > &CommandLine, DependencyConsumer &DepConsumer, DependencyActionController &Controller, DiagnosticConsumer &DiagConsumer, StringRef ModuleName)
 Run the dependency scanning tool for a given clang driver command-line for a specific module.
llvm::Error computeDependencies (StringRef WorkingDirectory, const std::vector< std::string > &CommandLine, DependencyConsumer &Consumer, DependencyActionController &Controller, std::optional< llvm::MemoryBufferRef > TUBuffer=std::nullopt)
 Run the dependency scanning tool for a given clang driver command-line for a specific translation unit via file system or memory buffer.
llvm::Error computeDependencies (StringRef WorkingDirectory, const std::vector< std::string > &CommandLine, DependencyConsumer &Consumer, DependencyActionController &Controller, StringRef ModuleName)
 Run the dependency scanning tool for a given clang driver command-line for a specific module.
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 83 of file DependencyScanningWorker.h.

Constructor & Destructor Documentation

◆ DependencyScanningWorker()

DependencyScanningWorker::DependencyScanningWorker ( DependencyScanningService & Service,
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS )

Construct a dependency scanning worker.

Parameters
ServiceThe parent service. Must outlive the worker.
FSThe filesystem for the worker to use.

Definition at line 595 of file DependencyScanningWorker.cpp.

References clang::tooling::dependencies::CanonicalPreprocessing, and clang::tooling::dependencies::DependencyDirectivesScan.

Member Function Documentation

◆ computeDependencies() [1/4]

llvm::Error DependencyScanningWorker::computeDependencies ( StringRef WorkingDirectory,
const std::vector< std::string > & CommandLine,
DependencyConsumer & Consumer,
DependencyActionController & Controller,
std::optional< llvm::MemoryBufferRef > TUBuffer = std::nullopt )

Run the dependency scanning tool for a given clang driver command-line for a specific translation unit via file system or memory buffer.

Returns
A StringError with the diagnostic output if clang errors occurred, success otherwise.

Definition at line 632 of file DependencyScanningWorker.cpp.

References computeDependencies(), and createDiagOptions().

◆ computeDependencies() [2/4]

llvm::Error DependencyScanningWorker::computeDependencies ( StringRef WorkingDirectory,
const std::vector< std::string > & CommandLine,
DependencyConsumer & Consumer,
DependencyActionController & Controller,
StringRef ModuleName )

Run the dependency scanning tool for a given clang driver command-line for a specific module.

Returns
A StringError with the diagnostic output if clang errors occurred, success otherwise.

Definition at line 650 of file DependencyScanningWorker.cpp.

References computeDependencies(), and createDiagOptions().

◆ computeDependencies() [3/4]

bool DependencyScanningWorker::computeDependencies ( StringRef WorkingDirectory,
const std::vector< 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.

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

Definition at line 793 of file DependencyScanningWorker.cpp.

Referenced by computeDependencies(), and computeDependencies().

◆ computeDependencies() [4/4]

bool DependencyScanningWorker::computeDependencies ( StringRef WorkingDirectory,
const std::vector< std::string > & CommandLine,
DependencyConsumer & DepConsumer,
DependencyActionController & Controller,
DiagnosticConsumer & DiagConsumer,
StringRef ModuleName )

Run the dependency scanning tool for a given clang driver command-line for a specific module.

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

Definition at line 833 of file DependencyScanningWorker.cpp.

◆ getVFS()

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

Definition at line 139 of file DependencyScanningWorker.h.


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