COWArrayOpt: We could (and are now) also use a strong retain on the array storage

Swift SVN r22998
This commit is contained in:
Arnold Schwaighofer
2014-10-29 01:56:14 +00:00
parent 9d785080fd
commit e6c44a377b

View File

@@ -492,7 +492,7 @@ bool COWArrayOpt::checkSafeArrayValueUses(UserList &ArrayValueUsers) {
/// set is necessary.
bool COWArrayOpt::checkSafeArrayElementUse(SILInstruction *UseInst,
SILValue ArrayVal) {
if (isa<RetainValueInst>(UseInst) &&
if ((isa<RetainValueInst>(UseInst) || isa<StrongRetainInst>(UseInst)) &&
isRetainReleasedBeforeMutate(UseInst, ArrayVal))
return true;