summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Targets.cpp
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2014-01-16 08:48:16 +0000
committerTim Northover <tnorthover@apple.com>2014-01-16 08:48:16 +0000
commit157d911b42788d402b04a9cd7cbf45b0fd4541fb (patch)
tree8802de96f362b14c72bdedc4f9f7da9de6f8db3a /clang/lib/Basic/Targets.cpp
parentd1487261a0250aa2bca61d1eeb24ec00f801e659 (diff)
downloadbcm5719-llvm-157d911b42788d402b04a9cd7cbf45b0fd4541fb.tar.gz
bcm5719-llvm-157d911b42788d402b04a9cd7cbf45b0fd4541fb.zip
MachO: use *-*-*-macho for MachO embedded targets.
Previously we had bodged together some hacks mapping MachO embedded targets (i.e. mainly ARM v6M and v7M) to the "*-*-darwin-eabi" triple. This is incorrect in both details (they don't run Darwin and they're not EABI in any real sense). This commit appropriates the existing "MachO" environment for the purpose instead. llvm-svn: 199367
Diffstat (limited to 'clang/lib/Basic/Targets.cpp')
-rw-r--r--clang/lib/Basic/Targets.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index bb844f13ef5..629b540a14e 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -90,7 +90,6 @@ static void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts,
VersionTuple &PlatformMinVersion) {
Builder.defineMacro("__APPLE_CC__", "6000");
Builder.defineMacro("__APPLE__");
- Builder.defineMacro("__MACH__");
Builder.defineMacro("OBJC_NEW_PROPERTIES");
// AddressSanitizer doesn't play well with source fortification, which is on
// by default on Darwin.
@@ -154,7 +153,7 @@ static void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts,
Str[5] = '\0';
Builder.defineMacro("__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__",
Str);
- } else {
+ } else if (Triple.isMacOSX()) {
// Note that the Driver allows versions which aren't representable in the
// define (because we only get a single digit for the minor and micro
// revision numbers). So, we limit them to the maximum representable
@@ -171,6 +170,10 @@ static void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts,
}
}
+ // Tell users about the kernel if there is one.
+ if (Triple.isOSDarwin())
+ Builder.defineMacro("__MACH__");
+
PlatformMinVersion = VersionTuple(Maj, Min, Rev);
}
@@ -5535,7 +5538,7 @@ static TargetInfo *AllocateTarget(const llvm::Triple &Triple) {
case llvm::Triple::arm:
case llvm::Triple::thumb:
- if (Triple.isOSDarwin())
+ if (Triple.isOSBinFormatMachO())
return new DarwinARMTargetInfo(Triple);
switch (os) {
OpenPOWER on IntegriCloud