-Remove unnecessary 'return'.
-Remove unnecessary 'if' check (llvm_unreachable make sure attrStr will be non-null)
-Add a test of transferring ownership to a reference cast type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134285
91177308-0d34-0410-b5e6-
96231b3b80d8
else if (const PointerType *PT = T->getAs<PointerType>())
T = PT->getPointeeType();
else if (const ReferenceType *RT = T->getAs<ReferenceType>())
- RT->getPointeeType();
+ T = RT->getPointeeType();
else
break;
}
qs.addObjCLifetime(ownership);
declSpecTy = S.Context.getQualifiedType(declSpecTy, qs);
}
- return;
}
static void transferARCOwnershipToDeclaratorChunk(TypeProcessingState &state,
case Qualifiers::OCL_Weak: attrStr = "weak"; break;
case Qualifiers::OCL_Autoreleasing: attrStr = "autoreleasing"; break;
}
- if (!attrStr)
- return;
// If there wasn't one, add one (with an invalid source location
// so that we don't make an AttributedType for it).
void ownership_transfer_in_cast(void *vp, Block *pblk) {
__strong NSString **sip2 = static_cast<NSString **>(static_cast<__strong id *>(vp));
+ __strong NSString **&si2pref = static_cast<NSString **&>(sip2);
__weak NSString **wip2 = static_cast<NSString **>(static_cast<__weak id *>(vp));
__autoreleasing id *aip2 = static_cast<id *>(static_cast<__autoreleasing id *>(vp));
__unsafe_unretained id *uip2 = static_cast<id *>(static_cast<__unsafe_unretained id *>(vp));