Don't actually add the __unsafe_unretained qualifier in MRC;
driving a canonical difference between that and an unqualified type is a really bad idea when both are valid. Instead, remember that it was there in a non-canonical way, then look for that in the one place we really care about it: block captures. The net effect closely resembles the behavior of a decl attribute, except still closely following ARC's standard qualifier parsing rules. llvm-svn: 253534
This commit is contained in:
@@ -399,9 +399,15 @@ static void computeBlockInfo(CodeGenModule &CGM, CodeGenFunction *CGF,
|
||||
|
||||
// Block pointers require copy/dispose. So do Objective-C pointers.
|
||||
} else if (variable->getType()->isObjCRetainableType()) {
|
||||
info.NeedsCopyDispose = true;
|
||||
// used for mrr below.
|
||||
lifetime = Qualifiers::OCL_Strong;
|
||||
// But honor the inert __unsafe_unretained qualifier, which doesn't
|
||||
// actually make it into the type system.
|
||||
if (variable->getType()->isObjCInertUnsafeUnretainedType()) {
|
||||
lifetime = Qualifiers::OCL_ExplicitNone;
|
||||
} else {
|
||||
info.NeedsCopyDispose = true;
|
||||
// used for mrr below.
|
||||
lifetime = Qualifiers::OCL_Strong;
|
||||
}
|
||||
|
||||
// So do types that require non-trivial copy construction.
|
||||
} else if (CI.hasCopyExpr()) {
|
||||
|
||||
Reference in New Issue
Block a user