Introduce a new null_class SIL instruction for forming a null pointer

reference to something of class type.  This is required to model
RebindSelfInConstructorExpr correctly to DI, since in the class case, 
self.init and super.init *take* a value out of class box so that it 
can pass the +1 value without performing an extra retain.  Nothing
else in the compiler uninitializes a DI-controlled memory object
like this, so nothing else needs this.  DI really doesn't like something
going from initialized to uninitialized.

Yes, I feel super-gross about this and am really unhappy about it.  I
may end up reverting this if I can find an alternate solution to this
problem.



Swift SVN r27525
This commit is contained in:
Chris Lattner
2015-04-21 05:56:55 +00:00
parent f2455bd668
commit 42b4a966b0
18 changed files with 105 additions and 12 deletions

View File

@@ -92,6 +92,7 @@ static bool isTransitiveEscapeInst(SILInstruction *Inst) {
case ValueKind::DeinitExistentialAddrInst:
case ValueKind::UnreachableInst:
case ValueKind::IsNonnullInst:
case ValueKind::NullClassInst:
case ValueKind::CondFailInst:
case ValueKind::DynamicMethodBranchInst:
case ValueKind::ReturnInst: