diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2008-12-08 23:56:17 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2008-12-08 23:56:17 +0000 |
commit | 8e0079c7876a23fb54032da3ee3cf3b57fa196a7 (patch) | |
tree | 6230dec7a4fa14fcd5be45bd5b12b36646458f80 /clang/lib | |
parent | bc55c2a18f2a7ee6d643c4b645078c97cb22952e (diff) | |
download | bcm5719-llvm-8e0079c7876a23fb54032da3ee3cf3b57fa196a7.tar.gz bcm5719-llvm-8e0079c7876a23fb54032da3ee3cf3b57fa196a7.zip |
Change condition under which 'retain'/'copy' are directly evaluated.
llvm-svn: 60729
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/CodeGen/CGObjC.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp index e95d8e1e566..845d5ff00cc 100644 --- a/clang/lib/CodeGen/CGObjC.cpp +++ b/clang/lib/CodeGen/CGObjC.cpp @@ -148,11 +148,13 @@ void CodeGenFunction::GenerateObjCGetter(const ObjCPropertyImplDecl *PID) { 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(); |