aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Chisnall <csdavec@swan.ac.uk>2012-07-04 10:37:03 +0000
committerDavid Chisnall <csdavec@swan.ac.uk>2012-07-04 10:37:03 +0000
commita422cd0ed4da8cb5a172498f29bb02065707c6ce (patch)
tree2e7a014f0991c691635869f38aa22ec610df9a54 /lib
parentc50a0e3900f1b44503be48457508af372f4dd05a (diff)
A few more cleanups for the GNU family of ObjC runtimes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159708 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Basic/ObjCRuntime.cpp5
-rw-r--r--lib/Driver/Tools.cpp7
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/Basic/ObjCRuntime.cpp b/lib/Basic/ObjCRuntime.cpp
index 0f30bfaa2c..f52677b512 100644
--- a/lib/Basic/ObjCRuntime.cpp
+++ b/lib/Basic/ObjCRuntime.cpp
@@ -54,6 +54,7 @@ bool ObjCRuntime::tryParse(StringRef input) {
// Everything prior to that must be a valid string name.
Kind kind;
StringRef runtimeName = input.substr(0, dash);
+ Version = VersionTuple(0);
if (runtimeName == "macosx") {
kind = ObjCRuntime::MacOSX;
} else if (runtimeName == "macosx-fragile") {
@@ -61,6 +62,9 @@ bool ObjCRuntime::tryParse(StringRef input) {
} else if (runtimeName == "ios") {
kind = ObjCRuntime::iOS;
} else if (runtimeName == "gnustep") {
+ // If no version is specified then default to the most recent one that we
+ // know about.
+ Version = VersionTuple(1, 6);
kind = ObjCRuntime::GNUstep;
} else if (runtimeName == "gcc") {
kind = ObjCRuntime::GCC;
@@ -69,7 +73,6 @@ bool ObjCRuntime::tryParse(StringRef input) {
}
TheKind = kind;
- Version = VersionTuple(0);
if (dash != StringRef::npos) {
StringRef verString = input.substr(dash + 1);
if (Version.tryParse(verString))
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index a558c1ff96..3b15d123cc 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -2934,7 +2934,12 @@ ObjCRuntime Clang::AddObjCRuntimeArgs(const ArgList &args,
// -fgnu-runtime
} else {
assert(runtimeArg->getOption().matches(options::OPT_fgnu_runtime));
- runtime = ObjCRuntime(ObjCRuntime::GCC, VersionTuple());
+ // Legacy behaviour is to target the gnustep runtime if we are i
+ // non-fragile mode or the GCC runtime in fragile mode.
+ if (isNonFragile)
+ runtime = ObjCRuntime(ObjCRuntime::GNUstep, VersionTuple());
+ else
+ runtime = ObjCRuntime(ObjCRuntime::GCC, VersionTuple());
}
cmdArgs.push_back(args.MakeArgString(