@@ -326,13 +326,13 @@ class SwiftBinaryModuleDependencyStorage : public ModuleDependencyInfoStorageBas
326326 const std::string &sourceInfoPath,
327327 const std::vector<std::string> &moduleImports,
328328 const std::vector<std::string> &optionalModuleImports,
329- const std::vector<std:: string> &headerImports ,
329+ const std::string &headerImport ,
330330 const bool isFramework,
331331 const std::string &moduleCacheKey)
332332 : ModuleDependencyInfoStorageBase(ModuleDependencyKind::SwiftBinary,
333333 moduleImports, optionalModuleImports, moduleCacheKey),
334334 compiledModulePath (compiledModulePath), moduleDocPath(moduleDocPath),
335- sourceInfoPath(sourceInfoPath), preCompiledBridgingHeaderPaths(headerImports ),
335+ sourceInfoPath(sourceInfoPath), headerImport(headerImport ),
336336 isFramework(isFramework) {}
337337
338338 ModuleDependencyInfoStorageBase *clone () const override {
@@ -348,8 +348,14 @@ class SwiftBinaryModuleDependencyStorage : public ModuleDependencyInfoStorageBas
348348 // / The path to the .swiftSourceInfo file.
349349 const std::string sourceInfoPath;
350350
351- // / The paths of all the .pch dependencies of this module.
352- const std::vector<std::string> preCompiledBridgingHeaderPaths;
351+ // / The path of the .h dependency of this module.
352+ const std::string headerImport;
353+
354+ // / Source files on which the header inputs depend.
355+ std::vector<std::string> headerSourceFiles;
356+
357+ // / (Clang) modules on which the header inputs depend.
358+ std::vector<std::string> headerModuleDependencies;
353359
354360 // / A flag that indicates this dependency is a framework
355361 const bool isFramework;
@@ -508,13 +514,13 @@ class ModuleDependencyInfo {
508514 const std::string &sourceInfoPath,
509515 const std::vector<std::string> &moduleImports,
510516 const std::vector<std::string> &optionalModuleImports,
511- const std::vector<std:: string> &headerImports ,
517+ const std::string &headerImport ,
512518 bool isFramework, const std::string &moduleCacheKey) {
513519 return ModuleDependencyInfo (
514520 std::make_unique<SwiftBinaryModuleDependencyStorage>(
515521 compiledModulePath, moduleDocPath, sourceInfoPath,
516522 moduleImports, optionalModuleImports,
517- headerImports , isFramework, moduleCacheKey));
523+ headerImport , isFramework, moduleCacheKey));
518524 }
519525
520526 // / Describe the main Swift module.
@@ -598,6 +604,26 @@ class ModuleDependencyInfo {
598604 return storage->swiftOverlayDependencies ;
599605 }
600606
607+ const ArrayRef<std::string> getHeaderInputSourceFiles () const {
608+ if (auto *detail = getAsSwiftInterfaceModule ())
609+ return detail->textualModuleDetails .bridgingSourceFiles ;
610+ else if (auto *detail = getAsSwiftSourceModule ())
611+ return detail->textualModuleDetails .bridgingSourceFiles ;
612+ else if (auto *detail = getAsSwiftBinaryModule ())
613+ return detail->headerSourceFiles ;
614+ return {};
615+ }
616+
617+ const ArrayRef<std::string> getHeaderDependencies () const {
618+ if (auto *detail = getAsSwiftInterfaceModule ())
619+ return detail->textualModuleDetails .bridgingModuleDependencies ;
620+ else if (auto *detail = getAsSwiftSourceModule ())
621+ return detail->textualModuleDetails .bridgingModuleDependencies ;
622+ else if (auto *detail = getAsSwiftBinaryModule ())
623+ return detail->headerModuleDependencies ;
624+ return {};
625+ }
626+
601627 std::vector<std::string> getCommandline () const {
602628 if (auto *detail = getAsClangModule ())
603629 return detail->buildCommandLine ;
@@ -751,12 +777,12 @@ class ModuleDependencyInfo {
751777 // / Add source files
752778 void addSourceFile (StringRef sourceFile);
753779
754- // / Add source files that the bridging header depends on.
755- void addBridgingSourceFile (StringRef bridgingSourceFile);
780+ // / Add source files that the header input depends on.
781+ void addHeaderSourceFile (StringRef bridgingSourceFile);
756782
757- // / Add (Clang) module on which the bridging header depends.
758- void addBridgingModuleDependency (StringRef module ,
759- llvm::StringSet<> &alreadyAddedModules);
783+ // / Add (Clang) modules on which a non- bridging header input depends.
784+ void addHeaderInputModuleDependency (StringRef module ,
785+ llvm::StringSet<> &alreadyAddedModules);
760786
761787 // / Add bridging header include tree.
762788 void addBridgingHeaderIncludeTree (StringRef ID);
0 commit comments