DI: Add non-working code for handling value_metatype when used on an address-only type

This commit is contained in:
Slava Pestov
2020-10-23 22:22:22 -04:00
parent 7f2b01ccb3
commit 37f2bc1e59
3 changed files with 56 additions and 26 deletions

View File

@@ -1409,6 +1409,10 @@ collectDelegatingInitUses(const DIMemoryObjectInfo &TheMemory,
Kind = DIUseKind::LoadForTypeOfSelf;
}
}
// value_metatype may also use the 'self' value directly, if it has an
// address-only type.
if (isa<ValueMetatypeInst>(User))
Kind = DIUseKind::TypeOfSelf;
// We can safely handle anything else as an escape. They should all happen
// after self.init is invoked.