mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[serialization] Add support for lvalue types and pattern binding decls.
This revealed an issue where a function's pattern may have variables that depend on the function itself; it's therefore important that the function decl is recorded in the decl map before its argument patterns are loaded. We should now support structs, concrete properties, and computed properties. Swift SVN r5745
This commit is contained in:
@@ -166,12 +166,14 @@ namespace decls_block {
|
||||
IDENTIFIER_TYPE,
|
||||
FUNCTION_TYPE,
|
||||
METATYPE_TYPE,
|
||||
LVALUE_TYPE,
|
||||
|
||||
TYPE_ALIAS_DECL = 100,
|
||||
STRUCT_DECL,
|
||||
CONSTRUCTOR_DECL,
|
||||
VAR_DECL,
|
||||
FUNC_DECL,
|
||||
PATTERN_BINDING_DECL,
|
||||
|
||||
PAREN_PATTERN = 200,
|
||||
TUPLE_PATTERN,
|
||||
@@ -236,6 +238,13 @@ namespace decls_block {
|
||||
TypeIDField // instance type
|
||||
>;
|
||||
|
||||
using LValueTypeLayout = BCRecordLayout<
|
||||
LVALUE_TYPE,
|
||||
TypeIDField, // object type
|
||||
BCFixed<1>, // implicit?
|
||||
BCFixed<1> // non-settable?
|
||||
>;
|
||||
|
||||
using TypeAliasLayout = BCRecordLayout<
|
||||
TYPE_ALIAS_DECL,
|
||||
IdentifierIDField, // name
|
||||
@@ -286,6 +295,13 @@ namespace decls_block {
|
||||
DeclIDField // overridden function
|
||||
>;
|
||||
|
||||
using PatternBindingLayout = BCRecordLayout<
|
||||
PATTERN_BINDING_DECL,
|
||||
DeclIDField, // context decl
|
||||
BCFixed<1> // implicit flag
|
||||
// The pattern trails the record.
|
||||
>;
|
||||
|
||||
using ParenPatternLayout = BCRecordLayout<
|
||||
PAREN_PATTERN
|
||||
// The sub-pattern trails the record.
|
||||
|
||||
Reference in New Issue
Block a user