Navigation Menu

Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
Don't complain about -fobjc-link-runtime being unused with -fobjc-arc.
Browse files Browse the repository at this point in the history
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161444 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
bob-wilson committed Aug 7, 2012
1 parent 6e53137 commit a7635f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Driver/Tools.cpp
Expand Up @@ -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);
}

Expand Down
4 changes: 4 additions & 0 deletions test/Driver/arclite-link.c
Expand Up @@ -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'

0 comments on commit a7635f1

Please sign in to comment.