mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SIL] InitAccessors: Reference "self" in assign_or_init instruction
First step on the path to remove dependence on "setter".
This commit is contained in:
@@ -956,12 +956,14 @@ public:
|
||||
getSILDebugLocation(Loc), Src, Dest, Initializer, Setter, mode));
|
||||
}
|
||||
|
||||
AssignOrInitInst *createAssignOrInit(SILLocation Loc, SILValue Src,
|
||||
AssignOrInitInst *createAssignOrInit(SILLocation Loc,
|
||||
SILValue Self,
|
||||
SILValue Src,
|
||||
SILValue Initializer,
|
||||
SILValue Setter,
|
||||
AssignOrInitInst::Mode Mode) {
|
||||
return insert(new (getModule()) AssignOrInitInst(
|
||||
getSILDebugLocation(Loc), Src, Initializer, Setter, Mode));
|
||||
getSILDebugLocation(Loc), Self, Src, Initializer, Setter, Mode));
|
||||
}
|
||||
|
||||
StoreBorrowInst *createStoreBorrow(SILLocation Loc, SILValue Src,
|
||||
|
||||
@@ -1358,6 +1358,7 @@ void SILCloner<ImplClass>::visitAssignOrInitInst(AssignOrInitInst *Inst) {
|
||||
recordClonedInstruction(
|
||||
Inst, getBuilder().createAssignOrInit(
|
||||
getOpLocation(Inst->getLoc()),
|
||||
getOpValue(Inst->getSelf()),
|
||||
getOpValue(Inst->getSrc()),
|
||||
getOpValue(Inst->getInitializer()),
|
||||
getOpValue(Inst->getSetter()), Inst->getMode()));
|
||||
|
||||
@@ -4842,7 +4842,7 @@ class AssignOrInitInst
|
||||
friend SILBuilder;
|
||||
USE_SHARED_UINT8;
|
||||
|
||||
FixedOperandList<3> Operands;
|
||||
FixedOperandList<4> Operands;
|
||||
|
||||
/// Marks all of the properties in `initializes(...)` list that
|
||||
/// have been initialized before this intruction to help Raw SIL
|
||||
@@ -4862,14 +4862,14 @@ public:
|
||||
};
|
||||
|
||||
private:
|
||||
AssignOrInitInst(SILDebugLocation DebugLoc,
|
||||
SILValue Src, SILValue Initializer,
|
||||
SILValue Setter, Mode mode);
|
||||
AssignOrInitInst(SILDebugLocation DebugLoc, SILValue Self, SILValue Src,
|
||||
SILValue Initializer, SILValue Setter, Mode mode);
|
||||
|
||||
public:
|
||||
SILValue getSrc() const { return Operands[0].get(); }
|
||||
SILValue getInitializer() const { return Operands[1].get(); }
|
||||
SILValue getSetter() { return Operands[2].get(); }
|
||||
SILValue getSelf() const { return Operands[0].get(); }
|
||||
SILValue getSrc() const { return Operands[1].get(); }
|
||||
SILValue getInitializer() const { return Operands[2].get(); }
|
||||
SILValue getSetter() { return Operands[3].get(); }
|
||||
|
||||
Mode getMode() const {
|
||||
return Mode(sharedUInt8().AssignOrInitInst.mode);
|
||||
|
||||
Reference in New Issue
Block a user