aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Driver/ToolChains.cpp4
-rw-r--r--lib/Driver/ToolChains.h2
-rw-r--r--lib/Driver/Tools.cpp3
3 files changed, 9 insertions, 0 deletions
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index 14c87d8216..e125ab78f4 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -1019,6 +1019,10 @@ bool Darwin::SupportsObjCGC() const {
return !isTargetIPhoneOS();
}
+bool Darwin::SupportsObjCARC() const {
+ return isTargetIPhoneOS() || !isMacosxVersionLT(10, 6);
+}
+
std::string
Darwin_Generic_GCC::ComputeEffectiveClangTriple(const ArgList &Args,
types::ID InputType) const {
diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h
index 0fb213828f..0d591107de 100644
--- a/lib/Driver/ToolChains.h
+++ b/lib/Driver/ToolChains.h
@@ -379,6 +379,8 @@ public:
virtual bool SupportsObjCGC() const;
+ virtual bool SupportsObjCARC() const;
+
virtual bool UseDwarfDebugFlags() const;
virtual bool UseSjLjExceptions() const;
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 14fb9cb718..c5caaf024f 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -2225,6 +2225,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
// NOTE: This logic is duplicated in ToolChains.cpp.
bool ARC = isObjCAutoRefCount(Args);
if (ARC) {
+ if (!getToolChain().SupportsObjCARC())
+ D.Diag(diag::err_arc_unsupported);
+
CmdArgs.push_back("-fobjc-arc");
// FIXME: It seems like this entire block, and several around it should be