[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:
Jordan Rose
2013-06-21 17:51:53 +00:00
parent b57c8c4f62
commit c957a28f99
3 changed files with 136 additions and 35 deletions

View File

@@ -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.