[cfe-commits] r152503 - /cfe/trunk/lib/CodeGen/CGObjC.cpp
Benjamin Kramer
benny.kra at googlemail.com
Sat Mar 10 12:38:57 PST 2012
Author: d0k
Date: Sat Mar 10 14:38:56 2012
New Revision: 152503
URL: http://llvm.org/viewvc/llvm-project?rev=152503&view=rev
Log:
Simplify code. No functionality change.
Modified:
cfe/trunk/lib/CodeGen/CGObjC.cpp
Modified: cfe/trunk/lib/CodeGen/CGObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjC.cpp?rev=152503&r1=152502&r2=152503&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjC.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjC.cpp Sat Mar 10 14:38:56 2012
@@ -1020,24 +1020,15 @@
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
More information about the cfe-commits
mailing list