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

llvm-svn: 161444
This commit is contained in:
Bob Wilson 2012-08-07 19:58:00 +00:00
parent 7c88d2ae0f
commit 29536fcbd5
2 changed files with 7 additions and 1 deletions

View File

@ -174,8 +174,10 @@ static bool isObjCAutoRefCount(const ArgList &Args) {
/// \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);
}

View File

@ -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'