diff options
Diffstat (limited to 'lib/CodeGen/CGObjC.cpp')
-rw-r--r-- | lib/CodeGen/CGObjC.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp index 0592601446..ffb1266b97 100644 --- a/lib/CodeGen/CGObjC.cpp +++ b/lib/CodeGen/CGObjC.cpp @@ -1020,24 +1020,15 @@ static bool hasTrivialSetExpr(const ObjCPropertyImplDecl *PID) { return false; } -bool UseOptimizedSetter(CodeGenModule &CGM) { +static bool UseOptimizedSetter(CodeGenModule &CGM) { if (CGM.getLangOptions().getGC() != LangOptions::NonGC) return false; const TargetInfo &Target = CGM.getContext().getTargetInfo(); - StringRef TargetPlatform = Target.getPlatformName(); - if (TargetPlatform.empty()) - return false; - VersionTuple TargetMinVersion = Target.getPlatformMinVersion(); - - if (TargetPlatform.compare("macosx") || - TargetMinVersion.getMajor() <= 9) + + if (Target.getPlatformName() != "macosx") return false; - - unsigned minor = 0; - if (llvm::Optional<unsigned> Minor = TargetMinVersion.getMinor()) - minor = *Minor; - - return (minor >= 8); + + return Target.getPlatformMinVersion() >= VersionTuple(10, 8); } void |