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

@@ -804,6 +804,10 @@ public:
/// DerivedSelf designates "self" in a derived (non-root) class.
DerivedSelf,
/// Designates "self" in a derived (non-root) class whose stored properties
/// have already been initialized.
DerivedSelfOnly,
/// DelegatingSelf designates "self" on a struct, enum, or class
/// in a delegating constructor (one that calls self.init).
DelegatingSelf,
@@ -825,6 +829,9 @@ public:
bool isDerivedClassSelf() const {
return ThisKind == DerivedSelf;
}
bool isDerivedClassSelfOnly() const {
return ThisKind == DerivedSelfOnly;
}
bool isDelegatingSelf() const {
return ThisKind == DelegatingSelf;
}