Fix r195149. Triple should correctly reflect that target. If it contains ios,

e.g. thumbv7m-apple-ios3.0.0-eabi, then it should mean it's an iOS target. For
embedded targets, the OS should be unknown, e.g. thumbv7m-apple-unknown-macho.
Since Tim has recently fixed the triple, r195149 is no longer needed.
rdar://15911035

llvm-svn: 200164
This commit is contained in:
Evan Cheng 2014-01-26 23:12:43 +00:00
parent f9352a3880
commit 31dd9a6cc1
2 changed files with 26 additions and 32 deletions

View File

@ -137,10 +137,6 @@ static void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts,
return; return;
} }
// If there's an environment specified in the triple, that means we're dealing
// with an embedded variant of some sort and don't want the platform
// version-min defines, so only add them if there's not one.
if (Triple.getEnvironmentName().empty()) {
// Set the appropriate OS version define. // Set the appropriate OS version define.
if (Triple.isiOS()) { if (Triple.isiOS()) {
assert(Maj < 10 && Min < 100 && Rev < 100 && "Invalid version!"); assert(Maj < 10 && Min < 100 && Rev < 100 && "Invalid version!");
@ -158,7 +154,6 @@ static void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts,
// define (because we only get a single digit for the minor and micro // define (because we only get a single digit for the minor and micro
// revision numbers). So, we limit them to the maximum representable // revision numbers). So, we limit them to the maximum representable
// version. // version.
assert(Triple.getEnvironmentName().empty() && "Invalid environment!");
assert(Maj < 100 && Min < 100 && Rev < 100 && "Invalid version!"); assert(Maj < 100 && Min < 100 && Rev < 100 && "Invalid version!");
char Str[5]; char Str[5];
Str[0] = '0' + (Maj / 10); Str[0] = '0' + (Maj / 10);
@ -168,7 +163,6 @@ static void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts,
Str[4] = '\0'; Str[4] = '\0';
Builder.defineMacro("__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__", Str); Builder.defineMacro("__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__", Str);
} }
}
// Tell users about the kernel if there is one. // Tell users about the kernel if there is one.
if (Triple.isOSDarwin()) if (Triple.isOSDarwin())

View File

@ -1,7 +1,7 @@
// RUN: %clang -arch armv6m -dM -E %s | FileCheck %s // RUN: %clang -arch armv6m -dM -E %s | FileCheck %s
// RUN: %clang -arch armv7m -dM -E %s | FileCheck %s // RUN: %clang -arch armv7m -dM -E %s | FileCheck %s
// RUN: %clang -arch armv7em -dM -E %s | FileCheck %s // RUN: %clang -arch armv7em -dM -E %s | FileCheck %s
// RUN: %clang -arch armv7 -target thumbv7-apple-darwin-eabi -dM -E %s | FileCheck %s // RUN: %clang_cc1 -triple thumbv7m-apple-unknown-macho -dM -E %s | FileCheck %s
// CHECK-NOT: __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ // CHECK-NOT: __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
// CHECK-NOT: __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ // CHECK-NOT: __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__