@@ -326,13 +326,13 @@ class SwiftBinaryModuleDependencyStorage : public ModuleDependencyInfoStorageBas
326
326
const std::string &sourceInfoPath,
327
327
const std::vector<std::string> &moduleImports,
328
328
const std::vector<std::string> &optionalModuleImports,
329
- const std::vector<std:: string> &headerImports ,
329
+ const std::string &headerImport ,
330
330
const bool isFramework,
331
331
const std::string &moduleCacheKey)
332
332
: ModuleDependencyInfoStorageBase(ModuleDependencyKind::SwiftBinary,
333
333
moduleImports, optionalModuleImports, moduleCacheKey),
334
334
compiledModulePath (compiledModulePath), moduleDocPath(moduleDocPath),
335
- sourceInfoPath(sourceInfoPath), preCompiledBridgingHeaderPaths(headerImports ),
335
+ sourceInfoPath(sourceInfoPath), headerImport(headerImport ),
336
336
isFramework(isFramework) {}
337
337
338
338
ModuleDependencyInfoStorageBase *clone () const override {
@@ -348,8 +348,14 @@ class SwiftBinaryModuleDependencyStorage : public ModuleDependencyInfoStorageBas
348
348
// / The path to the .swiftSourceInfo file.
349
349
const std::string sourceInfoPath;
350
350
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;
353
359
354
360
// / A flag that indicates this dependency is a framework
355
361
const bool isFramework;
@@ -508,13 +514,13 @@ class ModuleDependencyInfo {
508
514
const std::string &sourceInfoPath,
509
515
const std::vector<std::string> &moduleImports,
510
516
const std::vector<std::string> &optionalModuleImports,
511
- const std::vector<std:: string> &headerImports ,
517
+ const std::string &headerImport ,
512
518
bool isFramework, const std::string &moduleCacheKey) {
513
519
return ModuleDependencyInfo (
514
520
std::make_unique<SwiftBinaryModuleDependencyStorage>(
515
521
compiledModulePath, moduleDocPath, sourceInfoPath,
516
522
moduleImports, optionalModuleImports,
517
- headerImports , isFramework, moduleCacheKey));
523
+ headerImport , isFramework, moduleCacheKey));
518
524
}
519
525
520
526
// / Describe the main Swift module.
@@ -598,6 +604,26 @@ class ModuleDependencyInfo {
598
604
return storage->swiftOverlayDependencies ;
599
605
}
600
606
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
+
601
627
std::vector<std::string> getCommandline () const {
602
628
if (auto *detail = getAsClangModule ())
603
629
return detail->buildCommandLine ;
@@ -751,12 +777,12 @@ class ModuleDependencyInfo {
751
777
// / Add source files
752
778
void addSourceFile (StringRef sourceFile);
753
779
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);
756
782
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);
760
786
761
787
// / Add bridging header include tree.
762
788
void addBridgingHeaderIncludeTree (StringRef ID);
0 commit comments