[cfe-commits] r159708 - in /cfe/trunk: include/clang/Basic/ObjCRuntime.h lib/Basic/ObjCRuntime.cpp lib/Driver/Tools.cpp
David Chisnall
csdavec at swan.ac.uk
Wed Jul 4 03:37:03 PDT 2012
Author: theraven
Date: Wed Jul 4 05:37:03 2012
New Revision: 159708
URL: http://llvm.org/viewvc/llvm-project?rev=159708&view=rev
Log:
A few more cleanups for the GNU family of ObjC runtimes.
Modified:
cfe/trunk/include/clang/Basic/ObjCRuntime.h
cfe/trunk/lib/Basic/ObjCRuntime.cpp
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/include/clang/Basic/ObjCRuntime.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/ObjCRuntime.h?rev=159708&r1=159707&r2=159708&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/ObjCRuntime.h (original)
+++ cfe/trunk/include/clang/Basic/ObjCRuntime.h Wed Jul 4 05:37:03 2012
@@ -116,11 +116,8 @@
case MacOSX: return getVersion() >= VersionTuple(10, 7);
case iOS: return getVersion() >= VersionTuple(5);
- // This is really a lie, because some implementations and versions
- // of the runtime do not support ARC. Probably -fgnu-runtime
- // should imply a "maximal" runtime or something?
- case GCC: return true;
- case GNUstep: return true;
+ case GCC: return false;
+ case GNUstep: return getVersion() >= VersionTuple(1, 6);
}
llvm_unreachable("bad kind");
}
Modified: cfe/trunk/lib/Basic/ObjCRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/ObjCRuntime.cpp?rev=159708&r1=159707&r2=159708&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/ObjCRuntime.cpp (original)
+++ cfe/trunk/lib/Basic/ObjCRuntime.cpp Wed Jul 4 05:37:03 2012
@@ -54,6 +54,7 @@
// 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 @@
} 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 @@
}
TheKind = kind;
- Version = VersionTuple(0);
if (dash != StringRef::npos) {
StringRef verString = input.substr(dash + 1);
if (Version.tryParse(verString))
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=159708&r1=159707&r2=159708&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Jul 4 05:37:03 2012
@@ -2934,7 +2934,12 @@
// -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(
More information about the cfe-commits
mailing list