|
clang 23.0.0git
|
#include "clang/Tooling/DependencyScanningTool.h"
Public Member Functions | |
| bool | computeDependencies (StringRef ModuleName, dependencies::DependencyConsumer &Consumer, dependencies::DependencyActionController &Controller) |
| llvm::Expected< dependencies::TranslationUnitDeps > | computeDependenciesByNameOrError (StringRef ModuleName, const llvm::DenseSet< dependencies::ModuleID > &AlreadySeen, dependencies::LookupModuleOutputCallback LookupModuleOutput) |
| Computes the dependeny for the module named ModuleName. | |
Static Public Member Functions | |
| static std::optional< CompilerInstanceWithContext > | initializeFromCommandline (DependencyScanningTool &Tool, StringRef CWD, ArrayRef< std::string > CommandLine, DiagnosticConsumer &DC) |
| Initialize the tool's compiler instance from the commandline. | |
| static llvm::Expected< CompilerInstanceWithContext > | initializeOrError (DependencyScanningTool &Tool, StringRef CWD, ArrayRef< std::string > CommandLine) |
| Initializing the context and the compiler instance. | |
Static Public Attributes | |
| static const int32_t | MaxNumOfQueries = 1 << 16 |
Definition at line 141 of file DependencyScanningTool.h.
| bool CompilerInstanceWithContext::computeDependencies | ( | StringRef | ModuleName, |
| dependencies::DependencyConsumer & | Consumer, | ||
| dependencies::DependencyActionController & | Controller ) |
Definition at line 505 of file DependencyScanningTool.cpp.
References clang::PPCallbacks::EndOfMainFile(), clang::PPCallbacks::EnterFile, clang::Preprocessor::EnterSourceFile(), clang::CompilerInvocationBase::getCC1CommandLine(), clang::Preprocessor::getIdentifierInfo(), clang::SourceLocation::getLocWithOffset(), clang::Preprocessor::getSourceManager(), clang::dependencies::DependencyConsumer::handleBuildCommand(), clang::Module::Hidden, clang::dependencies::initializeScanInstanceDependencyCollector(), clang::PPCallbacks::LexedFileChanged(), MaxNumOfQueries, clang::PPCallbacks::moduleImport(), and SM.
Referenced by computeDependenciesByNameOrError().
| llvm::Expected< TranslationUnitDeps > CompilerInstanceWithContext::computeDependenciesByNameOrError | ( | StringRef | ModuleName, |
| const llvm::DenseSet< dependencies::ModuleID > & | AlreadySeen, | ||
| dependencies::LookupModuleOutputCallback | LookupModuleOutput ) |
Computes the dependeny for the module named ModuleName.
| ModuleName | The name of the module for which this method computes . dependencies. |
| 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. Note that this parameter is not part of the context because it can be shared across different worker threads and each worker thread may update it. |
| LookupModuleOutput | This function is called to fill in "-fmodule-file=", "-o" and other output arguments for dependencies. |
TranslationUnitDeps if the scan is successful. Otherwise it returns an error. Definition at line 432 of file DependencyScanningTool.cpp.
References computeDependencies(), makeErrorFromDiagnosticsOS(), and clang::dependencies::FullDependencyConsumer::takeTranslationUnitDeps().
|
static |
Initialize the tool's compiler instance from the commandline.
The compiler instance only takes a -cc1 job, so this method builds the -cc1 job from the CommandLine input.
| Tool | The dependency scanning tool whose compiler instance with context is initialized. |
| CWD | The current working directory. |
| CommandLine | This command line may be a driver command or a cc1 command. |
| DC | A diagnostics consumer to report error if the initialization fails. |
Definition at line 379 of file DependencyScanningTool.cpp.
References getFirstCC1CommandLine(), clang::dependencies::DependencyScanningWorker::getVFS(), and initVFSForByNameScanning().
Referenced by initializeOrError().
|
static |
Initializing the context and the compiler instance.
This method must be called before calling computeDependenciesByNameWithContext.
| CWD | The current working directory used during the scan. |
| CommandLine | The commandline used for the scan. |
Definition at line 416 of file DependencyScanningTool.cpp.
References initializeFromCommandline(), makeErrorFromDiagnosticsOS(), and clang::Result.
Referenced by clang::tooling::DependencyScanningTool::getModuleDependencies().
|
static |
Definition at line 238 of file DependencyScanningTool.h.
Referenced by computeDependencies(), and FakeInput().