Skip to content

Commit 8f03720

Browse files
authored
Merge pull request swiftlang#33387 from nkcsgexi/65570721-master
Serialization: add an option to allow deserializing @_implementationOnly dependencies
2 parents 05c3333 + fe27ad3 commit 8f03720

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,12 @@ namespace swift {
385385
/// Load swiftmodule files in memory as volatile and avoid mmap.
386386
bool EnableVolatileModules = false;
387387

388+
/// Allow deserializing implementation only dependencies. This should only
389+
/// be set true by lldb and other tooling, so that deserilization
390+
/// recovery issues won't bring down the debugger.
391+
/// TODO: remove this when @_implementationOnly modules are robust enough.
392+
bool AllowDeserializingImplementationOnly = false;
393+
388394
/// Sets the target we are building for and updates platform conditions
389395
/// to match.
390396
///

lib/Serialization/Deserialization.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2006,7 +2006,8 @@ ModuleDecl *ModuleFile::getModule(ModuleID MID) {
20062006
llvm_unreachable("implementation detail only");
20072007
}
20082008
}
2009-
return getModule(getIdentifier(MID));
2009+
return getModule(getIdentifier(MID),
2010+
getContext().LangOpts.AllowDeserializingImplementationOnly);
20102011
}
20112012

20122013
ModuleDecl *ModuleFile::getModule(ArrayRef<Identifier> name,

0 commit comments

Comments
 (0)