Skip to content

Commit b2f809a

Browse files
authored
Merge pull request #32469 from nkcsgexi/forgive-no-explicit-module-map
ExplictModuleLoader: don't fail while no explicit Swift module map is specified
2 parents 87bee8f + 0fd75b4 commit b2f809a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/Frontend/ModuleInterfaceLoader.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,8 +1602,11 @@ ExplicitSwiftModuleLoader::create(ASTContext &ctx,
16021602
new ExplicitSwiftModuleLoader(ctx, tracker, loadMode,
16031603
IgnoreSwiftSourceInfoFile));
16041604
auto &Impl = result->Impl;
1605-
// Parse a JSON file to collect explicitly built modules.
1606-
Impl.parseSwiftExplicitModuleMap(ExplicitSwiftModuleMap);
1605+
// If the explicit module map is given, try parse it.
1606+
if (!ExplicitSwiftModuleMap.empty()) {
1607+
// Parse a JSON file to collect explicitly built modules.
1608+
Impl.parseSwiftExplicitModuleMap(ExplicitSwiftModuleMap);
1609+
}
16071610
// Collect .swiftmodule paths from -swift-module-path
16081611
// FIXME: remove these.
16091612
for (auto path: ExplicitModulePaths) {

0 commit comments

Comments
 (0)