aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/ToolChains.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-07-06 01:22:26 +0000
committerJohn McCall <rjmccall@apple.com>2011-07-06 01:22:26 +0000
commit256a76e0b0e0c9e65a3122917d553ef10bc84d29 (patch)
treeeed80264ac453d3e22cd9e9d1b364c41e1a12c5a /lib/Driver/ToolChains.cpp
parentc06e0743431b28c96e0bbe27cc07851d2e0d2681 (diff)
Call objc_terminate() instead of abort() when a cleanup throws an
exception in Objective-C; in Objective-C++ we still use std::terminate(). This is only available in very recent runtimes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134456 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChains.cpp')
-rw-r--r--lib/Driver/ToolChains.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index 68ebc1b6b3..1619ef8f84 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -99,6 +99,13 @@ void Darwin::configureObjCRuntime(ObjCRuntime &runtime) const {
return ToolChain::configureObjCRuntime(runtime);
runtime.HasARC = runtime.HasWeak = hasARCRuntime();
+
+ // So far, objc_terminate is only available in iOS 5.
+ // FIXME: do the simulator logic properly.
+ if (!ARCRuntimeForSimulator && isTargetIPhoneOS())
+ runtime.HasTerminate = !isIPhoneOSVersionLT(5);
+ else
+ runtime.HasTerminate = false;
}
// FIXME: Can we tablegen this?