@@ -367,13 +367,15 @@ class SwiftBinaryModuleDependencyStorage
367
367
const std::string &sourceInfoPath,
368
368
const std::vector<ScannerImportStatementInfo> &moduleImports,
369
369
const std::vector<ScannerImportStatementInfo> &optionalModuleImports,
370
- const std::string &headerImport, const bool isFramework,
370
+ const std::string &headerImport,
371
+ const std::string &definingModuleInterface, const bool isFramework,
371
372
const std::string &moduleCacheKey)
372
373
: ModuleDependencyInfoStorageBase(ModuleDependencyKind::SwiftBinary,
373
374
moduleImports, optionalModuleImports,
374
375
moduleCacheKey),
375
376
compiledModulePath (compiledModulePath), moduleDocPath(moduleDocPath),
376
377
sourceInfoPath(sourceInfoPath), headerImport(headerImport),
378
+ definingModuleInterfacePath(definingModuleInterface),
377
379
isFramework(isFramework) {}
378
380
379
381
ModuleDependencyInfoStorageBase *clone () const override {
@@ -392,6 +394,10 @@ class SwiftBinaryModuleDependencyStorage
392
394
// / The path of the .h dependency of this module.
393
395
const std::string headerImport;
394
396
397
+ // / The path of the defining .swiftinterface that this
398
+ // / binary .swiftmodule was built from, if one exists.
399
+ const std::string definingModuleInterfacePath;
400
+
395
401
// / Source files on which the header inputs depend.
396
402
std::vector<std::string> headerSourceFiles;
397
403
@@ -401,6 +407,15 @@ class SwiftBinaryModuleDependencyStorage
401
407
// / A flag that indicates this dependency is a framework
402
408
const bool isFramework;
403
409
410
+ // / Return the path to the defining .swiftinterface of this module
411
+ // / of one was determined. Otherwise, return the .swiftmodule path
412
+ // / itself.
413
+ std::string getDefiningModulePath () const {
414
+ if (definingModuleInterfacePath.empty ())
415
+ return compiledModulePath;
416
+ return definingModuleInterfacePath;
417
+ }
418
+
404
419
static bool classof (const ModuleDependencyInfoStorageBase *base) {
405
420
return base->dependencyKind == ModuleDependencyKind::SwiftBinary;
406
421
}
@@ -560,12 +575,13 @@ class ModuleDependencyInfo {
560
575
const std::vector<ScannerImportStatementInfo> &moduleImports,
561
576
const std::vector<ScannerImportStatementInfo> &optionalModuleImports,
562
577
const std::string &headerImport,
578
+ const std::string &definingModuleInterface,
563
579
bool isFramework, const std::string &moduleCacheKey) {
564
580
return ModuleDependencyInfo (
565
581
std::make_unique<SwiftBinaryModuleDependencyStorage>(
566
582
compiledModulePath, moduleDocPath, sourceInfoPath,
567
- moduleImports, optionalModuleImports,
568
- headerImport , isFramework, moduleCacheKey));
583
+ moduleImports, optionalModuleImports, headerImport,
584
+ definingModuleInterface , isFramework, moduleCacheKey));
569
585
}
570
586
571
587
// / Describe the main Swift module.
0 commit comments