aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/ToolChains.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2011-04-19 21:45:47 +0000
committerDaniel Dunbar <daniel@zuster.org>2011-04-19 21:45:47 +0000
commit729f38ebc6b5a747fe7565a5238e70c84ccfee84 (patch)
tree8af6d641b063521bc90047aae011bfd1e00d4f66 /lib/Driver/ToolChains.cpp
parentdb57a4cdb0a6abf3239f3a794a900ce312c5887b (diff)
Driver/Darwin: Switch to using new style triples.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129824 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChains.cpp')
-rw-r--r--lib/Driver/ToolChains.cpp20
1 files changed, 4 insertions, 16 deletions
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index 28b2f2e9d4..d7959bde97 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -148,23 +148,11 @@ std::string Darwin::ComputeEffectiveClangTriple(const ArgList &Args) const {
unsigned Version[3];
getTargetVersion(Version);
-
- // Mangle the target version into the OS triple component. For historical
- // reasons that make little sense, the version passed here is the "darwin"
- // version, which drops the 10 and offsets by 4. See inverse code when
- // setting the OS version preprocessor define.
- if (!isTargetIPhoneOS()) {
- Version[0] = Version[1] + 4;
- Version[1] = Version[2];
- Version[2] = 0;
- } else {
- // Use the environment to communicate that we are targeting iPhoneOS.
- Triple.setEnvironmentName("iphoneos");
- }
-
+
llvm::SmallString<16> Str;
- llvm::raw_svector_ostream(Str) << "darwin" << Version[0]
- << "." << Version[1] << "." << Version[2];
+ llvm::raw_svector_ostream(Str)
+ << (isTargetIPhoneOS() ? "ios" : "osx")
+ << Version[0] << "." << Version[1] << "." << Version[2];
Triple.setOSName(Str.str());
return Triple.getTriple();