Skip to content

Commit 0fd75b4

Browse files
committed
ExplictModuleLoader: don't fail while no explicit Swift module map is specified
We will eventually move the protocol entirely to using a JSON file for explicit Swift modules. Before we finish migrating, we should be forgiving about using the legacy -swift-module-file argument.
1 parent 23ef061 commit 0fd75b4

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)