[NamedLazyMemberLoading] Add initial bits of serialized Decl member tables.

This commit is contained in:
Graydon Hoare
2017-10-27 23:29:26 -07:00
parent 09301cfbb4
commit c78e04cd4f
4 changed files with 193 additions and 1 deletions

View File

@@ -54,7 +54,7 @@ const uint16_t VERSION_MAJOR = 0;
/// in source control, you should also update the comment to briefly
/// 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.
const uint16_t VERSION_MINOR = 377; // Last change: SILFunctionType witness_method conformances
const uint16_t VERSION_MINOR = 378; // Last change: DECL_MEMBER_NAMES
using DeclIDField = BCFixed<31>;
@@ -440,6 +440,11 @@ enum BlockID {
/// \sa index_block
INDEX_BLOCK_ID,
/// The declaration member-tables index block, a sub-blocb of the index block.
///
/// \sa decl_member_tables_block
DECL_MEMBER_TABLES_BLOCK_ID,
/// The block for SIL functions.
///
/// \sa sil_block
@@ -1516,6 +1521,7 @@ namespace index_block {
PRECEDENCE_GROUPS,
NESTED_TYPE_DECLS,
DECL_MEMBER_NAMES,
LastRecordKind = PRECEDENCE_GROUPS,
};
@@ -1559,12 +1565,32 @@ namespace index_block {
BCBlob // map from identifier strings to decl kinds / decl IDs
>;
using DeclMemberNamesLayout = BCRecordLayout<
DECL_MEMBER_NAMES, // record ID
BCVBR<16>, // table offset within the blob (see below)
BCBlob // map from member DeclBaseNames to offsets of DECL_MEMBERS records
>;
using EntryPointLayout = BCRecordLayout<
ENTRY_POINT,
DeclIDField // the ID of the main class; 0 if there was a main source file
>;
}
/// \sa DECL_MEMBER_TABLES_BLOCK_ID
namespace decl_member_tables_block {
enum RecordKind {
DECL_MEMBERS = 1,
};
using DeclMembersLayout = BCRecordLayout<
DECL_MEMBERS, // record ID
BCVBR<16>, // table offset within the blob (see below)
BCBlob // maps from DeclIDs to DeclID vectors
>;
}
/// \sa COMMENT_BLOCK_ID
namespace comment_block {
enum RecordKind {