aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/ToolChains.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-01-27 00:57:03 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-01-27 00:57:03 +0000
commitce3fdf233353b10f20d74dceda3d77a82285de17 (patch)
tree2a49f0ca771e7b59fa27fd4d4da6ec9f8a3f497e /lib/Driver/ToolChains.h
parentcacb0f007001f7463d44ebd5dde7bfaecf876a71 (diff)
Driver/Darwin: Simplify target version checks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94641 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChains.h')
-rw-r--r--lib/Driver/ToolChains.h24
1 files changed, 7 insertions, 17 deletions
diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h
index 71de8b7109..e17546c982 100644
--- a/lib/Driver/ToolChains.h
+++ b/lib/Driver/ToolChains.h
@@ -112,22 +112,12 @@ public:
Res[2] = DarwinVersion[2];
}
- void getMacosxVersion(unsigned (&Res)[3]) const {
- Res[0] = 10;
- Res[1] = DarwinVersion[0] - 4;
- Res[2] = DarwinVersion[1];
- }
-
/// getDarwinArchName - Get the "Darwin" arch name for a particular compiler
/// invocation. For example, Darwin treats different ARM variations as
/// distinct architectures.
llvm::StringRef getDarwinArchName(const ArgList &Args) const;
- /// getMacosxVersionMin - Get the effective -mmacosx-version-min, which is
- /// either the -mmacosx-version-min, or the current version if unspecified.
- void getMacosxVersionMin(const ArgList &Args, unsigned (&Res)[3]) const;
-
- static bool isMacosxVersionLT(unsigned (&A)[3], unsigned (&B)[3]) {
+ static bool isVersionLT(unsigned (&A)[3], unsigned (&B)[3]) {
for (unsigned i=0; i < 3; ++i) {
if (A[i] > B[i]) return false;
if (A[i] < B[i]) return true;
@@ -135,16 +125,16 @@ public:
return false;
}
- static bool isMacosxVersionLT(unsigned (&A)[3],
- unsigned V0, unsigned V1=0, unsigned V2=0) {
+ bool isIPhoneOSVersionLT(unsigned V0, unsigned V1=0, unsigned V2=0) const {
+ assert(isTargetIPhoneOS() && "Unexpected call for OS X target!");
unsigned B[3] = { V0, V1, V2 };
- return isMacosxVersionLT(A, B);
+ return isVersionLT(TargetVersion, B);
}
- bool isIPhoneOSVersionLT(unsigned V0, unsigned V1=0, unsigned V2=0) const {
- assert(isTargetIPhoneOS() && "Unexpected call for OS X target!");
+ bool isMacosxVersionLT(unsigned V0, unsigned V1=0, unsigned V2=0) const {
+ assert(!isTargetIPhoneOS() && "Unexpected call for iPhoneOS target!");
unsigned B[3] = { V0, V1, V2 };
- return isMacosxVersionLT(TargetVersion, B);
+ return isVersionLT(TargetVersion, B);
}
/// AddLinkSearchPathArgs - Add the linker search paths to \arg CmdArgs.