[Serialization] Encode depth for cross-refs to generic parameters

Otherwise, we can't represent a cross-reference to generic parameters
in a parent type /when used in an extension/.

https://bugs.swift.org/browse/SR-9084
This commit is contained in:
Jordan Rose
2018-10-26 16:51:44 -07:00
parent 191481f2a1
commit 3455510300
8 changed files with 151 additions and 5 deletions

View File

@@ -52,7 +52,7 @@ const uint16_t SWIFTMODULE_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 SWIFTMODULE_VERSION_MINOR = 455; // Last change: reorder block IDs
const uint16_t SWIFTMODULE_VERSION_MINOR = 456; // Last change: encode depth in generic param XREFs
using DeclIDField = BCFixed<31>;
@@ -1403,7 +1403,8 @@ namespace decls_block {
using XRefGenericParamPathPieceLayout = BCRecordLayout<
XREF_GENERIC_PARAM_PATH_PIECE,
BCVBR<5> // index
BCVBR<5>, // depth
BCVBR<5> // index
>;
using SILGenNameDeclAttrLayout = BCRecordLayout<