Driver/Darwin: Switch to using new style triples.

llvm-svn: 129824
This commit is contained in:
Daniel Dunbar 2011-04-19 21:45:47 +00:00
parent 14ad22f09d
commit 5c56828d91
2 changed files with 6 additions and 18 deletions

View File

@ -148,23 +148,11 @@ std::string Darwin::ComputeEffectiveClangTriple(const ArgList &Args) const {
unsigned Version[3]; unsigned Version[3];
getTargetVersion(Version); 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::SmallString<16> Str;
llvm::raw_svector_ostream(Str) << "darwin" << Version[0] llvm::raw_svector_ostream(Str)
<< "." << Version[1] << "." << Version[2]; << (isTargetIPhoneOS() ? "ios" : "osx")
<< Version[0] << "." << Version[1] << "." << Version[2];
Triple.setOSName(Str.str()); Triple.setOSName(Str.str());
return Triple.getTriple(); return Triple.getTriple();

View File

@ -4,8 +4,8 @@
// RUN: -c %s 2> %t // RUN: -c %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-COMPILE < %t %s // RUN: FileCheck --check-prefix=CHECK-COMPILE < %t %s
// //
// CHECK-COMPILE: clang{{.*}}" "-cc1" "-triple" "i386-apple-darwin8.0.0" // CHECK-COMPILE: clang{{.*}}" "-cc1" "-triple" "i386-apple-osx10.4.0"
// CHECK-COMPILE: clang{{.*}}" "-cc1" "-triple" "x86_64-apple-darwin9.0.0" // CHECK-COMPILE: clang{{.*}}" "-cc1" "-triple" "x86_64-apple-osx10.5.0"
// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### \ // RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### \
// RUN: -arch i386 -Xarch_i386 -Wl,-some-linker-arg -filelist X 2> %t // RUN: -arch i386 -Xarch_i386 -Wl,-some-linker-arg -filelist X 2> %t