diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-03-10 20:38:56 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-03-10 20:38:56 +0000 |
commit | 4e494cf56325f26a6c3eb5a065c35e54835f14e6 (patch) | |
tree | 5217078caa6703ad271ce26ee0693ddd67d2f782 /lib/CodeGen/CGObjC.cpp | |
parent | ce0d89744bdad195c991362bd6fc7b334e5c2d52 (diff) |
Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152503 91177308-0d34-0410-b5e6-96231b3b80d8
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 |