mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
AST: Serialize -enable-resilience flag on the ModuleDecl
Since resilience is a property of the module being compiled, not decls being accessed, we need to record which types are resilient as part of the module. Previously we would only ever look at the @_fixed_layout attribute on a type. If the flag was not specified, Sema would slap this attribute on every type that gets validated. This is wasteful for non-resilient builds, because there all types get the attribute. It was also apparently wrong, and I don't fully understand when Sema decides to validate which decls. It is much cleaner conceptually to just serialize this flag with the module, and check for its presence if the attribute was not found on a type.
This commit is contained in:
@@ -109,6 +109,9 @@ static bool readOptionsBlock(llvm::BitstreamCursor &cursor,
|
||||
case options_block::IS_TESTABLE:
|
||||
extendedInfo.setIsTestable(true);
|
||||
break;
|
||||
case options_block::IS_RESILIENT:
|
||||
extendedInfo.setIsResilient(true);
|
||||
break;
|
||||
default:
|
||||
// Unknown options record, possibly for use by a future version of the
|
||||
// module format.
|
||||
|
||||
Reference in New Issue
Block a user