mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Replace nominal type descriptors with a hierarchy of context descriptors.
This new format more efficiently represents existing information, while more accurately encoding important information about nested generic contexts with same-type and layout constraints that need to be evaluated at runtime. It's also designed with an eye to forward- and backward-compatible expansion for ABI stability with future Swift versions.
This commit is contained in:
@@ -192,7 +192,7 @@ GenericMetadataTest<StructMetadata, 1> MetadataTest1 = {
|
||||
// Fields
|
||||
{
|
||||
MetadataKind::Struct,
|
||||
reinterpret_cast<const NominalTypeDescriptor*>(&Global1)
|
||||
reinterpret_cast<const TypeContextDescriptor*>(&Global1)
|
||||
},
|
||||
|
||||
// Arguments
|
||||
@@ -300,7 +300,7 @@ TEST(MetadataTest, getGenericMetadata) {
|
||||
auto fields = reinterpret_cast<void * const *>(inst);
|
||||
|
||||
EXPECT_EQ(MetadataKind::Struct, inst->getKind());
|
||||
EXPECT_EQ(reinterpret_cast<const NominalTypeDescriptor *>(&Global1),
|
||||
EXPECT_EQ(reinterpret_cast<const TypeContextDescriptor *>(&Global1),
|
||||
inst->Description);
|
||||
|
||||
EXPECT_EQ(&Global2, fields[2]);
|
||||
@@ -318,7 +318,7 @@ TEST(MetadataTest, getGenericMetadata) {
|
||||
|
||||
auto fields = reinterpret_cast<void * const *>(inst);
|
||||
EXPECT_EQ(MetadataKind::Struct, inst->getKind());
|
||||
EXPECT_EQ(reinterpret_cast<const NominalTypeDescriptor *>(&Global1),
|
||||
EXPECT_EQ(reinterpret_cast<const TypeContextDescriptor *>(&Global1),
|
||||
inst->Description);
|
||||
|
||||
EXPECT_EQ(&Global3, fields[2]);
|
||||
|
||||
Reference in New Issue
Block a user