Attr.ModifiedType = TL.getModifiedLoc().getType();
Attr.Dcl = D;
Attr.FullyMigratable = FullyMigratable;
+
+ if (ObjCPropertyDecl *PD = dyn_cast_or_null<ObjCPropertyDecl>(D))
+ MigrateCtx.PropGCAttrs[PD] = MigrateCtx.GCAttrs.size() - 1;
+
return true;
}
PropsTy &props = I->second;
if (!getPropertyType(props)->isObjCRetainableType())
continue;
- if (hasIvarWithExplicitOwnership(props))
+ if (hasIvarWithExplicitARCOwnership(props))
continue;
Transaction Trans(Pass.TA);
return false;
}
- bool hasIvarWithExplicitOwnership(PropsTy &props) const {
+ bool hasIvarWithExplicitARCOwnership(PropsTy &props) const {
+ if (Pass.isGCMigration())
+ return false;
+
for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I) {
if (isUserDeclared(I->IvarD)) {
if (isa<AttributedType>(I->IvarD->getType()))
bool FullyMigratable;
};
std::vector<GCAttrOccurrence> GCAttrs;
-
llvm::DenseSet<unsigned> AttrSet;
+ /// \brief Map of property decl to the index in the GCAttrs vector.
+ llvm::DenseMap<ObjCPropertyDecl *, unsigned> PropGCAttrs;
+
explicit MigrationContext(MigrationPass &pass) : Pass(pass) {}
~MigrationContext();