14using namespace tooling;
15using namespace dependencies;
26 void handleBuildCommand(
Command)
override {}
30 this->Opts = std::make_unique<DependencyOutputOptions>(Opts);
33 void handleFileDependency(StringRef
File)
override {
34 Dependencies.push_back(std::string(
File));
41 void handleModuleDependency(
ModuleDeps MD)
override {}
42 void handleDirectModuleDependency(
ModuleID ID)
override {}
43 void handleContextHash(std::string Hash)
override {}
45 void printDependencies(std::string &S) {
46 assert(Opts &&
"Handled dependency output options.");
53 for (
const auto &Dep : Dependencies)
57 void printDependencies(std::string &S) {
58 llvm::raw_string_ostream OS(S);
59 outputDependencyFile(OS);
63 DependencyPrinter
Generator(*Opts, Dependencies);
68 std::unique_ptr<DependencyOutputOptions> Opts;
69 std::vector<std::string> Dependencies;
74 const std::vector<std::string> &CommandLine, StringRef CWD) {
75 MakeDependencyPrinterConsumer Consumer;
82 Consumer.printDependencies(Output);
88 std::string &MakeformatOutputPath) {
89 class P1689ModuleDependencyPrinterConsumer
90 :
public MakeDependencyPrinterConsumer {
92 P1689ModuleDependencyPrinterConsumer(
P1689Rule &Rule,
95 Rule.PrimaryOutput =
Command.Output;
98 void handleProvidedAndRequiredStdCXXModules(
99 std::optional<P1689ModuleInfo> Provided,
100 std::vector<P1689ModuleInfo> Requires)
override {
101 Rule.Provides = Provided;
103 Rule.Provides->SourcePath =
Filename.str();
104 Rule.Requires = Requires;
107 StringRef getMakeFormatDependencyOutputPath() {
108 if (Opts->OutputFormat != DependencyOutputFormat::Make)
110 return Opts->OutputFile;
121 std::string lookupModuleOutput(
const ModuleID &,
128 P1689ModuleDependencyPrinterConsumer Consumer(Rule,
Command);
129 P1689ActionController Controller;
135 MakeformatOutputPath = Consumer.getMakeFormatDependencyOutputPath();
136 if (!MakeformatOutputPath.empty())
137 Consumer.printDependencies(MakeformatOutput);
143 const std::vector<std::string> &CommandLine, StringRef CWD,
144 const llvm::DenseSet<ModuleID> &AlreadySeen,
156 StringRef ModuleName,
const std::vector<std::string> &CommandLine,
157 StringRef CWD,
const llvm::DenseSet<ModuleID> &AlreadySeen,
162 Controller, ModuleName);
172 TU.
FileDeps = std::move(Dependencies);
176 for (
auto &&M : ClangModuleDeps) {
180 if (AlreadySeen.count(M.first))
192 for (
auto &&M : ClangModuleDeps) {
196 if (AlreadySeen.count(M.first))
198 ModuleGraph.push_back(std::move(MD));
enum clang::sema::@1653::IndirectLocalPathEntry::EntryKind Kind
Builds a dependency file when attached to a Preprocessor (for includes) and ASTReader (for module imp...
DependencyOutputOptions - Options for controlling the compiler dependency file generation.
The JSON file list parser is used to communicate input to InstallAPI.
@ Worker
'worker' clause, allowed on 'loop', Combined, and 'routine' directives.
@ Result
The result type of a method or function.