summaryrefslogtreecommitdiffstats
path: root/clang/lib/ARCMigrate/TransProperties.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-07-12 22:05:17 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-07-12 22:05:17 +0000
commitce9b73999974bf2efae2dd614dcec67017b817fe (patch)
treee14d2658166b51d3f944ebc90a6d5af5a87c67ad /clang/lib/ARCMigrate/TransProperties.cpp
parentc0f6af21037789f7fc6c1c44014d3c527482e574 (diff)
downloadbcm5719-llvm-ce9b73999974bf2efae2dd614dcec67017b817fe.tar.gz
bcm5719-llvm-ce9b73999974bf2efae2dd614dcec67017b817fe.zip
[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. llvm-svn: 135002
Diffstat (limited to 'clang/lib/ARCMigrate/TransProperties.cpp')
-rw-r--r--clang/lib/ARCMigrate/TransProperties.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/ARCMigrate/TransProperties.cpp b/clang/lib/ARCMigrate/TransProperties.cpp
index 0efc4c0fadf..82ef717f315 100644
--- a/clang/lib/ARCMigrate/TransProperties.cpp
+++ b/clang/lib/ARCMigrate/TransProperties.cpp
@@ -112,7 +112,7 @@ public:
}
void applyWeak(PropData &prop) {
- assert(Pass.Ctx.getLangOptions().ObjCRuntimeHasWeak);
+ assert(canApplyWeak(Pass.Ctx, prop.IvarD->getType()));
Transaction Trans(Pass.TA);
Pass.TA.insert(prop.IvarD->getLocation(), "__weak ");
@@ -157,7 +157,7 @@ public:
// There is a "error: existing ivar for assign property must be
// __unsafe_unretained"; fix it.
- if (!Pass.Ctx.getLangOptions().ObjCRuntimeHasWeak) {
+ if (!canApplyWeak(Pass.Ctx, ivarD->getType())) {
// We will just add __unsafe_unretained to the ivar.
Transaction Trans(Pass.TA);
Pass.TA.insert(ivarD->getLocation(), "__unsafe_unretained ");
OpenPOWER on IntegriCloud