mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -44,7 +44,6 @@ static void LowerAssignInstruction(SILBuilder &B, AssignInst *Inst,
|
||||
|
||||
++NumAssignRewritten;
|
||||
|
||||
auto &M = Inst->getModule();
|
||||
SILValue Src = Inst->getSrc();
|
||||
|
||||
// If this is an initialization, or the storage type is trivial, we
|
||||
@@ -54,7 +53,7 @@ static void LowerAssignInstruction(SILBuilder &B, AssignInst *Inst,
|
||||
// assignment with a store. If it has non-trivial type and is an
|
||||
// initialization, we can also replace it with a store.
|
||||
if (isInitialization == IsInitialization ||
|
||||
Inst->getDest().getType().isTrivial(M)) {
|
||||
Inst->getDest().getType().isTrivial(Inst->getModule())) {
|
||||
B.createStore(Inst->getLoc(), Src, Inst->getDest());
|
||||
} else {
|
||||
// Otherwise, we need to replace the assignment with the full
|
||||
|
||||
Reference in New Issue
Block a user