|
clang 23.0.0git
|
The high-level implementation of the dependency discovery tool that runs on an individual worker thread. More...
#include "clang/Tooling/DependencyScanningTool.h"
Public Member Functions | |
| DependencyScanningTool (dependencies::DependencyScanningService &Service) | |
| Construct a dependency scanning tool. | |
| std::optional< std::string > | getDependencyFile (ArrayRef< std::string > CommandLine, StringRef CWD, DiagnosticConsumer &DiagConsumer) |
| Print out the dependency information into a string using the dependency file format that is specified in the options (-MD is the default) and return it. | |
| std::optional< P1689Rule > | getP1689ModuleDependencyFile (const CompileCommand &Command, StringRef CWD, std::string &MakeformatOutput, std::string &MakeformatOutputPath, DiagnosticConsumer &DiagConsumer) |
| Collect the module dependency in P1689 format for C++20 named modules. | |
| std::optional< P1689Rule > | getP1689ModuleDependencyFile (const CompileCommand &Command, StringRef CWD, DiagnosticConsumer &DiagConsumer) |
| std::optional< dependencies::TranslationUnitDeps > | getTranslationUnitDependencies (ArrayRef< std::string > CommandLine, StringRef CWD, DiagnosticConsumer &DiagConsumer, const llvm::DenseSet< dependencies::ModuleID > &AlreadySeen, dependencies::LookupModuleOutputCallback LookupModuleOutput, std::optional< llvm::MemoryBufferRef > TUBuffer=std::nullopt) |
| Given a Clang driver command-line for a translation unit, gather the modular dependencies and return the information needed for explicit build. | |
| llvm::Expected< dependencies::TranslationUnitDeps > | getModuleDependencies (StringRef ModuleName, ArrayRef< std::string > CommandLine, StringRef CWD, const llvm::DenseSet< dependencies::ModuleID > &AlreadySeen, dependencies::LookupModuleOutputCallback LookupModuleOutput) |
| Given a compilation context specified via the Clang driver command-line, gather modular dependencies of module with the given name, and return the information needed for explicit build. | |
| llvm::vfs::FileSystem & | getWorkerVFS () const |
Friends | |
| class | CompilerInstanceWithContext |
The high-level implementation of the dependency discovery tool that runs on an individual worker thread.
Definition at line 34 of file DependencyScanningTool.h.
|
inline |
Construct a dependency scanning tool.
| Service | The parent service. Must outlive the tool. |
Definition at line 39 of file DependencyScanningTool.h.
| std::optional< std::string > DependencyScanningTool::getDependencyFile | ( | ArrayRef< std::string > | CommandLine, |
| StringRef | CWD, | ||
| DiagnosticConsumer & | DiagConsumer ) |
Print out the dependency information into a string using the dependency file format that is specified in the options (-MD is the default) and return it.
Definition at line 189 of file DependencyScanningTool.cpp.
References clang::tooling::computeDependencies().
| llvm::Expected< TranslationUnitDeps > DependencyScanningTool::getModuleDependencies | ( | StringRef | ModuleName, |
| ArrayRef< std::string > | CommandLine, | ||
| StringRef | CWD, | ||
| const llvm::DenseSet< dependencies::ModuleID > & | AlreadySeen, | ||
| dependencies::LookupModuleOutputCallback | LookupModuleOutput ) |
Given a compilation context specified via the Clang driver command-line, gather modular dependencies of module with the given name, and return the information needed for explicit build.
TODO: this method should be removed as soon as Swift and our C-APIs adopt CompilerInstanceWithContext. We are keeping it here so that it is easier to coordinate with Swift and C-API changes.
Definition at line 345 of file DependencyScanningTool.cpp.
References clang::Error, and clang::tooling::CompilerInstanceWithContext::initializeOrError().
|
inline |
Definition at line 69 of file DependencyScanningTool.h.
References getP1689ModuleDependencyFile().
| std::optional< P1689Rule > DependencyScanningTool::getP1689ModuleDependencyFile | ( | const CompileCommand & | Command, |
| StringRef | CWD, | ||
| std::string & | MakeformatOutput, | ||
| std::string & | MakeformatOutputPath, | ||
| DiagnosticConsumer & | DiagConsumer ) |
Collect the module dependency in P1689 format for C++20 named modules.
| MakeformatOutput | The output parameter for dependency information in make format if the command line requires to generate make-format dependency information by -MD -MF <dep_file>. |
| MakeformatOutputPath | The output parameter for the path to |
| MakeformatOutput. |
Definition at line 202 of file DependencyScanningTool.cpp.
References clang::tooling::computeDependencies(), and clang::Make.
Referenced by getP1689ModuleDependencyFile().
| std::optional< TranslationUnitDeps > DependencyScanningTool::getTranslationUnitDependencies | ( | ArrayRef< std::string > | CommandLine, |
| StringRef | CWD, | ||
| DiagnosticConsumer & | DiagConsumer, | ||
| const llvm::DenseSet< dependencies::ModuleID > & | AlreadySeen, | ||
| dependencies::LookupModuleOutputCallback | LookupModuleOutput, | ||
| std::optional< llvm::MemoryBufferRef > | TUBuffer = std::nullopt ) |
Given a Clang driver command-line for a translation unit, gather the modular dependencies and return the information needed for explicit build.
| AlreadySeen | This stores modules which have previously been reported. Use the same instance for all calls to this function for a single DependencyScanningTool in a single build. Use a different one for different tools, and clear it between builds. |
| LookupModuleOutput | This function is called to fill in "-fmodule-file=", "-o" and other output arguments for dependencies. |
| TUBuffer | Optional memory buffer for translation unit input. If TUBuffer is nullopt, the input should be included in the Commandline already. |
Definition at line 318 of file DependencyScanningTool.cpp.
References clang::tooling::computeDependencies(), initVFSForTUBufferScanning(), and clang::dependencies::FullDependencyConsumer::takeTranslationUnitDeps().
|
inline |
Definition at line 114 of file DependencyScanningTool.h.
|
friend |
Definition at line 119 of file DependencyScanningTool.h.
References CompilerInstanceWithContext.
Referenced by CompilerInstanceWithContext.