summaryrefslogtreecommitdiffstats
path: root/clang/lib/Edit/RewriteObjCFoundationAPI.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-07-10 00:20:11 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-07-10 00:20:11 +0000
commita830ea7431afca36431825f028a3c7817d1a940d (patch)
tree0ad670005808009af4f414b0dcfe84edc04f049d /clang/lib/Edit/RewriteObjCFoundationAPI.cpp
parent93ebdd727ffdbc1ef276e5ca97134241bd031db3 (diff)
downloadbcm5719-llvm-a830ea7431afca36431825f028a3c7817d1a940d.tar.gz
bcm5719-llvm-a830ea7431afca36431825f028a3c7817d1a940d.zip
objc migrator: More refinment of property
attributes in migration. Specialli use of 'copy' attribute for retainable object types. llvm-svn: 185985
Diffstat (limited to 'clang/lib/Edit/RewriteObjCFoundationAPI.cpp')
-rw-r--r--clang/lib/Edit/RewriteObjCFoundationAPI.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/clang/lib/Edit/RewriteObjCFoundationAPI.cpp b/clang/lib/Edit/RewriteObjCFoundationAPI.cpp
index 05abbed14c3..e257a0b6f1c 100644
--- a/clang/lib/Edit/RewriteObjCFoundationAPI.cpp
+++ b/clang/lib/Edit/RewriteObjCFoundationAPI.cpp
@@ -362,16 +362,16 @@ bool edit::rewriteToObjCProperty(const ObjCMethodDecl *Getter,
const ParmVarDecl *argDecl = *Setter->param_begin();
QualType ArgType = argDecl->getType();
Qualifiers::ObjCLifetime propertyLifetime = ArgType.getObjCLifetime();
- if (propertyLifetime != Qualifiers::OCL_None) {
- PropertyString += "(";
- if (propertyLifetime == Qualifiers::OCL_Strong)
- PropertyString += "strong";
- else if (propertyLifetime == Qualifiers::OCL_Weak)
- PropertyString += "weak";
- else
- PropertyString += "unsafe_unretained";
- PropertyString += ")";
+
+ if (ArgType->isObjCRetainableType() &&
+ propertyLifetime == Qualifiers::OCL_Strong) {
+ PropertyString += "(copy)";
}
+ else if (propertyLifetime == Qualifiers::OCL_Weak)
+ PropertyString += "(weak)";
+ else
+ PropertyString += "(unsafe_unretained)";
+
QualType PropQT = Getter->getResultType();
PropertyString += " ";
PropertyString += PropQT.getAsString(NS.getASTContext().getPrintingPolicy());
OpenPOWER on IntegriCloud