This is part of a series of commits to remove reference forwarding for

some of the ARC entry points. rdar://22724641. After this commit,
swift_retain_noresult will be completely replaced by swift_retain.
LLVMARCOpts pass is modified NOT to rewrite swift_retain to
swift_retain_noresult which forward no reference.

Swift SVN r32082
This commit is contained in:
Xin Tong
2015-09-18 21:56:50 +00:00
parent 9d2dd5ea1e
commit dca508bfbb
22 changed files with 79 additions and 156 deletions

View File

@@ -941,7 +941,7 @@ static bool _dynamicCastToExistential(OpaqueValue *dest,
auto object = *(reinterpret_cast<HeapObject**>(srcDynamicValue));
destExistential->Value = object;
if (!canTake || !(flags & DynamicCastFlags::TakeOnSuccess)) {
swift_retain_noresult(object);
swift_retain(object);
}
maybeDeallocateSourceAfterSuccess();
return true;