Rework the assign instruction in two major ways:

1. Change assign to follow SILGen's model for a semantic assignment,
   which (in the case of unowned pointers) doesn't require the left
   and right hand sides to be the same.
2. Change assign to consume/take the refcount from the LHS, following
   SILGen's design (which I completely misunderstood before).



Swift SVN r7787
This commit is contained in:
Chris Lattner
2013-08-30 17:59:56 +00:00
parent c0ddd3504e
commit fc04d57bd0
7 changed files with 116 additions and 66 deletions

View File

@@ -616,6 +616,10 @@ public:
SILValue getSrc() const { return Operands[Src].get(); }
SILValue getDest() const { return Operands[Dest].get(); }
bool isUnownedAssign() const {
return getDest().getType().getObjectType().is<UnownedStorageType>();
}
ArrayRef<Operand> getAllOperands() const { return Operands.asArray(); }
MutableArrayRef<Operand> getAllOperands() { return Operands.asArray(); }