[cfe-commits] r60729 - /cfe/trunk/lib/CodeGen/CGObjC.cpp

Fariborz Jahanian fjahanian at apple.com
Mon Dec 8 15:56:18 PST 2008


Author: fjahanian
Date: Mon Dec  8 17:56:17 2008
New Revision: 60729

URL: http://llvm.org/viewvc/llvm-project?rev=60729&view=rev
Log:
Change condition under which 'retain'/'copy' are directly evaluated.

Modified:
    cfe/trunk/lib/CodeGen/CGObjC.cpp

Modified: cfe/trunk/lib/CodeGen/CGObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjC.cpp?rev=60729&r1=60728&r2=60729&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjC.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjC.cpp Mon Dec  8 17:56:17 2008
@@ -148,11 +148,13 @@
   StartObjCMethod(OMD);
 
   // Determine if we should use an objc_getProperty call for
-  // this. Non-atomic and properties with assign semantics are
-  // directly evaluated, and in gc-only mode we don't need it at all.
+  // this. Non-atomic properties are directly evaluated.
+  // atomic 'copy' and 'retain' properties are also directly
+  // evaluated in gc-only mode.
   if (CGM.getLangOptions().getGCMode() != LangOptions::GCOnly &&
-      PD->getSetterKind() != ObjCPropertyDecl::Assign &&
-      !(PD->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_nonatomic)) {
+      !(PD->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_nonatomic) &&
+      (PD->getSetterKind() == ObjCPropertyDecl::Copy ||
+       PD->getSetterKind() == ObjCPropertyDecl::Retain)) {
     llvm::Value *GetPropertyFn = 
       CGM.getObjCRuntime().GetPropertyGetFunction();
     





More information about the cfe-commits mailing list