[cfe-commits] r135065 - in /cfe/trunk: lib/ARCMigrate/TransProperties.cpp lib/ARCMigrate/Transforms.cpp lib/ARCMigrate/Transforms.h test/ARCMT/assign-prop-no-arc-runtime.m.result test/ARCMT/assign-prop-with-arc-runtime.m test/ARCMT/assign-prop-with-arc-runtime.m.result test/ARCMT/releases-driver.m.result test/ARCMT/releases.m.result test/ARCMT/remove-dealloc-method.m.result test/ARCMT/remove-dealloc-zerouts.m.result test/ARCMT/retains.m.result

Argyrios Kyrtzidis akyrtzi at gmail.com
Wed Jul 13 12:22:01 PDT 2011


Author: akirtzidis
Date: Wed Jul 13 14:22:00 2011
New Revision: 135065

URL: http://llvm.org/viewvc/llvm-project?rev=135065&view=rev
Log:
[arcmt] For properties rewrite 'assign' -> 'weak or unsafe_unretained', 'retain' -> 'strong', and add
'weak or unsafe_unretained' when 'assign' is missing. rdar://9496219&9602589.

Modified:
    cfe/trunk/lib/ARCMigrate/TransProperties.cpp
    cfe/trunk/lib/ARCMigrate/Transforms.cpp
    cfe/trunk/lib/ARCMigrate/Transforms.h
    cfe/trunk/test/ARCMT/assign-prop-no-arc-runtime.m.result
    cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m
    cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m.result
    cfe/trunk/test/ARCMT/releases-driver.m.result
    cfe/trunk/test/ARCMT/releases.m.result
    cfe/trunk/test/ARCMT/remove-dealloc-method.m.result
    cfe/trunk/test/ARCMT/remove-dealloc-zerouts.m.result
    cfe/trunk/test/ARCMT/retains.m.result

Modified: cfe/trunk/lib/ARCMigrate/TransProperties.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/TransProperties.cpp?rev=135065&r1=135064&r2=135065&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/TransProperties.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/TransProperties.cpp Wed Jul 13 14:22:00 2011
@@ -7,11 +7,14 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// changeIvarsOfAssignProperties:
+// rewriteProperties:
 //
-// If a property is synthesized with 'assign' attribute and the user didn't
-// set a lifetime attribute, change the property to 'weak' or add
-// __unsafe_unretained if the ARC runtime is not available.
+// - Adds strong/weak/unsafe_unretained ownership specifier to properties that
+//   are missing one.
+// - Migrates properties from (retain) to (strong) and (assign) to
+//   (unsafe_unretained/weak).
+// - If a property is synthesized, adds the ownership specifier in the ivar
+//   backing the property.
 //
 //  @interface Foo : NSObject {
 //      NSObject *x;
@@ -32,6 +35,7 @@
 #include "clang/Sema/SemaDiagnostic.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Lex/Lexer.h"
+#include <map>
 
 using namespace clang;
 using namespace arcmt;
@@ -40,35 +44,36 @@
 
 namespace {
 
-class AssignPropertiesTrans {
+class PropertiesRewriter {
   MigrationPass &Pass;
+
   struct PropData {
     ObjCPropertyDecl *PropD;
     ObjCIvarDecl *IvarD;
-    bool ShouldChangeToWeak;
-    SourceLocation ArcPropAssignErrorLoc;
+    ObjCPropertyImplDecl *ImplD;
+
+    PropData(ObjCPropertyDecl *propD) : PropD(propD), IvarD(0), ImplD(0) { }
   };
 
-  typedef llvm::SmallVector<PropData, 2> PropsTy; 
-  typedef llvm::DenseMap<unsigned, PropsTy> PropsMapTy;
-  PropsMapTy PropsMap;
+  typedef llvm::SmallVector<PropData, 2> PropsTy;
+  typedef std::map<unsigned, PropsTy> AtPropDeclsTy;
+  AtPropDeclsTy AtProps;
 
 public:
-  AssignPropertiesTrans(MigrationPass &pass) : Pass(pass) { }
+  PropertiesRewriter(MigrationPass &pass) : Pass(pass) { }
 
   void doTransform(ObjCImplementationDecl *D) {
-    SourceManager &SM = Pass.Ctx.getSourceManager();
+    ObjCInterfaceDecl *iface = D->getClassInterface();
+    if (!iface)
+      return;
 
-    ObjCInterfaceDecl *IFace = D->getClassInterface();
     for (ObjCInterfaceDecl::prop_iterator
-           I = IFace->prop_begin(), E = IFace->prop_end(); I != E; ++I) {
-      ObjCPropertyDecl *propD = *I;
-      unsigned loc = SM.getInstantiationLoc(propD->getAtLoc()).getRawEncoding();
-      PropsTy &props = PropsMap[loc];
-      props.push_back(PropData());
-      props.back().PropD = propD;
-      props.back().IvarD = 0;
-      props.back().ShouldChangeToWeak = false;
+           propI = iface->prop_begin(),
+           propE = iface->prop_end(); propI != propE; ++propI) {
+      if (propI->getAtLoc().isInvalid())
+        continue;
+      PropsTy &props = AtProps[propI->getAtLoc().getRawEncoding()];
+      props.push_back(*propI);
     }
 
     typedef DeclContext::specific_decl_iterator<ObjCPropertyImplDecl>
@@ -76,111 +81,172 @@
     for (prop_impl_iterator
            I = prop_impl_iterator(D->decls_begin()),
            E = prop_impl_iterator(D->decls_end()); I != E; ++I) {
-      VisitObjCPropertyImplDecl(*I);
+      ObjCPropertyImplDecl *implD = *I;
+      if (implD->getPropertyImplementation() != ObjCPropertyImplDecl::Synthesize)
+        continue;
+      ObjCPropertyDecl *propD = implD->getPropertyDecl();
+      if (!propD || propD->isInvalidDecl())
+        continue;
+      ObjCIvarDecl *ivarD = implD->getPropertyIvarDecl();
+      if (!ivarD || ivarD->isInvalidDecl())
+        continue;
+      unsigned rawAtLoc = propD->getAtLoc().getRawEncoding();
+      AtPropDeclsTy::iterator findAtLoc = AtProps.find(rawAtLoc);
+      if (findAtLoc == AtProps.end())
+        continue;
+      
+      PropsTy &props = findAtLoc->second;
+      for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I) {
+        if (I->PropD == propD) {
+          I->IvarD = ivarD;
+          I->ImplD = implD;
+          break;
+        }
+      }
     }
 
-    for (PropsMapTy::iterator
-           I = PropsMap.begin(), E = PropsMap.end(); I != E; ++I) {
+    for (AtPropDeclsTy::iterator
+           I = AtProps.begin(), E = AtProps.end(); I != E; ++I) {
       SourceLocation atLoc = SourceLocation::getFromRawEncoding(I->first);
       PropsTy &props = I->second;
-      if (shouldApplyWeakToAllProp(props)) {
-        if (changeAssignToWeak(atLoc)) {
-          // Couldn't add the 'weak' property attribute,
-          // try adding __unsafe_unretained.
-          applyUnsafeUnretained(props);
-        } else {
-          for (PropsTy::iterator
-                 PI = props.begin(), PE = props.end(); PI != PE; ++PI) {
-            applyWeak(*PI);
-          }
-        }
-      } else {
-        // We should not add 'weak' attribute since not all properties need it.
-        // So just add __unsafe_unretained to the ivars.
-        applyUnsafeUnretained(props);
-      }
+      QualType ty = getPropertyType(props);
+      if (!ty->isObjCRetainableType())
+        continue;
+      if (hasIvarWithExplicitOwnership(props))
+        continue;
+      
+      Transaction Trans(Pass.TA);
+      rewriteProperty(props, atLoc);
     }
   }
 
-  bool shouldApplyWeakToAllProp(PropsTy &props) {
-    for (PropsTy::iterator
-           PI = props.begin(), PE = props.end(); PI != PE; ++PI) {
-      if (!PI->ShouldChangeToWeak)
-        return false;
+private:
+  void rewriteProperty(PropsTy &props, SourceLocation atLoc) const {
+    ObjCPropertyDecl::PropertyAttributeKind propAttrs = getPropertyAttrs(props);
+    
+    if (propAttrs & (ObjCPropertyDecl::OBJC_PR_copy |
+                     ObjCPropertyDecl::OBJC_PR_unsafe_unretained |
+                     ObjCPropertyDecl::OBJC_PR_strong |
+                     ObjCPropertyDecl::OBJC_PR_weak))
+      return;
+
+    if (propAttrs & ObjCPropertyDecl::OBJC_PR_retain) {
+      rewriteAttribute("retain", "strong", atLoc);
+      return;
     }
-    return true;
+
+    if (propAttrs & ObjCPropertyDecl::OBJC_PR_assign)
+      return rewriteAssign(props, atLoc);
+
+    return maybeAddWeakOrUnsafeUnretainedAttr(props, atLoc);
   }
 
-  void applyWeak(PropData &prop) {
-    assert(canApplyWeak(Pass.Ctx, prop.IvarD->getType()));
+  void rewriteAssign(PropsTy &props, SourceLocation atLoc) const {
+    bool canUseWeak = canApplyWeak(Pass.Ctx, getPropertyType(props));
 
-    Transaction Trans(Pass.TA);
-    Pass.TA.insert(prop.IvarD->getLocation(), "__weak "); 
-    Pass.TA.clearDiagnostic(diag::err_arc_assign_property_ownership,
-                            prop.ArcPropAssignErrorLoc);
+    bool rewroteAttr = rewriteAttribute("assign",
+                                     canUseWeak ? "weak" : "unsafe_unretained",
+                                         atLoc);
+    if (!rewroteAttr)
+      canUseWeak = false;
+
+    for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I) {
+      if (isUserDeclared(I->IvarD))
+        Pass.TA.insert(I->IvarD->getLocation(),
+                       canUseWeak ? "__weak " : "__unsafe_unretained ");
+      if (I->ImplD)
+        Pass.TA.clearDiagnostic(diag::err_arc_assign_property_ownership,
+                                I->ImplD->getLocation());
+    }
   }
 
-  void applyUnsafeUnretained(PropsTy &props) {
-    for (PropsTy::iterator
-           PI = props.begin(), PE = props.end(); PI != PE; ++PI) {
-      if (PI->ShouldChangeToWeak) {
-        Transaction Trans(Pass.TA);
-        Pass.TA.insert(PI->IvarD->getLocation(), "__unsafe_unretained ");
+  void maybeAddWeakOrUnsafeUnretainedAttr(PropsTy &props,
+                                          SourceLocation atLoc) const {
+    ObjCPropertyDecl::PropertyAttributeKind propAttrs = getPropertyAttrs(props);
+    if ((propAttrs & ObjCPropertyDecl::OBJC_PR_readonly) &&
+        hasNoBackingIvars(props))
+      return;
+
+    bool canUseWeak = canApplyWeak(Pass.Ctx, getPropertyType(props));
+    bool addedAttr = addAttribute(canUseWeak ? "weak" : "unsafe_unretained",
+                                  atLoc);
+    if (!addedAttr)
+      canUseWeak = false;
+
+    for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I) {
+      if (isUserDeclared(I->IvarD))
+        Pass.TA.insert(I->IvarD->getLocation(),
+                       canUseWeak ? "__weak " : "__unsafe_unretained ");
+      if (I->ImplD) {
         Pass.TA.clearDiagnostic(diag::err_arc_assign_property_ownership,
-                                PI->ArcPropAssignErrorLoc);
+                                I->ImplD->getLocation());
+        Pass.TA.clearDiagnostic(
+                           diag::err_arc_objc_property_default_assign_on_object,
+                           I->ImplD->getLocation());
       }
     }
   }
 
-  bool VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D) {
+  bool rewriteAttribute(llvm::StringRef fromAttr, llvm::StringRef toAttr,
+                        SourceLocation atLoc) const {
+    if (atLoc.isMacroID())
+      return false;
+
     SourceManager &SM = Pass.Ctx.getSourceManager();
 
-    if (D->getPropertyImplementation() != ObjCPropertyImplDecl::Synthesize)
-      return true;
-    ObjCPropertyDecl *propD = D->getPropertyDecl();
-    if (!propD || propD->isInvalidDecl())
-      return true;
-    ObjCIvarDecl *ivarD = D->getPropertyIvarDecl();
-    if (!ivarD || ivarD->isInvalidDecl())
-      return true;
-    if (!(propD->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_assign))
-      return true;
-    if (isa<AttributedType>(ivarD->getType().getTypePtr()))
-      return true;
-    if (ivarD->getType().getLocalQualifiers().getObjCLifetime()
-          != Qualifiers::OCL_Strong)
-      return true;
-    if (!Pass.TA.hasDiagnostic(
-                      diag::err_arc_assign_property_ownership, D->getLocation()))
-      return true;
+    // Break down the source location.
+    std::pair<FileID, unsigned> locInfo = SM.getDecomposedLoc(atLoc);
+
+    // Try to load the file buffer.
+    bool invalidTemp = false;
+    llvm::StringRef file = SM.getBufferData(locInfo.first, &invalidTemp);
+    if (invalidTemp)
+      return false;
 
-    // There is a "error: existing ivar for assign property must be
-    // __unsafe_unretained"; fix it.
+    const char *tokenBegin = file.data() + locInfo.second;
 
-    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 ");
-      Pass.TA.clearDiagnostic(
-                      diag::err_arc_assign_property_ownership, D->getLocation());
-    } else {
-      // Mark that we want the ivar to become weak.
-      unsigned loc = SM.getInstantiationLoc(propD->getAtLoc()).getRawEncoding();
-      PropsTy &props = PropsMap[loc];
-      for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I) {
-        if (I->PropD == propD) {
-          I->IvarD = ivarD;
-          I->ShouldChangeToWeak = true;
-          I->ArcPropAssignErrorLoc = D->getLocation();
-        }
+    // Lex from the start of the given location.
+    Lexer lexer(SM.getLocForStartOfFile(locInfo.first),
+                Pass.Ctx.getLangOptions(),
+                file.begin(), tokenBegin, file.end());
+    Token tok;
+    lexer.LexFromRawLexer(tok);
+    if (tok.isNot(tok::at)) return false;
+    lexer.LexFromRawLexer(tok);
+    if (tok.isNot(tok::raw_identifier)) return false;
+    if (llvm::StringRef(tok.getRawIdentifierData(), tok.getLength())
+          != "property")
+      return false;
+    lexer.LexFromRawLexer(tok);
+    if (tok.isNot(tok::l_paren)) return false;
+    
+    lexer.LexFromRawLexer(tok);
+    if (tok.is(tok::r_paren))
+      return false;
+
+    while (1) {
+      if (tok.isNot(tok::raw_identifier)) return false;
+      llvm::StringRef ident(tok.getRawIdentifierData(), tok.getLength());
+      if (ident == fromAttr) {
+        Pass.TA.replaceText(tok.getLocation(), fromAttr, toAttr);
+        return true;
       }
+
+      do {
+        lexer.LexFromRawLexer(tok);
+      } while (tok.isNot(tok::comma) && tok.isNot(tok::r_paren));
+      if (tok.is(tok::r_paren))
+        break;
+      lexer.LexFromRawLexer(tok);
     }
 
-    return true;
+    return false;
   }
 
-private:
-  bool changeAssignToWeak(SourceLocation atLoc) {
+  bool addAttribute(llvm::StringRef attr, SourceLocation atLoc) const {
+    if (atLoc.isMacroID())
+      return false;
+
     SourceManager &SM = Pass.Ctx.getSourceManager();
 
     // Break down the source location.
@@ -190,7 +256,7 @@
     bool invalidTemp = false;
     llvm::StringRef file = SM.getBufferData(locInfo.first, &invalidTemp);
     if (invalidTemp)
-      return true;
+      return false;
 
     const char *tokenBegin = file.data() + locInfo.second;
 
@@ -200,61 +266,99 @@
                 file.begin(), tokenBegin, file.end());
     Token tok;
     lexer.LexFromRawLexer(tok);
-    if (tok.isNot(tok::at)) return true;
+    if (tok.isNot(tok::at)) return false;
     lexer.LexFromRawLexer(tok);
-    if (tok.isNot(tok::raw_identifier)) return true;
+    if (tok.isNot(tok::raw_identifier)) return false;
     if (llvm::StringRef(tok.getRawIdentifierData(), tok.getLength())
           != "property")
-      return true;
+      return false;
     lexer.LexFromRawLexer(tok);
-    if (tok.isNot(tok::l_paren)) return true;
-    
-    SourceLocation LParen = tok.getLocation();
-    SourceLocation assignLoc;
-    bool isEmpty = false;
 
+    if (tok.isNot(tok::l_paren)) {
+      Pass.TA.insert(tok.getLocation(), std::string("(") + attr.str() + ") ");
+      return true;
+    }
+    
     lexer.LexFromRawLexer(tok);
     if (tok.is(tok::r_paren)) {
-      isEmpty = true;
-    } else {
-      while (1) {
-        if (tok.isNot(tok::raw_identifier)) return true;
-        llvm::StringRef ident(tok.getRawIdentifierData(), tok.getLength());
-        if (ident == "assign")
-          assignLoc = tok.getLocation();
-  
-        do {
-          lexer.LexFromRawLexer(tok);
-        } while (tok.isNot(tok::comma) && tok.isNot(tok::r_paren));
-        if (tok.is(tok::r_paren))
-          break;
-        lexer.LexFromRawLexer(tok);
+      Pass.TA.insert(tok.getLocation(), attr);
+      return true;
+    }
+
+    if (tok.isNot(tok::raw_identifier)) return false;
+
+    Pass.TA.insert(tok.getLocation(), std::string(attr) + ", ");
+    return true;
+  }
+
+  bool hasIvarWithExplicitOwnership(PropsTy &props) const {
+    for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I) {
+      if (isUserDeclared(I->IvarD)) {
+        if (isa<AttributedType>(I->IvarD->getType()))
+          return true;
+        if (I->IvarD->getType().getLocalQualifiers().getObjCLifetime()
+              != Qualifiers::OCL_Strong)
+          return true;
       }
     }
 
-    Transaction Trans(Pass.TA);
-    if (assignLoc.isValid())
-      Pass.TA.replaceText(assignLoc, "assign", "weak");
-    else 
-      Pass.TA.insertAfterToken(LParen, isEmpty ? "weak" : "weak, ");
-    return false;
+    return false;    
+  }
+
+  bool hasNoBackingIvars(PropsTy &props) const {
+    for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I)
+      if (isUserDeclared(I->IvarD))
+        return false;
+
+    return true;
+  }
+
+  bool isUserDeclared(ObjCIvarDecl *ivarD) const {
+    return ivarD && !ivarD->getSynthesize();
+  }
+
+  QualType getPropertyType(PropsTy &props) const {
+    assert(!props.empty());
+    QualType ty = props[0].PropD->getType();
+
+#ifndef NDEBUG
+    for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I)
+      assert(ty == I->PropD->getType());
+#endif
+
+    return ty;
+  }
+
+  ObjCPropertyDecl::PropertyAttributeKind
+  getPropertyAttrs(PropsTy &props) const {
+    assert(!props.empty());
+    ObjCPropertyDecl::PropertyAttributeKind
+      attrs = props[0].PropD->getPropertyAttributesAsWritten();
+
+#ifndef NDEBUG
+    for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I)
+      assert(attrs == I->PropD->getPropertyAttributesAsWritten());
+#endif
+
+    return attrs;
   }
 };
 
-class PropertiesChecker : public RecursiveASTVisitor<PropertiesChecker> {
+class ImplementationChecker :
+                             public RecursiveASTVisitor<ImplementationChecker> {
   MigrationPass &Pass;
 
 public:
-  PropertiesChecker(MigrationPass &pass) : Pass(pass) { }
+  ImplementationChecker(MigrationPass &pass) : Pass(pass) { }
 
   bool TraverseObjCImplementationDecl(ObjCImplementationDecl *D) {
-    AssignPropertiesTrans(Pass).doTransform(D);
+    PropertiesRewriter(Pass).doTransform(D);
     return true;
   }
 };
 
 } // anonymous namespace
 
-void trans::changeIvarsOfAssignProperties(MigrationPass &pass) {
-  PropertiesChecker(pass).TraverseDecl(pass.Ctx.getTranslationUnitDecl());
+void trans::rewriteProperties(MigrationPass &pass) {
+  ImplementationChecker(pass).TraverseDecl(pass.Ctx.getTranslationUnitDecl());
 }

Modified: cfe/trunk/lib/ARCMigrate/Transforms.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/Transforms.cpp?rev=135065&r1=135064&r2=135065&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/Transforms.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/Transforms.cpp Wed Jul 13 14:22:00 2011
@@ -265,7 +265,7 @@
 
 static void independentTransforms(MigrationPass &pass) {
   rewriteAutoreleasePool(pass);
-  changeIvarsOfAssignProperties(pass);
+  rewriteProperties(pass);
   removeRetainReleaseDealloc(pass);
   rewriteUnusedInitDelegate(pass);
   removeZeroOutPropsInDealloc(pass);

Modified: cfe/trunk/lib/ARCMigrate/Transforms.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/Transforms.h?rev=135065&r1=135064&r2=135065&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/Transforms.h (original)
+++ cfe/trunk/lib/ARCMigrate/Transforms.h Wed Jul 13 14:22:00 2011
@@ -34,7 +34,7 @@
 void makeAssignARCSafe(MigrationPass &pass);
 void removeRetainReleaseDealloc(MigrationPass &pass);
 void removeZeroOutPropsInDealloc(MigrationPass &pass);
-void changeIvarsOfAssignProperties(MigrationPass &pass);
+void rewriteProperties(MigrationPass &pass);
 void rewriteBlockObjCVariable(MigrationPass &pass);
 void rewriteUnusedInitDelegate(MigrationPass &pass);
 

Modified: cfe/trunk/test/ARCMT/assign-prop-no-arc-runtime.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/assign-prop-no-arc-runtime.m.result?rev=135065&r1=135064&r2=135065&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/assign-prop-no-arc-runtime.m.result (original)
+++ cfe/trunk/test/ARCMT/assign-prop-no-arc-runtime.m.result Wed Jul 13 14:22:00 2011
@@ -7,7 +7,7 @@
 @interface Foo : NSObject {
   NSObject *__unsafe_unretained x;
 }
- at property (readonly,assign) id x;
+ at property (readonly,unsafe_unretained) id x;
 @end
 
 @implementation Foo

Modified: cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m?rev=135065&r1=135064&r2=135065&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m (original)
+++ cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m Wed Jul 13 14:22:00 2011
@@ -15,7 +15,6 @@
 
 @interface Foo : NSObject {
   Foo *x, *w, *q1, *q2;
-  Foo *z1, *__unsafe_unretained z2;
   WeakOptOut *oo;
   BadClassForWeak bcw;
   id not_safe1;
@@ -24,15 +23,17 @@
 }
 @property (readonly,assign) Foo *x;
 @property (assign) Foo *w;
- at property (assign) Foo *q1, *q2;
- at property (assign) Foo *z1, *z2;
+ at property Foo *q1, *q2;
 @property (assign) WeakOptOut *oo;
 @property (assign) BadClassForWeak bcw;
 @property (assign) id not_safe1;
- at property (assign) NSObject *not_safe2;
- at property (assign) Forw *not_safe3;
+ at property () NSObject *not_safe2;
+ at property Forw *not_safe3;
+
+ at property (assign) Foo *no_back_ivar;
 @end
 
 @implementation Foo
- at synthesize x,w,q1,q2,z1,z2,oo,bcw,not_safe1,not_safe2,not_safe3;
+ at synthesize x,w,q1,q2,oo,bcw,not_safe1,not_safe2,not_safe3;
+ at synthesize no_back_ivar;
 @end

Modified: cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m.result?rev=135065&r1=135064&r2=135065&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m.result (original)
+++ cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m.result Wed Jul 13 14:22:00 2011
@@ -15,7 +15,6 @@
 
 @interface Foo : NSObject {
   Foo *__weak x, *__weak w, *__weak q1, *__weak q2;
-  Foo *__unsafe_unretained z1, *__unsafe_unretained z2;
   WeakOptOut *__unsafe_unretained oo;
   BadClassForWeak __unsafe_unretained bcw;
   id __unsafe_unretained not_safe1;
@@ -25,14 +24,16 @@
 @property (readonly,weak) Foo *x;
 @property (weak) Foo *w;
 @property (weak) Foo *q1, *q2;
- at property (assign) Foo *z1, *z2;
- at property (assign) WeakOptOut *oo;
- at property (assign) BadClassForWeak bcw;
- at property (assign) id not_safe1;
- at property (assign) NSObject *not_safe2;
- at property (assign) Forw *not_safe3;
+ at property (unsafe_unretained) WeakOptOut *oo;
+ at property (unsafe_unretained) BadClassForWeak bcw;
+ at property (unsafe_unretained) id not_safe1;
+ at property (unsafe_unretained) NSObject *not_safe2;
+ at property (unsafe_unretained) Forw *not_safe3;
+
+ at property (weak) Foo *no_back_ivar;
 @end
 
 @implementation Foo
- at synthesize x,w,q1,q2,z1,z2,oo,bcw,not_safe1,not_safe2,not_safe3;
+ at synthesize x,w,q1,q2,oo,bcw,not_safe1,not_safe2,not_safe3;
+ at synthesize no_back_ivar;
 @end

Modified: cfe/trunk/test/ARCMT/releases-driver.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/releases-driver.m.result?rev=135065&r1=135064&r2=135065&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/releases-driver.m.result (original)
+++ cfe/trunk/test/ARCMT/releases-driver.m.result Wed Jul 13 14:22:00 2011
@@ -20,7 +20,7 @@
 @interface Foo : NSObject {
   id bar;
 }
- at property (retain) id bar;
+ at property (strong) id bar;
 -(void)test:(id)obj;
 @end
 

Modified: cfe/trunk/test/ARCMT/releases.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/releases.m.result?rev=135065&r1=135064&r2=135065&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/releases.m.result (original)
+++ cfe/trunk/test/ARCMT/releases.m.result Wed Jul 13 14:22:00 2011
@@ -18,7 +18,7 @@
 @interface Foo : NSObject {
   id bar;
 }
- at property (retain) id bar;
+ at property (strong) id bar;
 -(void)test:(id)obj;
 @end
 

Modified: cfe/trunk/test/ARCMT/remove-dealloc-method.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/remove-dealloc-method.m.result?rev=135065&r1=135064&r2=135065&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/remove-dealloc-method.m.result (original)
+++ cfe/trunk/test/ARCMT/remove-dealloc-method.m.result Wed Jul 13 14:22:00 2011
@@ -5,10 +5,10 @@
 #define nil ((void*) 0)
 
 @interface Foo 
- at property (retain) id x;
- at property (retain) id y;
- at property (retain) id w;
- at property (retain) id z;
+ at property (strong) id x;
+ at property (strong) id y;
+ at property (strong) id w;
+ at property (strong) id z;
 @end
 
 @implementation Foo 

Modified: cfe/trunk/test/ARCMT/remove-dealloc-zerouts.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/remove-dealloc-zerouts.m.result?rev=135065&r1=135064&r2=135065&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/remove-dealloc-zerouts.m.result (original)
+++ cfe/trunk/test/ARCMT/remove-dealloc-zerouts.m.result Wed Jul 13 14:22:00 2011
@@ -3,10 +3,10 @@
 // RUN: diff %t %s.result
 
 @interface Foo 
- at property (retain) id x;
- at property (retain) id y;
- at property (retain) id w;
- at property (retain) id z;
+ at property (strong) id x;
+ at property (strong) id y;
+ at property (strong) id w;
+ at property (strong) id z;
 @property (strong) id q;
 @end
 
@@ -23,7 +23,7 @@
 @end
 
 @interface Bar
- at property (retain) Foo *a;
+ at property (strong) Foo *a;
 - (void) setA:(Foo*) val;
 - (id) a;
 @end

Modified: cfe/trunk/test/ARCMT/retains.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/retains.m.result?rev=135065&r1=135064&r2=135065&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/retains.m.result (original)
+++ cfe/trunk/test/ARCMT/retains.m.result Wed Jul 13 14:22:00 2011
@@ -9,7 +9,7 @@
 @interface Foo : NSObject {
   id bar;
 }
- at property (retain) id bar;
+ at property (strong) id bar;
 -(id)test:(id)obj;
 -(id)something;
 @end





More information about the cfe-commits mailing list