зеркало из https://github.com/microsoft/clang-1.git
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
This commit is contained in:
Родитель
efd5994d6a
Коммит
447d7aeb94
|
@ -148,11 +148,13 @@ void CodeGenFunction::GenerateObjCGetter(const ObjCPropertyImplDecl *PID) {
|
||||||
StartObjCMethod(OMD);
|
StartObjCMethod(OMD);
|
||||||
|
|
||||||
// Determine if we should use an objc_getProperty call for
|
// Determine if we should use an objc_getProperty call for
|
||||||
// this. Non-atomic and properties with assign semantics are
|
// this. Non-atomic properties are directly evaluated.
|
||||||
// directly evaluated, and in gc-only mode we don't need it at all.
|
// atomic 'copy' and 'retain' properties are also directly
|
||||||
|
// evaluated in gc-only mode.
|
||||||
if (CGM.getLangOptions().getGCMode() != LangOptions::GCOnly &&
|
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 =
|
llvm::Value *GetPropertyFn =
|
||||||
CGM.getObjCRuntime().GetPropertyGetFunction();
|
CGM.getObjCRuntime().GetPropertyGetFunction();
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче