From: Benjamin Kramer Date: Sat, 10 Mar 2012 20:38:56 +0000 (+0000) Subject: Simplify code. No functionality change. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4e494cf56325f26a6c3eb5a065c35e54835f14e6;p=clang Simplify code. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152503 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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 Minor = TargetMinVersion.getMinor()) - minor = *Minor; - - return (minor >= 8); + + return Target.getPlatformMinVersion() >= VersionTuple(10, 8); } void