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:
Joe Groff
2013-12-20 23:06:16 +00:00
parent 3c192269d0
commit 63d08c786d
28 changed files with 667 additions and 326 deletions

View File

@@ -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;
}