summaryrefslogtreecommitdiffstats
path: root/clang/lib/ARCMigrate/TransGCAttrs.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-11-28 02:04:36 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-11-28 02:04:36 +0000
commiteca1f36a54dd9dcc5d44d324b79fab599edb3d18 (patch)
tree568031b60092c4aa5f5990b070553ce0d947f0b8 /clang/lib/ARCMigrate/TransGCAttrs.cpp
parenta0d652e71ba9905d754f6037490f231aa4151935 (diff)
downloadbcm5719-llvm-eca1f36a54dd9dcc5d44d324b79fab599edb3d18.tar.gz
bcm5719-llvm-eca1f36a54dd9dcc5d44d324b79fab599edb3d18.zip
[arcmt] Integrate GC __weak into property attributes even when we don't have
the implementation. llvm-svn: 145224
Diffstat (limited to 'clang/lib/ARCMigrate/TransGCAttrs.cpp')
-rw-r--r--clang/lib/ARCMigrate/TransGCAttrs.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/ARCMigrate/TransGCAttrs.cpp b/clang/lib/ARCMigrate/TransGCAttrs.cpp
index 607e5a0f3d9..1c645ace89a 100644
--- a/clang/lib/ARCMigrate/TransGCAttrs.cpp
+++ b/clang/lib/ARCMigrate/TransGCAttrs.cpp
@@ -261,9 +261,12 @@ static void checkAllAtProps(MigrationContext &MigrateCtx,
SmallVector<std::pair<AttributedTypeLoc, ObjCPropertyDecl *>, 4> ATLs;
bool hasWeak = false, hasStrong = false;
+ ObjCPropertyDecl::PropertyAttributeKind
+ Attrs = ObjCPropertyDecl::OBJC_PR_noattr;
for (IndivPropsTy::iterator
PI = IndProps.begin(), PE = IndProps.end(); PI != PE; ++PI) {
ObjCPropertyDecl *PD = *PI;
+ Attrs = PD->getPropertyAttributesAsWritten();
TypeSourceInfo *TInfo = PD->getTypeSourceInfo();
if (!TInfo)
return;
@@ -300,9 +303,10 @@ static void checkAllAtProps(MigrationContext &MigrateCtx,
else
toAttr = "unsafe_unretained";
}
- if (!MigrateCtx.rewritePropertyAttribute("assign", toAttr, AtLoc)) {
- return;
- }
+ if (Attrs & ObjCPropertyDecl::OBJC_PR_assign)
+ MigrateCtx.rewritePropertyAttribute("assign", toAttr, AtLoc);
+ else
+ MigrateCtx.addPropertyAttribute(toAttr, AtLoc);
}
for (unsigned i = 0, e = ATLs.size(); i != e; ++i) {
OpenPOWER on IntegriCloud