mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL: Handle metatype abstraction differences.
Lower metatype types as @thin or @thick based on whether the type is static and whether the abstraction pattern allows for a thin metatype. Add a '@thick' attribute and require SIL metatypes to always be annotated with either '@thin' or '@thick' to distinguish them from unlowered metatypes. Swift SVN r11525
This commit is contained in:
@@ -1545,8 +1545,11 @@ void Serializer::writeType(Type ty) {
|
||||
auto metatypeTy = cast<MetatypeType>(ty.getPointer());
|
||||
|
||||
unsigned abbrCode = DeclTypeAbbrCodes[MetatypeTypeLayout::Code];
|
||||
bool hasThin = metatypeTy->hasThin();
|
||||
bool isThin = hasThin ? metatypeTy->isThin() : false;
|
||||
MetatypeTypeLayout::emitRecord(Out, ScratchRecord, abbrCode,
|
||||
addTypeRef(metatypeTy->getInstanceType()));
|
||||
addTypeRef(metatypeTy->getInstanceType()),
|
||||
hasThin, isThin);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user