mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Add an option to output modules regardless of errors
Adds a new frontend option "-experimental-allow-module-with-compiler-errors". If any compilation errors occur while generating the .swiftmodule, this mode will skip SIL entirely and only serialize the (likey invalid) AST. This existence of this option during generation is serialized into the resulting .swiftmodule. Errors found in deserialization are only allowed if it is set. Primarily intended for IDE requests (eg. indexing and code completion) to ensure robust cross-module results, despite possible errors. Resolves rdar://69815975
This commit is contained in:
@@ -145,6 +145,9 @@ static bool readOptionsBlock(llvm::BitstreamCursor &cursor,
|
||||
options_block::ResilienceStrategyLayout::readRecord(scratch, Strategy);
|
||||
extendedInfo.setResilienceStrategy(ResilienceStrategy(Strategy));
|
||||
break;
|
||||
case options_block::IS_ALLOW_MODULE_WITH_COMPILER_ERRORS_ENABLED:
|
||||
extendedInfo.setAllowModuleWithCompilerErrorsEnabled(true);
|
||||
break;
|
||||
default:
|
||||
// Unknown options record, possibly for use by a future version of the
|
||||
// module format.
|
||||
@@ -1150,6 +1153,8 @@ ModuleFileSharedCore::ModuleFileSharedCore(
|
||||
Bits.IsTestable = extInfo.isTestable();
|
||||
Bits.ResilienceStrategy = unsigned(extInfo.getResilienceStrategy());
|
||||
Bits.IsImplicitDynamicEnabled = extInfo.isImplicitDynamicEnabled();
|
||||
Bits.IsAllowModuleWithCompilerErrorsEnabled =
|
||||
extInfo.isAllowModuleWithCompilerErrorsEnabled();
|
||||
MiscVersion = info.miscVersion;
|
||||
|
||||
hasValidControlBlock = true;
|
||||
|
||||
Reference in New Issue
Block a user