aboutsummaryrefslogtreecommitdiff
path: root/lib/ARCMigrate/Transforms.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-06-17 06:42:21 +0000
committerJohn McCall <rjmccall@apple.com>2011-06-17 06:42:21 +0000
commit7acddacc921cd0b3f813443a8641eeddb82dfbd4 (patch)
treed5abc49c4f8c85ffeb9505ae60ef9e3f1f6f9231 /lib/ARCMigrate/Transforms.cpp
parent3724020559653f11d1327ff41676a06afe3a678f (diff)
Objective-C fast enumeration loop variables are not retained in ARC, but
they should still be officially __strong for the purposes of errors, block capture, etc. Make a new bit on variables, isARCPseudoStrong(), and set this for 'self' and these enumeration-loop variables. Change the code that was looking for the old patterns to look for this bit, and change IR generation to find this bit and treat the resulting variable as __unsafe_unretained for the purposes of init/destroy in the two places it can come up. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133243 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ARCMigrate/Transforms.cpp')
-rw-r--r--lib/ARCMigrate/Transforms.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/ARCMigrate/Transforms.cpp b/lib/ARCMigrate/Transforms.cpp
index ab3bc1dbe7..0c9096296d 100644
--- a/lib/ARCMigrate/Transforms.cpp
+++ b/lib/ARCMigrate/Transforms.cpp
@@ -421,10 +421,7 @@ public:
if (IsLV != Expr::MLV_ConstQualified)
return true;
VarDecl *var = cast<VarDecl>(declRef->getDecl());
- if (var->getType().getLocalQualifiers().getObjCLifetime()
- == Qualifiers::OCL_ExplicitNone &&
- (var->getTypeSourceInfo() &&
- !var->getTypeSourceInfo()->getType().isConstQualified())) {
+ if (var->isARCPseudoStrong()) {
Transaction Trans(Pass.TA);
if (Pass.TA.clearDiagnostic(diag::err_typecheck_arr_assign_enumeration,
Exp->getOperatorLoc())) {