aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2008-12-08 23:56:17 +0000
committerFariborz Jahanian <fjahanian@apple.com>2008-12-08 23:56:17 +0000
commit447d7aeb9499d7ade42be7d63fa03b37b1d2fc09 (patch)
treed86333468197cabffdf082b89e02ff68442ba557 /lib/CodeGen/CGObjC.cpp
parentefd5994d6a35b6b16b29cc59a0d9ef8a14d9c6f8 (diff)
Change condition under which 'retain'/'copy' are directly evaluated.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60729 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjC.cpp')
-rw-r--r--lib/CodeGen/CGObjC.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp
index e95d8e1e56..845d5ff00c 100644
--- a/lib/CodeGen/CGObjC.cpp
+++ b/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();