summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChain.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-07-06 00:26:06 +0000
committerJohn McCall <rjmccall@apple.com>2011-07-06 00:26:06 +0000
commit24fc0decfe337258a3dacc7936a9da84e2406cdc (patch)
treee91ae1686c100a1cadcdc577c82e30c052f93ee6 /clang/lib/Driver/ToolChain.cpp
parentaf51b1f7096578431578d6a1430366f7ad365430 (diff)
downloadbcm5719-llvm-24fc0decfe337258a3dacc7936a9da84e2406cdc.tar.gz
bcm5719-llvm-24fc0decfe337258a3dacc7936a9da84e2406cdc.zip
Change the driver's logic about Objective-C runtimes: abstract out a
structure to hold inferred information, then propagate each invididual bit down to -cc1. Separate the bits of "supports weak" and "has a native ARC runtime"; make the latter a CodeGenOption. The tool chain is still driving this decision, because it's the place that has the required deployment target information on Darwin, but at least it's better-factored now. llvm-svn: 134453
Diffstat (limited to 'clang/lib/Driver/ToolChain.cpp')
-rw-r--r--clang/lib/Driver/ToolChain.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp
index cbbbc5c4de2..0cce5175492 100644
--- a/clang/lib/Driver/ToolChain.cpp
+++ b/clang/lib/Driver/ToolChain.cpp
@@ -15,7 +15,9 @@
#include "clang/Driver/Driver.h"
#include "clang/Driver/DriverDiagnostic.h"
#include "clang/Driver/HostInfo.h"
+#include "clang/Driver/ObjCRuntime.h"
#include "clang/Driver/Options.h"
+#include "llvm/Support/ErrorHandling.h"
using namespace clang::driver;
@@ -47,6 +49,23 @@ bool ToolChain::HasNativeLLVMSupport() const {
return false;
}
+void ToolChain::configureObjCRuntime(ObjCRuntime &runtime) const {
+ switch (runtime.getKind()) {
+ case ObjCRuntime::NeXT:
+ // Assume a minimal NeXT runtime.
+ runtime.HasARC = false;
+ runtime.HasWeak = false;
+ return;
+
+ case ObjCRuntime::GNU:
+ // Assume a maximal GNU runtime.
+ runtime.HasARC = true;
+ runtime.HasWeak = true;
+ return;
+ }
+ llvm_unreachable("invalid runtime kind!");
+}
+
/// getARMTargetCPU - Get the (LLVM) name of the ARM cpu we are targeting.
//
// FIXME: tblgen this.
OpenPOWER on IntegriCloud