Definite initialization for initializers relying on a separate ivar initializer.

When we decide to emit a separate ivar initializer method (via the
Objective-C entry point -.cxx_construct), we no longer initialize the
ivars within the initializer. This only happens for derived classes,
so teach DI about uninitialized 'self' values that require a
super.init call but don't require the ivars to be initialized.



Swift SVN r12240
This commit is contained in:
Doug Gregor
2014-01-13 19:41:16 +00:00
parent 357986bb9e
commit c6b880a9b7
8 changed files with 53 additions and 8 deletions

View File

@@ -78,7 +78,14 @@ DIMemoryObjectInfo::DIMemoryObjectInfo(SILInstruction *MI) {
NumElements = 1;
return;
}
// If this is a derived class init method for which stored properties are
// separately initialized, track an element for the super.init call.
if (isDerivedClassSelfOnly()) {
NumElements = 1;
return;
}
// Otherwise, we break down the initializer.
NumElements = getElementCountRec(getType(), IsSelfOfNonDelegatingInitializer);