@@ -2304,8 +2304,8 @@ bool ExplicitSwiftModuleLoader::findModule(
23042304 std::unique_ptr<llvm::MemoryBuffer> *ModuleBuffer,
23052305 std::unique_ptr<llvm::MemoryBuffer> *ModuleDocBuffer,
23062306 std::unique_ptr<llvm::MemoryBuffer> *ModuleSourceInfoBuffer,
2307- bool IsCanImportLookup , bool isTestableDependencyLookup ,
2308- bool &IsFramework, bool &IsSystemModule) {
2307+ std::string *cacheKey , bool IsCanImportLookup ,
2308+ bool isTestableDependencyLookup, bool &IsFramework, bool &IsSystemModule) {
23092309 // Find a module with an actual, physical name on disk, in case
23102310 // -module-alias is used (otherwise same).
23112311 //
@@ -2473,6 +2473,12 @@ ExplicitSwiftModuleLoader::create(ASTContext &ctx,
24732473 return result;
24742474}
24752475
2476+ void ExplicitSwiftModuleLoader::addExplicitModulePath (StringRef name,
2477+ std::string path) {
2478+ ExplicitSwiftModuleInputInfo entry (path, {}, {}, {});
2479+ Impl.ExplicitModuleMap .try_emplace (name, std::move (entry));
2480+ }
2481+
24762482struct ExplicitCASModuleLoader ::Implementation {
24772483 ASTContext &Ctx;
24782484 llvm::BumpPtrAllocator Allocator;
@@ -2660,8 +2666,8 @@ bool ExplicitCASModuleLoader::findModule(
26602666 std::unique_ptr<llvm::MemoryBuffer> *ModuleBuffer,
26612667 std::unique_ptr<llvm::MemoryBuffer> *ModuleDocBuffer,
26622668 std::unique_ptr<llvm::MemoryBuffer> *ModuleSourceInfoBuffer,
2663- bool IsCanImportLookup , bool IsTestableDependencyLookup ,
2664- bool &IsFramework, bool &IsSystemModule) {
2669+ std::string *CacheKey , bool IsCanImportLookup ,
2670+ bool IsTestableDependencyLookup, bool &IsFramework, bool &IsSystemModule) {
26652671 // Find a module with an actual, physical name on disk, in case
26662672 // -module-alias is used (otherwise same).
26672673 //
@@ -2681,6 +2687,8 @@ bool ExplicitCASModuleLoader::findModule(
26812687 // Set IsFramework bit according to the moduleInfo
26822688 IsFramework = moduleInfo.isFramework ;
26832689 IsSystemModule = moduleInfo.isSystem ;
2690+ if (CacheKey && moduleInfo.moduleCacheKey )
2691+ *CacheKey = *moduleInfo.moduleCacheKey ;
26842692
26852693 // Fallback check for module cache key passed on command-line as module path.
26862694 std::string moduleCASID = moduleInfo.moduleCacheKey
0 commit comments