From: Argyrios Kyrtzidis Date: Fri, 16 Mar 2012 00:10:35 +0000 (+0000) Subject: [arcmt] iOS is always safe to use 'weak'. rdar://10950825 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2af504bf157cce51bdb4a9bab0e6d3b34f898f6e;p=clang [arcmt] iOS is always safe to use 'weak'. rdar://10950825 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152878 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/ARCMigrate/Transforms.cpp b/lib/ARCMigrate/Transforms.cpp index c0adf16a11..170b7c8e15 100644 --- a/lib/ARCMigrate/Transforms.cpp +++ b/lib/ARCMigrate/Transforms.cpp @@ -74,6 +74,10 @@ bool trans::canApplyWeak(ASTContext &Ctx, QualType type, if (T.isNull()) return false; + // iOS is always safe to use 'weak'. + if (Ctx.getTargetInfo().getTriple().getOS() == llvm::Triple::IOS) + AllowOnUnknownClass = true; + while (const PointerType *ptr = T->getAs()) T = ptr->getPointeeType(); if (const ObjCObjectPointerType *ObjT = T->getAs()) {