aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGObjC.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2012-10-15 20:37:01 +0000
committerNico Weber <nicolasweber@gmx.de>2012-10-15 20:37:01 +0000
commitdc0d4e251b4c41b75c5d93f1866a8a0952b1c6ae (patch)
treee90e74437a1f58bbe7be67ba561c011f4429d074 /lib/CodeGen/CGObjC.cpp
parent0d5833921cc728bc1d2e45fbaf7b3e11cddbf99d (diff)
Revert r164907 and r164902 (+ follow-ups). They broke building on 10.6.
See PR14013. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165962 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjC.cpp')
-rw-r--r--lib/CodeGen/CGObjC.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp
index cea9731788..cd1ed8913d 100644
--- a/lib/CodeGen/CGObjC.cpp
+++ b/lib/CodeGen/CGObjC.cpp
@@ -1041,7 +1041,12 @@ static bool hasTrivialSetExpr(const ObjCPropertyImplDecl *PID) {
static bool UseOptimizedSetter(CodeGenModule &CGM) {
if (CGM.getLangOpts().getGC() != LangOptions::NonGC)
return false;
- return CGM.getLangOpts().ObjCRuntime.hasOptimizedSetter();
+ const TargetInfo &Target = CGM.getContext().getTargetInfo();
+
+ if (Target.getPlatformName() != "macosx")
+ return false;
+
+ return Target.getPlatformMinVersion() >= VersionTuple(10, 8);
}
void
@@ -1101,7 +1106,7 @@ CodeGenFunction::generateObjCSetterBody(const ObjCImplementationDecl *classImpl,
llvm::Value *setOptimizedPropertyFn = 0;
llvm::Value *setPropertyFn = 0;
if (UseOptimizedSetter(CGM)) {
- // 10.8 and iOS 6.0 code and GC is off
+ // 10.8 code and GC is off
setOptimizedPropertyFn =
CGM.getObjCRuntime()
.GetOptimizedPropertySetFunction(strategy.isAtomic(),