[cfe-commits] r161444 - in /cfe/trunk: lib/Driver/Tools.cpp test/Driver/arclite-link.c
Bob Wilson
bob.wilson at apple.com
Tue Aug 7 12:58:01 PDT 2012
Author: bwilson
Date: Tue Aug 7 14:58:00 2012
New Revision: 161444
URL: http://llvm.org/viewvc/llvm-project?rev=161444&view=rev
Log:
Don't complain about -fobjc-link-runtime being unused with -fobjc-arc.
If you build with -fobjc-arc, then -fobjc-link-runtime is implied but we
don't need to warn about it being unused in that case. rdar://12039965
Modified:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/arclite-link.c
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=161444&r1=161443&r2=161444&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Tue Aug 7 14:58:00 2012
@@ -174,8 +174,10 @@
/// \brief Determine whether we are linking the ObjC runtime.
static bool isObjCRuntimeLinked(const ArgList &Args) {
- if (isObjCAutoRefCount(Args))
+ if (isObjCAutoRefCount(Args)) {
+ Args.ClaimAllArgs(options::OPT_fobjc_link_runtime);
return true;
+ }
return Args.hasArg(options::OPT_fobjc_link_runtime);
}
Modified: cfe/trunk/test/Driver/arclite-link.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/arclite-link.c?rev=161444&r1=161443&r2=161444&view=diff
==============================================================================
--- cfe/trunk/test/Driver/arclite-link.c (original)
+++ cfe/trunk/test/Driver/arclite-link.c Tue Aug 7 14:58:00 2012
@@ -11,3 +11,7 @@
// CHECK-ARCLITE-OSX: -lobjc
// CHECK-NOARCLITE-NOT: libarclite
// CHECK-NOSTDLIB-NOT: -lobjc
+
+// RUN: %clang -### -target x86_64-apple-darwin10 -fobjc-link-runtime -fobjc-arc -mmacosx-version-min=10.7 %s 2>&1 | FileCheck -check-prefix=CHECK-UNUSED %s
+
+// CHECK-UNUSED-NOT: warning: argument unused during compilation: '-fobjc-link-runtime'
More information about the cfe-commits
mailing list