diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-07-12 22:05:17 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-07-12 22:05:17 +0000 |
commit | 86625b5650cdddc38c0b4cc1eb7fb460478c9d11 (patch) | |
tree | 0163c4ca4fde1b4295691073258bb29cadfe8e35 /lib/ARCMigrate/TransBlockObjCVariable.cpp | |
parent | c286f3835eb6001c61664cef5d610dfaf80a6e9b (diff) |
[arcmt] Before applying '__weak' check whether the objc class is annotated with objc_arc_weak_reference_unavailable
or is in a list of classes not supporting 'weak'.
rdar://9489367.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135002 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ARCMigrate/TransBlockObjCVariable.cpp')
-rw-r--r-- | lib/ARCMigrate/TransBlockObjCVariable.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ARCMigrate/TransBlockObjCVariable.cpp b/lib/ARCMigrate/TransBlockObjCVariable.cpp index 97695cbccf..0e342b7a8f 100644 --- a/lib/ARCMigrate/TransBlockObjCVariable.cpp +++ b/lib/ARCMigrate/TransBlockObjCVariable.cpp @@ -98,12 +98,12 @@ public: BlocksAttr *attr = var->getAttr<BlocksAttr>(); if(!attr) continue; - bool hasWeak = Pass.Ctx.getLangOptions().ObjCRuntimeHasWeak; + bool useWeak = canApplyWeak(Pass.Ctx, var->getType()); SourceManager &SM = Pass.Ctx.getSourceManager(); Transaction Trans(Pass.TA); Pass.TA.replaceText(SM.getInstantiationLoc(attr->getLocation()), "__block", - hasWeak ? "__weak" : "__unsafe_unretained"); + useWeak ? "__weak" : "__unsafe_unretained"); } } |