mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[InterfaceGen] Print property initializers in resilient, fixed-layout types (#19619)
Augment the ASTPrinter to print the name and text of initializer expressions if a property has an initializer and the type is @_fixed_layout and resides in a resilient module, and serialize the text for partial modules. With this change, all .swiftinterface files in the project (except for SwiftLang) compile to swiftmodules on macOS. rdar://43774580 rdar://43812188
This commit is contained in:
@@ -55,7 +55,7 @@ const uint16_t VERSION_MAJOR = 0;
|
||||
/// describe what change you made. The content of this comment isn't important;
|
||||
/// it just ensures a conflict if two people change the module format.
|
||||
/// Don't worry about adhering to the 80-column limit for this line.
|
||||
const uint16_t VERSION_MINOR = 450; // Last change: don't serialize requirement environment
|
||||
const uint16_t VERSION_MINOR = 451; // Last change: pattern initializer text
|
||||
|
||||
using DeclIDField = BCFixed<31>;
|
||||
|
||||
@@ -1478,7 +1478,8 @@ namespace decls_block {
|
||||
using PatternBindingInitializerLayout = BCRecordLayout<
|
||||
PATTERN_BINDING_INITIALIZER_CONTEXT,
|
||||
DeclIDField, // parent pattern binding decl
|
||||
BCVBR<3> // binding index in the pattern binding decl
|
||||
BCVBR<3>, // binding index in the pattern binding decl
|
||||
BCBlob // initializer text, if present
|
||||
>;
|
||||
|
||||
using DefaultArgumentInitializerLayout = BCRecordLayout<
|
||||
|
||||
Reference in New Issue
Block a user