9#ifndef LLVM_CLANG_DEPENDENCYSCANNING_DEPENDENCYSCANNINGWORKER_H
10#define LLVM_CLANG_DEPENDENCYSCANNING_DEPENDENCYSCANNINGWORKER_H
19#include "llvm/ADT/IntrusiveRefCntPtr.h"
20#include "llvm/Support/FileSystem.h"
21#include "llvm/Support/MemoryBufferRef.h"
22#include "llvm/Support/VirtualFileSystem.h"
36class DependencyScanningWorkerFilesystem;
51 std::optional<P1689ModuleInfo> Provided,
52 std::vector<P1689ModuleInfo> Requires) {}
79 virtual std::unique_ptr<DependencyActionController>
clone()
const = 0;
103 virtual std::optional<std::string>
178 llvm::vfs::FileSystem &
getVFS()
const {
return *DepFS; }
183 std::shared_ptr<PCHContainerOperations> PCHContainerOps;
Defines the clang::FileManager interface and associated types.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
Helper class for holding the data necessary to invoke the compiler.
Same as CompilerInvocation, but with copy-on-write optimization.
DependencyOutputOptions - Options for controlling the compiler dependency file generation.
Abstract interface, implemented by clients of the front-end, which formats and prints fully processed...
Dependency scanner callbacks that are used during scanning to influence the behaviour of the scan - f...
virtual std::unique_ptr< DependencyActionController > clone() const =0
Creates a copy of the controller. The result must be both thread-safe.
virtual bool finalizeModuleInvocation(CompilerInstance &ScanInstance, CowCompilerInvocation &CI, const ModuleDeps &MD)
Modifies the resulting module invocation and the associated structure.
virtual void initializeScanInvocation(CompilerInvocation &ScanInvocation)
Initializes the scan invocation.
virtual std::string lookupModuleOutput(const ModuleDeps &MD, ModuleOutputKind Kind)=0
Provides output path for a given module dependency. Must be thread-safe.
virtual std::optional< std::string > getCacheKey(const CompilerInvocation &NewInvocation)
Returns the cache key for the resulting invocation, or nullopt.
virtual bool initialize(CompilerInstance &ScanInstance, CompilerInvocation &NewInvocation)
Initializes the scan instance and modifies the resulting TU invocation.
virtual bool initializeModuleBuild(CompilerInstance &ModuleScanInstance)
Initializes the module scan instance.
virtual bool finalize(CompilerInstance &ScanInstance, CompilerInvocation &NewInvocation)
Finalizes the scan instance and modifies the resulting TU invocation.
virtual ~DependencyActionController()
virtual bool finalizeModuleBuild(CompilerInstance &ModuleScanInstance)
Finalizes the module scan instance.
virtual void handleBuildCommand(Command Cmd)
virtual ~DependencyConsumer()
virtual void handleFileDependency(StringRef Filename)=0
virtual void handleDependencyOutputOpts(const DependencyOutputOptions &Opts)=0
virtual void handleModuleDependency(ModuleDeps MD)=0
virtual void handleVisibleModule(std::string ModuleName)=0
virtual void handlePrebuiltModuleDependency(PrebuiltModuleDep PMD)=0
virtual void handleDirectModuleDependency(ModuleID MD)=0
virtual void handleContextHash(std::string Hash)=0
virtual void handleProvidedAndRequiredStdCXXModules(std::optional< P1689ModuleInfo > Provided, std::vector< P1689ModuleInfo > Requires)
The dependency scanning service contains shared configuration and state that is used by the individua...
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 dep...
llvm::vfs::FileSystem & getVFS() const
ModuleOutputKind
An output from a module compilation, such as the path of the module file.
The JSON file list parser is used to communicate input to InstallAPI.
A command-line tool invocation that is part of building a TU.
std::vector< std::string > Arguments
This is used to identify a specific module.
Modular dependency that has already been built prior to the dependency scan.