[cfe-commits] r129824 - in /cfe/trunk: lib/Driver/ToolChains.cpp test/Driver/darwin-xarch.c
Daniel Dunbar
daniel at zuster.org
Tue Apr 19 14:45:47 PDT 2011
Author: ddunbar
Date: Tue Apr 19 16:45:47 2011
New Revision: 129824
URL: http://llvm.org/viewvc/llvm-project?rev=129824&view=rev
Log:
Driver/Darwin: Switch to using new style triples.
Modified:
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/test/Driver/darwin-xarch.c
Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=129824&r1=129823&r2=129824&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Tue Apr 19 16:45:47 2011
@@ -148,23 +148,11 @@
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();
Modified: cfe/trunk/test/Driver/darwin-xarch.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/darwin-xarch.c?rev=129824&r1=129823&r2=129824&view=diff
==============================================================================
--- cfe/trunk/test/Driver/darwin-xarch.c (original)
+++ cfe/trunk/test/Driver/darwin-xarch.c Tue Apr 19 16:45:47 2011
@@ -4,8 +4,8 @@
// RUN: -c %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-COMPILE < %t %s
//
-// CHECK-COMPILE: clang{{.*}}" "-cc1" "-triple" "i386-apple-darwin8.0.0"
-// CHECK-COMPILE: clang{{.*}}" "-cc1" "-triple" "x86_64-apple-darwin9.0.0"
+// CHECK-COMPILE: clang{{.*}}" "-cc1" "-triple" "i386-apple-osx10.4.0"
+// CHECK-COMPILE: clang{{.*}}" "-cc1" "-triple" "x86_64-apple-osx10.5.0"
// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### \
// RUN: -arch i386 -Xarch_i386 -Wl,-some-linker-arg -filelist X 2> %t
More information about the cfe-commits
mailing list