9#ifndef LLVM_CLANG_DEPENDENCYSCANNING_DEPENDENCYSCANNINGUTILS_H
10#define LLVM_CLANG_DEPENDENCYSCANNING_DEPENDENCYSCANNINGUTILS_H
15#include "llvm/ADT/DenseSet.h"
16#include "llvm/ADT/MapVector.h"
73 : AlreadySeen(AlreadySeen) {}
76 Commands.push_back(std::move(Cmd));
82 Dependencies.push_back(std::string(
File));
86 PrebuiltModuleDeps.emplace_back(std::move(PMD));
90 ClangModuleDeps[MD.
ID] = std::move(MD);
94 DirectModuleDeps.push_back(ID);
98 VisibleModules.push_back(ModuleName);
102 ContextHash = std::move(Hash);
106 std::optional<P1689ModuleInfo> Provided,
107 std::vector<P1689ModuleInfo> Requires)
override {
108 ModuleName = Provided ? Provided->ModuleName :
"";
109 llvm::transform(Requires, std::back_inserter(NamedModuleDeps),
116 std::vector<std::string> Dependencies;
117 std::vector<PrebuiltModuleDep> PrebuiltModuleDeps;
118 llvm::MapVector<ModuleID, ModuleDeps> ClangModuleDeps;
119 std::string ModuleName;
120 std::vector<std::string> NamedModuleDeps;
121 std::vector<ModuleID> DirectModuleDeps;
122 std::vector<std::string> VisibleModules;
123 std::vector<Command> Commands;
124 std::string ContextHash;
125 const llvm::DenseSet<ModuleID> &AlreadySeen;
140 llvm::report_fatal_error(
"unexpected call to lookupModuleOutput");
144 : LookupModuleOutput(
std::move(LMO)) {
145 if (!LookupModuleOutput) {
152 return LookupModuleOutput(MD, Kind);
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::string lookupModuleOutput(const ModuleDeps &MD, ModuleOutputKind Kind) override
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.
std::vector< ModuleDeps > ModuleDepsGraph
Graph of modular dependencies.
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.
std::vector< std::string > VisibleModules
A list of module names that are visible to this translation unit.
std::vector< std::string > FileDeps
A collection of absolute paths to files that this translation unit directly depends on,...
std::vector< PrebuiltModuleDep > PrebuiltModuleDeps
A collection of prebuilt modules this translation unit directly depends on, not including transitive ...
ModuleID ID
The identifier of the C++20 module this translation unit exports.
std::vector< std::string > DriverCommandLine
Deprecated driver command-line. This will be removed in a future version.
std::vector< std::string > NamedModuleDeps
A list of the C++20 named modules this translation unit depends on.
ModuleDepsGraph ModuleGraph
The graph of direct and transitive modular dependencies.
std::vector< Command > Commands
The sequence of commands required to build the translation unit.
std::vector< ModuleID > ClangModuleDeps
A list of modules this translation unit directly depends on, not including transitive dependencies.