9#ifndef LLVM_CLANG_DEPENDENCYSCANNING_DEPENDENCYSCANNINGUTILS_H
10#define LLVM_CLANG_DEPENDENCYSCANNING_DEPENDENCYSCANNINGUTILS_H
17#include "llvm/ADT/DenseSet.h"
18#include "llvm/ADT/MapVector.h"
27 : AlreadySeen(AlreadySeen) {}
30 Commands.push_back(std::move(Cmd));
36 Dependencies.push_back(std::string(
File));
40 PrebuiltModuleDeps.emplace_back(std::move(PMD));
44 ClangModuleDeps[MD.
ID] = std::move(MD);
48 DirectModuleDeps.push_back(ID);
52 VisibleModules.push_back(ModuleName);
56 ContextHash = std::move(Hash);
60 std::optional<P1689ModuleInfo> Provided,
61 std::vector<P1689ModuleInfo> Requires)
override {
62 ModuleName = Provided ? Provided->ModuleName :
"";
63 llvm::transform(Requires, std::back_inserter(NamedModuleDeps),
70 std::vector<std::string> Dependencies;
71 std::vector<PrebuiltModuleDep> PrebuiltModuleDeps;
72 llvm::MapVector<ModuleID, ModuleDeps> ClangModuleDeps;
73 std::string ModuleName;
74 std::vector<std::string> NamedModuleDeps;
75 std::vector<ModuleID> DirectModuleDeps;
76 std::vector<std::string> VisibleModules;
77 std::vector<Command> Commands;
78 std::string ContextHash;
79 const llvm::DenseSet<ModuleID> &AlreadySeen;
94 llvm::report_fatal_error(
"unexpected call to lookupModuleOutput");
104 std::unique_ptr<DependencyActionController>
clone()
const override {
DependencyOutputOptions - Options for controlling the compiler dependency file generation.
Describes a module or submodule.
static std::string lookupUnreachableModuleOutput(const ModuleDeps &MD, ModuleOutputKind Kind)
virtual ~CallbackActionController()
CallbackActionController(LookupModuleOutputCallback LMO)
std::unique_ptr< DependencyActionController > clone() const override
Creates a copy of the controller. The result must be both thread-safe.
std::string lookupModuleOutput(const ModuleDeps &MD, ModuleOutputKind Kind) override
Provides output path for a given module dependency. Must be thread-safe.
LookupModuleOutputCallback LookupModuleOutput
Dependency scanner callbacks that are used during scanning to influence the behaviour of the scan - f...
void handleModuleDependency(ModuleDeps MD) override
TranslationUnitDeps takeTranslationUnitDeps()
void handleDependencyOutputOpts(const DependencyOutputOptions &) override
void handlePrebuiltModuleDependency(PrebuiltModuleDep PMD) override
void handleContextHash(std::string Hash) override
FullDependencyConsumer(const llvm::DenseSet< ModuleID > &AlreadySeen)
void handleProvidedAndRequiredStdCXXModules(std::optional< P1689ModuleInfo > Provided, std::vector< P1689ModuleInfo > Requires) override
void handleBuildCommand(Command Cmd) override
void handleDirectModuleDependency(ModuleID ID) override
void handleFileDependency(StringRef File) override
void handleVisibleModule(std::string ModuleName) override
llvm::function_ref< std::string(const ModuleDeps &, ModuleOutputKind)> LookupModuleOutputCallback
A callback to lookup module outputs for "-fmodule-file=", "-o" etc.
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.
ModuleID ID
The identifier of the module.
This is used to identify a specific module.
Modular dependency that has already been built prior to the dependency scan.
The full dependencies and module graph for a specific input.