14 namespace dependencies {
17 std::function<StringRef(
ModuleID)> LookupPCMPath)
const {
21 Ret.push_back((
"-fmodule-file=" + LookupPCMPath(MID)).str());
26 std::vector<std::string>
30 Args.push_back(
"-fno-implicit-modules");
31 Args.push_back(
"-fno-implicit-module-maps");
33 Args.push_back(
"-fmodule-file=" + PMD.PCMFile);
37 return Arg.find(
"-fmodules-cache-path=") == 0;
51 const std::vector<std::string> &CommandLine, StringRef CWD,
58 this->Opts = std::make_unique<DependencyOutputOptions>(Opts);
61 void handleFileDependency(StringRef
File)
override {
69 void handleModuleDependency(
ModuleDeps MD)
override {
75 void handleContextHash(
std::string Hash)
override {}
78 assert(Opts &&
"Handled dependency output options.");
85 for (
const auto &Dep : Dependencies)
90 llvm::raw_string_ostream OS(S);
91 outputDependencyFile(OS);
95 DependencyPrinter
Generator(*Opts, Dependencies);
100 std::unique_ptr<DependencyOutputOptions> Opts;
101 std::vector<std::string> Dependencies;
104 MakeDependencyPrinterConsumer Consumer;
108 return std::move(Result);
110 Consumer.printDependencies(Output);
116 const std::vector<std::string> &CommandLine, StringRef CWD,
117 const llvm::StringSet<> &AlreadySeen,
121 FullDependencyPrinterConsumer(
const llvm::StringSet<> &AlreadySeen)
122 : AlreadySeen(AlreadySeen) {}
127 void handleFileDependency(StringRef
File)
override {
132 PrebuiltModuleDeps.emplace_back(std::move(PMD));
135 void handleModuleDependency(
ModuleDeps MD)
override {
139 void handleContextHash(
std::string Hash)
override {
140 ContextHash = std::move(Hash);
144 const std::vector<std::string> &OriginalCommandLine)
const {
152 FD.
FileDeps.assign(Dependencies.begin(), Dependencies.end());
154 for (
auto &&M : ClangModuleDeps) {
164 for (
auto &&M : ClangModuleDeps) {
167 if (AlreadySeen.count(M.first))
177 std::vector<std::string> Dependencies;
178 std::vector<PrebuiltModuleDep> PrebuiltModuleDeps;
179 std::map<std::string, ModuleDeps> ClangModuleDeps;
181 std::vector<std::string> OutputPaths;
182 const llvm::StringSet<> &AlreadySeen;
185 FullDependencyPrinterConsumer Consumer(AlreadySeen);
189 return std::move(Result);
190 return Consumer.getFullDependencies(CommandLine);