[cfe-commits] r134453 - in /cfe/trunk: include/clang/Basic/ include/clang/Driver/ include/clang/Frontend/ lib/ARCMigrate/ lib/CodeGen/ lib/Driver/ lib/Frontend/ lib/Lex/ lib/Sema/ test/ARCMT/ test/CodeGenObjC/ test/CodeGenObjCXX/ test/Driver/ test/Lexer/ test/SemaObjC/ test/SemaObjCXX/

John McCall rjmccall at apple.com
Tue Jul 5 17:26:06 PDT 2011


Author: rjmccall
Date: Tue Jul  5 19:26:06 2011
New Revision: 134453

URL: http://llvm.org/viewvc/llvm-project?rev=134453&view=rev
Log:
Change the driver's logic about Objective-C runtimes:  abstract out a
structure to hold inferred information, then propagate each invididual
bit down to -cc1.  Separate the bits of "supports weak" and "has a native
ARC runtime";  make the latter a CodeGenOption.

The tool chain is still driving this decision, because it's the place that
has the required deployment target information on Darwin, but at least it's
better-factored now.


Modified:
    cfe/trunk/include/clang/Basic/LangOptions.h
    cfe/trunk/include/clang/Driver/CC1Options.td
    cfe/trunk/include/clang/Driver/ToolChain.h
    cfe/trunk/include/clang/Frontend/CodeGenOptions.h
    cfe/trunk/lib/ARCMigrate/ARCMT.cpp
    cfe/trunk/lib/ARCMigrate/TransBlockObjCVariable.cpp
    cfe/trunk/lib/ARCMigrate/TransProperties.cpp
    cfe/trunk/lib/CodeGen/CGObjC.cpp
    cfe/trunk/lib/Driver/Compilation.cpp
    cfe/trunk/lib/Driver/ToolChain.cpp
    cfe/trunk/lib/Driver/ToolChains.cpp
    cfe/trunk/lib/Driver/ToolChains.h
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/lib/Frontend/CompilerInvocation.cpp
    cfe/trunk/lib/Frontend/InitPreprocessor.cpp
    cfe/trunk/lib/Lex/PPMacroExpansion.cpp
    cfe/trunk/lib/Sema/SemaObjCProperty.cpp
    cfe/trunk/lib/Sema/SemaType.cpp
    cfe/trunk/test/ARCMT/assign-prop-no-arc-runtime.m
    cfe/trunk/test/ARCMT/assign-prop-no-arc-runtime.m.result
    cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m
    cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m.result
    cfe/trunk/test/ARCMT/rewrite-block-var.m
    cfe/trunk/test/ARCMT/rewrite-block-var.m.result
    cfe/trunk/test/CodeGenObjC/arc-block-ivar-layout.m
    cfe/trunk/test/CodeGenObjC/arc-foreach.m
    cfe/trunk/test/CodeGenObjC/arc-ivar-layout.m
    cfe/trunk/test/CodeGenObjC/arc-no-runtime.m
    cfe/trunk/test/CodeGenObjC/arc-unopt.m
    cfe/trunk/test/CodeGenObjC/arc-weak-property.m
    cfe/trunk/test/CodeGenObjC/arc.m
    cfe/trunk/test/CodeGenObjC/autorelease.m
    cfe/trunk/test/CodeGenObjCXX/arc-mangle.mm
    cfe/trunk/test/CodeGenObjCXX/arc-new-delete.mm
    cfe/trunk/test/CodeGenObjCXX/arc-pseudo-destructors.mm
    cfe/trunk/test/CodeGenObjCXX/arc-references.mm
    cfe/trunk/test/CodeGenObjCXX/arc.mm
    cfe/trunk/test/Driver/ios-simulator-arcruntime.c
    cfe/trunk/test/Lexer/has_feature_objc_arc.m
    cfe/trunk/test/SemaObjC/arc-no-runtime.m
    cfe/trunk/test/SemaObjC/arc-non-pod-memaccess.m
    cfe/trunk/test/SemaObjC/arc-property-decl-attrs.m
    cfe/trunk/test/SemaObjC/arc-property-lifetime.m
    cfe/trunk/test/SemaObjC/arc-property.m
    cfe/trunk/test/SemaObjC/arc-type-conversion.m
    cfe/trunk/test/SemaObjC/arc.m
    cfe/trunk/test/SemaObjC/warn-retain-cycle.m
    cfe/trunk/test/SemaObjC/weak-property.m
    cfe/trunk/test/SemaObjCXX/arc-libcxx.mm
    cfe/trunk/test/SemaObjCXX/arc-libstdcxx.mm
    cfe/trunk/test/SemaObjCXX/arc-object-init-destroy.mm
    cfe/trunk/test/SemaObjCXX/arc-overloading.mm
    cfe/trunk/test/SemaObjCXX/arc-templates.mm
    cfe/trunk/test/SemaObjCXX/arc-type-conversion.mm
    cfe/trunk/test/SemaObjCXX/arc-type-traits.mm

Modified: cfe/trunk/include/clang/Basic/LangOptions.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/LangOptions.h?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/LangOptions.h (original)
+++ cfe/trunk/include/clang/Basic/LangOptions.h Tue Jul  5 19:26:06 2011
@@ -131,7 +131,7 @@
   // FIXME: This is just a temporary option, for testing purposes.
   unsigned NoBitFieldTypeAlign : 1;
   unsigned ObjCAutoRefCount : 1; // Objective C automated reference counting
-  unsigned ObjCNoAutoRefCountRuntime : 1; // ARC w/o extra runtime support
+  unsigned ObjCRuntimeHasWeak : 1; // The ARC runtime supports __weak
   unsigned ObjCInferRelatedReturnType : 1; // Infer Objective-C related return
                                            // types
   unsigned FakeAddressSpaceMap : 1; // Use a fake address space map, for
@@ -176,7 +176,8 @@
     Trigraphs = BCPLComment = Bool = DollarIdents = AsmPreprocessor = 0;
     GNUMode = GNUKeywords = ImplicitInt = Digraphs = 0;
     HexFloats = 0;
-    ObjCAutoRefCount = ObjCNoAutoRefCountRuntime = 0;
+    ObjCAutoRefCount = 0;
+    ObjCRuntimeHasWeak = 0;
     ObjCInferRelatedReturnType = 0;
     GC = ObjC1 = ObjC2 = ObjCNonFragileABI = ObjCNonFragileABI2 = 0;
     AppleKext = 0;

Modified: cfe/trunk/include/clang/Driver/CC1Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/CC1Options.td (original)
+++ cfe/trunk/include/clang/Driver/CC1Options.td Tue Jul  5 19:26:06 2011
@@ -494,10 +494,12 @@
   HelpText<"Synthesize retain and release calls for Objective-C pointers">;
 def fobjc_arc_cxxlib_EQ : Joined<"-fobjc-arc-cxxlib=">,
   HelpText<"Objective-C++ Automatic Reference Counting standard library kind">;
-def fobjc_no_arc_runtime : Flag<"-fobjc-no-arc-runtime">,
-  HelpText<"Implement -fobjc-arc without any extra runtime support">;
 def fobjc_arc_exceptions : Flag<"-fobjc-arc-exceptions">,
   HelpText<"Use EH-safe code when synthesizing retains and releases in -fobjc-arc">;
+def fobjc_runtime_has_arc : Flag<"-fobjc-runtime-has-arc">,
+  HelpText<"The target Objective-C runtime provides ARC entrypoints">;
+def fobjc_runtime_has_weak : Flag<"-fobjc-runtime-has-weak">,
+  HelpText<"The target Objective-C runtime supports ARC weak operations">;
 def fobjc_gc : Flag<"-fobjc-gc">,
   HelpText<"Enable Objective-C garbage collection">;
 def fobjc_gc_only : Flag<"-fobjc-gc-only">,

Modified: cfe/trunk/include/clang/Driver/ToolChain.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/ToolChain.h?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/ToolChain.h (original)
+++ cfe/trunk/include/clang/Driver/ToolChain.h Tue Jul  5 19:26:06 2011
@@ -26,6 +26,7 @@
   class HostInfo;
   class InputArgList;
   class JobAction;
+  class ObjCRuntime;
   class Tool;
 
 /// ToolChain - Access to tools for a single platform.
@@ -166,9 +167,6 @@
   /// UseSjLjExceptions - Does this tool chain use SjLj exceptions.
   virtual bool UseSjLjExceptions() const { return false; }
 
-  /// HasARCRuntime - Does this tool chain provide a specialized ARC runtime.
-  virtual bool HasARCRuntime() const { return true; }
-
   /// ComputeLLVMTriple - Return the LLVM target triple to use, after taking
   /// command line arguments into account.
   virtual std::string ComputeLLVMTriple(const ArgList &Args) const;
@@ -180,6 +178,12 @@
   /// Clang.
   virtual std::string ComputeEffectiveClangTriple(const ArgList &Args) const;
 
+  /// configureObjCRuntime - Configure the known properties of the
+  /// Objective-C runtime for this platform.
+  ///
+  /// FIXME: this doesn't really belong here.
+  virtual void configureObjCRuntime(ObjCRuntime &runtime) const;
+
   // GetCXXStdlibType - Determine the C++ standard library type to use with the
   // given compilation arguments.
   virtual CXXStdlibType GetCXXStdlibType(const ArgList &Args) const;

Modified: cfe/trunk/include/clang/Frontend/CodeGenOptions.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/CodeGenOptions.h?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/CodeGenOptions.h (original)
+++ cfe/trunk/include/clang/Frontend/CodeGenOptions.h Tue Jul  5 19:26:06 2011
@@ -76,6 +76,7 @@
   unsigned NoNaNsFPMath      : 1; /// Assume FP arguments, results not NaN.
   unsigned NoZeroInitializedInBSS : 1; /// -fno-zero-initialized-in-bss
   unsigned ObjCDispatchMethod : 2; /// Method of Objective-C dispatch to use.
+  unsigned ObjCRuntimeHasARC : 1; /// The target runtime supports ARC natively
   unsigned OmitLeafFramePointer : 1; /// Set when -momit-leaf-frame-pointer is
                                      /// enabled.
   unsigned OptimizationLevel : 3; /// The -O[0-4] option specified.

Modified: cfe/trunk/lib/ARCMigrate/ARCMT.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/ARCMT.cpp?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/ARCMT.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/ARCMT.cpp Tue Jul  5 19:26:06 2011
@@ -189,7 +189,7 @@
   CInvok->getDiagnosticOpts().ErrorLimit = 0;
   CInvok->getDiagnosticOpts().Warnings.push_back(
                                             "error=arc-unsafe-retained-assign");
-  CInvok->getLangOpts().ObjCNoAutoRefCountRuntime = !HasARCRuntime(origCI);
+  CInvok->getLangOpts().ObjCRuntimeHasWeak = HasARCRuntime(origCI);
 
   return CInvok.take();
 }

Modified: cfe/trunk/lib/ARCMigrate/TransBlockObjCVariable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/TransBlockObjCVariable.cpp?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/TransBlockObjCVariable.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/TransBlockObjCVariable.cpp Tue Jul  5 19:26:06 2011
@@ -98,12 +98,12 @@
         BlocksAttr *attr = var->getAttr<BlocksAttr>();
         if(!attr)
           continue;
-        bool hasARCRuntime = !Pass.Ctx.getLangOptions().ObjCNoAutoRefCountRuntime;
+        bool hasWeak = Pass.Ctx.getLangOptions().ObjCRuntimeHasWeak;
         SourceManager &SM = Pass.Ctx.getSourceManager();
         Transaction Trans(Pass.TA);
         Pass.TA.replaceText(SM.getInstantiationLoc(attr->getLocation()),
                             "__block",
-                            hasARCRuntime ? "__weak" : "__unsafe_unretained");
+                            hasWeak ? "__weak" : "__unsafe_unretained");
       }
 
     }

Modified: cfe/trunk/lib/ARCMigrate/TransProperties.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/TransProperties.cpp?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/TransProperties.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/TransProperties.cpp Tue Jul  5 19:26:06 2011
@@ -112,7 +112,7 @@
   }
 
   void applyWeak(PropData &prop) {
-    assert(!Pass.Ctx.getLangOptions().ObjCNoAutoRefCountRuntime);
+    assert(Pass.Ctx.getLangOptions().ObjCRuntimeHasWeak);
 
     Transaction Trans(Pass.TA);
     Pass.TA.insert(prop.IvarD->getLocation(), "__weak "); 
@@ -157,7 +157,7 @@
     // There is a "error: existing ivar for assign property must be
     // __unsafe_unretained"; fix it.
 
-    if (Pass.Ctx.getLangOptions().ObjCNoAutoRefCountRuntime) {
+    if (!Pass.Ctx.getLangOptions().ObjCRuntimeHasWeak) {
       // We will just add __unsafe_unretained to the ivar.
       Transaction Trans(Pass.TA);
       Pass.TA.insert(ivarD->getLocation(), "__unsafe_unretained ");

Modified: cfe/trunk/lib/CodeGen/CGObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjC.cpp?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjC.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjC.cpp Tue Jul  5 19:26:06 2011
@@ -1311,7 +1311,7 @@
 
   // In -fobjc-no-arc-runtime, emit weak references to the runtime
   // support library.
-  if (CGM.getLangOptions().ObjCNoAutoRefCountRuntime)
+  if (!CGM.getCodeGenOpts().ObjCRuntimeHasARC)
     if (llvm::Function *f = dyn_cast<llvm::Function>(fn))
       f->setLinkage(llvm::Function::ExternalWeakLinkage);
 
@@ -2457,13 +2457,7 @@
 
   // Keep track of the current cleanup stack depth.
   RunCleanupsScope Scope(*this);
-  const llvm::Triple Triple = getContext().Target.getTriple();
-  if (CGM.getLangOptions().ObjCAutoRefCount ||
-      (CGM.isTargetDarwin() && 
-       ((Triple.getArch() == llvm::Triple::x86_64 && 
-         !Triple.isMacOSXVersionLT(10,7,0))
-        || (Triple.getEnvironmentName() == "iphoneos" && 
-            !Triple.isOSVersionLT(5,0))))) {
+  if (CGM.getCodeGenOpts().ObjCRuntimeHasARC) {
     llvm::Value *token = EmitObjCAutoreleasePoolPush();
     EHStack.pushCleanup<CallObjCAutoreleasePoolObject>(NormalCleanup, token);
   } else {

Modified: cfe/trunk/lib/Driver/Compilation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Compilation.cpp?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Compilation.cpp (original)
+++ cfe/trunk/lib/Driver/Compilation.cpp Tue Jul  5 19:26:06 2011
@@ -13,6 +13,7 @@
 #include "clang/Driver/ArgList.h"
 #include "clang/Driver/Driver.h"
 #include "clang/Driver/DriverDiagnostic.h"
+#include "clang/Driver/ObjCRuntime.h"
 #include "clang/Driver/Options.h"
 #include "clang/Driver/ToolChain.h"
 

Modified: cfe/trunk/lib/Driver/ToolChain.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChain.cpp?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChain.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChain.cpp Tue Jul  5 19:26:06 2011
@@ -15,7 +15,9 @@
 #include "clang/Driver/Driver.h"
 #include "clang/Driver/DriverDiagnostic.h"
 #include "clang/Driver/HostInfo.h"
+#include "clang/Driver/ObjCRuntime.h"
 #include "clang/Driver/Options.h"
+#include "llvm/Support/ErrorHandling.h"
 
 using namespace clang::driver;
 
@@ -47,6 +49,23 @@
   return false;
 }
 
+void ToolChain::configureObjCRuntime(ObjCRuntime &runtime) const {
+  switch (runtime.getKind()) {
+  case ObjCRuntime::NeXT:
+    // Assume a minimal NeXT runtime.
+    runtime.HasARC = false;
+    runtime.HasWeak = false;
+    return;
+
+  case ObjCRuntime::GNU:
+    // Assume a maximal GNU runtime.
+    runtime.HasARC = true;
+    runtime.HasWeak = true;
+    return;
+  }
+  llvm_unreachable("invalid runtime kind!");
+}
+
 /// getARMTargetCPU - Get the (LLVM) name of the ARM cpu we are targeting.
 //
 // FIXME: tblgen this.

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Tue Jul  5 19:26:06 2011
@@ -19,6 +19,7 @@
 #include "clang/Driver/Driver.h"
 #include "clang/Driver/DriverDiagnostic.h"
 #include "clang/Driver/HostInfo.h"
+#include "clang/Driver/ObjCRuntime.h"
 #include "clang/Driver/OptTable.h"
 #include "clang/Driver/Option.h"
 #include "clang/Driver/Options.h"
@@ -74,8 +75,7 @@
   return true;
 }
 
-/// Darwin provides an ARC runtime starting in MacOS X 10.7 and iOS 5.0.
-bool Darwin::HasARCRuntime() const {
+bool Darwin::hasARCRuntime() const {
   // FIXME: Remove this once there is a proper way to detect an ARC runtime
   // for the simulator.
   switch (ARCRuntimeForSimulator) {
@@ -93,6 +93,14 @@
     return !isMacosxVersionLT(10, 7);
 }
 
+/// Darwin provides an ARC runtime starting in MacOS X 10.7 and iOS 5.0.
+void Darwin::configureObjCRuntime(ObjCRuntime &runtime) const {
+  if (runtime.getKind() != ObjCRuntime::NeXT)
+    return ToolChain::configureObjCRuntime(runtime);
+
+  runtime.HasARC = runtime.HasWeak = hasARCRuntime();
+}
+
 // FIXME: Can we tablegen this?
 static const char *GetArmArchForMArch(llvm::StringRef Value) {
   if (Value == "armv6k")

Modified: cfe/trunk/lib/Driver/ToolChains.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.h?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.h (original)
+++ cfe/trunk/lib/Driver/ToolChains.h Tue Jul  5 19:26:06 2011
@@ -80,6 +80,8 @@
   /// initialized.
   std::string MacosxVersionMin;
 
+  bool hasARCRuntime() const;
+
 private:
   void AddDeploymentTarget(DerivedArgList &Args) const;
 
@@ -184,7 +186,7 @@
 
   virtual bool HasNativeLLVMSupport() const;
 
-  virtual bool HasARCRuntime() const;
+  virtual void configureObjCRuntime(ObjCRuntime &runtime) const;
 
   virtual DerivedArgList *TranslateArgs(const DerivedArgList &Args,
                                         const char *BoundArch) const;

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Tue Jul  5 19:26:06 2011
@@ -17,6 +17,7 @@
 #include "clang/Driver/Compilation.h"
 #include "clang/Driver/Job.h"
 #include "clang/Driver/HostInfo.h"
+#include "clang/Driver/ObjCRuntime.h"
 #include "clang/Driver/Option.h"
 #include "clang/Driver/Options.h"
 #include "clang/Driver/ToolChain.h"
@@ -1600,47 +1601,6 @@
                     options::OPT_fno_lax_vector_conversions))
     CmdArgs.push_back("-fno-lax-vector-conversions");
 
-  // Allow -fno-objc-arr to trump -fobjc-arr/-fobjc-arc.
-  // NOTE: This logic is duplicated in ToolChains.cpp.
-  bool ARC = isObjCAutoRefCount(Args);
-  if (ARC) {
-    CmdArgs.push_back("-fobjc-arc");
-
-    // Certain deployment targets don't have runtime support.
-    if (!getToolChain().HasARCRuntime())
-      CmdArgs.push_back("-fobjc-no-arc-runtime");
-
-    // Allow the user to enable full exceptions code emission.
-    // We define off for Objective-CC, on for Objective-C++.
-    if (Args.hasFlag(options::OPT_fobjc_arc_exceptions,
-                     options::OPT_fno_objc_arc_exceptions,
-                     /*default*/ types::isCXX(InputType)))
-      CmdArgs.push_back("-fobjc-arc-exceptions");
-  }
-
-  // -fobjc-infer-related-result-type is the default, except in the Objective-C
-  // rewriter.
-  if (IsRewriter)
-    CmdArgs.push_back("-fno-objc-infer-related-result-type");
-  
-  // Handle -fobjc-gc and -fobjc-gc-only. They are exclusive, and -fobjc-gc-only
-  // takes precedence.
-  const Arg *GCArg = Args.getLastArg(options::OPT_fobjc_gc_only);
-  if (!GCArg)
-    GCArg = Args.getLastArg(options::OPT_fobjc_gc);
-  if (GCArg) {
-    if (ARC) {
-      D.Diag(clang::diag::err_drv_objc_gc_arr)
-        << GCArg->getAsString(Args);
-    } else if (getToolChain().SupportsObjCGC()) {
-      GCArg->render(Args, CmdArgs);
-    } else {
-      // FIXME: We should move this to a hard error.
-      D.Diag(clang::diag::warn_drv_objc_gc_unsupported)
-        << GCArg->getAsString(Args);
-    }
-  }
-
   if (Args.getLastArg(options::OPT_fapple_kext))
     CmdArgs.push_back("-fapple-kext");
 
@@ -1805,17 +1765,23 @@
                    false))
     CmdArgs.push_back("-fgnu89-inline");
 
-  // -fnext-runtime defaults to on Darwin and when rewriting Objective-C, and is
-  // -the -cc1 default.
-  bool NeXTRuntimeIsDefault =
-    IsRewriter || getToolChain().getTriple().getOS() == llvm::Triple::Darwin;
-  if (!Args.hasFlag(options::OPT_fnext_runtime, options::OPT_fgnu_runtime,
-                    NeXTRuntimeIsDefault))
-    CmdArgs.push_back("-fgnu-runtime");
-
   // -fobjc-nonfragile-abi=0 is default.
+  ObjCRuntime objCRuntime;
   unsigned objcABIVersion = 0;
   if (types::isObjC(InputType)) {
+    bool NeXTRuntimeIsDefault
+      = (IsRewriter || getToolChain().getTriple().isOSDarwin());
+    if (Args.hasFlag(options::OPT_fnext_runtime, options::OPT_fgnu_runtime,
+                     NeXTRuntimeIsDefault))
+      objCRuntime.setKind(ObjCRuntime::NeXT);
+    else
+      objCRuntime.setKind(ObjCRuntime::GNU);
+    getToolChain().configureObjCRuntime(objCRuntime);
+    if (objCRuntime.HasARC)
+      CmdArgs.push_back("-fobjc-runtime-has-arc");
+    if (objCRuntime.HasWeak)
+      CmdArgs.push_back("-fobjc-runtime-has-weak");
+
     // Compute the Objective-C ABI "version" to use. Version numbers are
     // slightly confusing for historical reasons:
     //   1 - Traditional "fragile" ABI
@@ -1890,6 +1856,43 @@
 #endif
   }
 
+  // Allow -fno-objc-arr to trump -fobjc-arr/-fobjc-arc.
+  // NOTE: This logic is duplicated in ToolChains.cpp.
+  bool ARC = isObjCAutoRefCount(Args);
+  if (ARC) {
+    CmdArgs.push_back("-fobjc-arc");
+
+    // Allow the user to enable full exceptions code emission.
+    // We define off for Objective-CC, on for Objective-C++.
+    if (Args.hasFlag(options::OPT_fobjc_arc_exceptions,
+                     options::OPT_fno_objc_arc_exceptions,
+                     /*default*/ types::isCXX(InputType)))
+      CmdArgs.push_back("-fobjc-arc-exceptions");
+  }
+
+  // -fobjc-infer-related-result-type is the default, except in the Objective-C
+  // rewriter.
+  if (IsRewriter)
+    CmdArgs.push_back("-fno-objc-infer-related-result-type");
+  
+  // Handle -fobjc-gc and -fobjc-gc-only. They are exclusive, and -fobjc-gc-only
+  // takes precedence.
+  const Arg *GCArg = Args.getLastArg(options::OPT_fobjc_gc_only);
+  if (!GCArg)
+    GCArg = Args.getLastArg(options::OPT_fobjc_gc);
+  if (GCArg) {
+    if (ARC) {
+      D.Diag(clang::diag::err_drv_objc_gc_arr)
+        << GCArg->getAsString(Args);
+    } else if (getToolChain().SupportsObjCGC()) {
+      GCArg->render(Args, CmdArgs);
+    } else {
+      // FIXME: We should move this to a hard error.
+      D.Diag(clang::diag::warn_drv_objc_gc_unsupported)
+        << GCArg->getAsString(Args);
+    }
+  }
+
   // Add exception args.
   addExceptionArgs(Args, InputType, getToolChain().getTriple(),
                    KernelOrKext, IsRewriter, objcABIVersion, CmdArgs);
@@ -3237,8 +3240,12 @@
   // In ARC, if we don't have runtime support, link in the runtime
   // stubs.  We have to do this *before* adding any of the normal
   // linker inputs so that its initializer gets run first.
-  if (!getDarwinToolChain().HasARCRuntime() && isObjCAutoRefCount(Args))
-    getDarwinToolChain().AddLinkARCArgs(Args, CmdArgs);
+  if (isObjCAutoRefCount(Args)) {
+    ObjCRuntime runtime;
+    getDarwinToolChain().configureObjCRuntime(runtime);
+    if (!runtime.HasARC)
+      getDarwinToolChain().AddLinkARCArgs(Args, CmdArgs);
+  }
 
   AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
 

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Tue Jul  5 19:26:06 2011
@@ -123,6 +123,8 @@
     Res.push_back("-dwarf-debug-flags");
     Res.push_back(Opts.DwarfDebugFlags);
   }
+  if (Opts.ObjCRuntimeHasARC)
+    Res.push_back("-fobjc-runtime-has-arc");
   if (Opts.EmitGcovArcs)
     Res.push_back("-femit-coverage-data");
   if (Opts.EmitGcovNotes)
@@ -690,8 +692,8 @@
   }
   if (Opts.ObjCAutoRefCount)
     Res.push_back("-fobjc-arc");
-  if (Opts.ObjCNoAutoRefCountRuntime)
-    Res.push_back("-fobjc-no-arc-runtime");
+  if (Opts.ObjCRuntimeHasWeak)
+    Res.push_back("-fobjc-runtime-has-weak");
   if (!Opts.ObjCInferRelatedResultType)
     Res.push_back("-fno-objc-infer-related-result-type");
   
@@ -976,6 +978,7 @@
 
   Opts.AsmVerbose = Args.hasArg(OPT_masm_verbose);
   Opts.ObjCAutoRefCountExceptions = Args.hasArg(OPT_fobjc_arc_exceptions);
+  Opts.ObjCRuntimeHasARC = Args.hasArg(OPT_fobjc_runtime_has_arc);
   Opts.CXAAtExit = !Args.hasArg(OPT_fno_use_cxa_atexit);
   Opts.CXXCtorDtorAliases = Args.hasArg(OPT_mconstructor_aliases);
   Opts.CodeModel = Args.getLastArgValue(OPT_mcode_model);
@@ -1532,10 +1535,11 @@
       Opts.ObjCAutoRefCount = 1;
       if (!Args.hasArg(OPT_fobjc_nonfragile_abi))
         Diags.Report(diag::err_arc_nonfragile_abi);
-      if (Args.hasArg(OPT_fobjc_no_arc_runtime))
-        Opts.ObjCNoAutoRefCountRuntime = 1;
     }
 
+    if (Args.hasArg(OPT_fobjc_runtime_has_weak))
+      Opts.ObjCRuntimeHasWeak = 1;
+
     if (Args.hasArg(OPT_fno_objc_infer_related_result_type))
       Opts.ObjCInferRelatedResultType = 0;
   }

Modified: cfe/trunk/lib/Frontend/InitPreprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitPreprocessor.cpp?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/InitPreprocessor.cpp (original)
+++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp Tue Jul  5 19:26:06 2011
@@ -250,7 +250,7 @@
         << "}\n"
         << "\n";
       
-    if (!LangOpts.ObjCNoAutoRefCountRuntime) {
+    if (LangOpts.ObjCRuntimeHasWeak) {
       Out << "template <class _Tp>\n"
           << "inline __attribute__ ((__visibility__(\"hidden\"),"
           << "__always_inline__))\n"
@@ -318,7 +318,7 @@
         << "};\n"
         << "\n";
       
-    if (!LangOpts.ObjCNoAutoRefCountRuntime) {
+    if (LangOpts.ObjCRuntimeHasWeak) {
       Out << "template<typename _Tp>\n"
           << "struct __is_scalar<__attribute__((objc_ownership(weak))) _Tp> {\n"
           << "  enum { __value = 0 };\n"

Modified: cfe/trunk/lib/Lex/PPMacroExpansion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPMacroExpansion.cpp?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)
+++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Tue Jul  5 19:26:06 2011
@@ -596,7 +596,7 @@
            .Case("objc_arr", LangOpts.ObjCAutoRefCount) // FIXME: REMOVE?
            .Case("objc_arc", LangOpts.ObjCAutoRefCount)
            .Case("objc_arc_weak", LangOpts.ObjCAutoRefCount && 
-                 !LangOpts.ObjCNoAutoRefCountRuntime)
+                 LangOpts.ObjCRuntimeHasWeak)
            .Case("objc_nonfragile_abi", LangOpts.ObjCNonFragileABI)
            .Case("objc_weak_class", LangOpts.ObjCNonFragileABI)
            .Case("ownership_holds", true)

Modified: cfe/trunk/lib/Sema/SemaObjCProperty.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaObjCProperty.cpp (original)
+++ cfe/trunk/lib/Sema/SemaObjCProperty.cpp Tue Jul  5 19:26:06 2011
@@ -592,7 +592,7 @@
           PropertyIvarType = Context.getQualifiedType(PropertyIvarType, qs);
         }
         else if (kind & ObjCPropertyDecl::OBJC_PR_weak) {
-          if (getLangOptions().ObjCNoAutoRefCountRuntime) {
+          if (!getLangOptions().ObjCRuntimeHasWeak) {
             Diag(PropertyLoc, diag::err_arc_weak_no_runtime);
             Diag(property->getLocation(), diag::note_property_declare);
           }

Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Tue Jul  5 19:26:06 2011
@@ -3191,9 +3191,9 @@
     type = S.Context.getAttributedType(AttributedType::attr_objc_ownership,
                                        origType, type);
 
-  // Forbid __weak if we don't have a runtime.
+  // Forbid __weak if the runtime doesn't support it.
   if (lifetime == Qualifiers::OCL_Weak &&
-      S.getLangOptions().ObjCNoAutoRefCountRuntime) {
+      !S.getLangOptions().ObjCRuntimeHasWeak) {
 
     // Actually, delay this until we know what we're parsing.
     if (S.DelayedDiagnostics.shouldDelayDiagnostics()) {

Modified: cfe/trunk/test/ARCMT/assign-prop-no-arc-runtime.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/assign-prop-no-arc-runtime.m?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/assign-prop-no-arc-runtime.m (original)
+++ cfe/trunk/test/ARCMT/assign-prop-no-arc-runtime.m Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -fobjc-no-arc-runtime -x objective-c %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -x objective-c %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-macosx10.6 -fobjc-nonfragile-abi -fsyntax-only %s > %t
 // RUN: diff %t %s.result
 

Modified: cfe/trunk/test/ARCMT/assign-prop-no-arc-runtime.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/assign-prop-no-arc-runtime.m.result?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/assign-prop-no-arc-runtime.m.result (original)
+++ cfe/trunk/test/ARCMT/assign-prop-no-arc-runtime.m.result Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -fobjc-no-arc-runtime -x objective-c %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -x objective-c %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-macosx10.6 -fobjc-nonfragile-abi -fsyntax-only %s > %t
 // RUN: diff %t %s.result
 

Modified: cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m (original)
+++ cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -x objective-c %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -fobjc-runtime-has-weak -x objective-c %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-macosx10.7 -fobjc-nonfragile-abi -fsyntax-only %s > %t
 // RUN: diff %t %s.result
 

Modified: cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m.result?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m.result (original)
+++ cfe/trunk/test/ARCMT/assign-prop-with-arc-runtime.m.result Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -x objective-c %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -fobjc-runtime-has-weak -x objective-c %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-macosx10.7 -fobjc-nonfragile-abi -fsyntax-only %s > %t
 // RUN: diff %t %s.result
 

Modified: cfe/trunk/test/ARCMT/rewrite-block-var.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/rewrite-block-var.m?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/rewrite-block-var.m (original)
+++ cfe/trunk/test/ARCMT/rewrite-block-var.m Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fblocks -fsyntax-only -fobjc-arc -x objective-c %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fblocks -fsyntax-only -fobjc-arc -x objective-c -fobjc-runtime-has-weak %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-macosx10.7 -fobjc-nonfragile-abi -fblocks -fsyntax-only %s > %t
 // RUN: diff %t %s.result
 

Modified: cfe/trunk/test/ARCMT/rewrite-block-var.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/rewrite-block-var.m.result?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/rewrite-block-var.m.result (original)
+++ cfe/trunk/test/ARCMT/rewrite-block-var.m.result Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fblocks -fsyntax-only -fobjc-arc -x objective-c %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fblocks -fsyntax-only -fobjc-arc -x objective-c -fobjc-runtime-has-weak %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-macosx10.7 -fobjc-nonfragile-abi -fblocks -fsyntax-only %s > %t
 // RUN: diff %t %s.result
 

Modified: cfe/trunk/test/CodeGenObjC/arc-block-ivar-layout.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc-block-ivar-layout.m?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/arc-block-ivar-layout.m (original)
+++ cfe/trunk/test/CodeGenObjC/arc-block-ivar-layout.m Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-nonfragile-abi -triple x86_64-apple-darwin -O0 -emit-llvm %s -o %t-64.s
+// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-nonfragile-abi -fobjc-runtime-has-weak -triple x86_64-apple-darwin -O0 -emit-llvm %s -o %t-64.s
 // RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
 // rdar://8991729
 

Modified: cfe/trunk/test/CodeGenObjC/arc-foreach.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc-foreach.m?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/arc-foreach.m (original)
+++ cfe/trunk/test/CodeGenObjC/arc-foreach.m Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-nonfragile-abi -triple x86_64-apple-darwin -O0 -emit-llvm %s -o %t-64.s
+// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-nonfragile-abi -fobjc-runtime-has-weak -triple x86_64-apple-darwin -O0 -emit-llvm %s -o %t-64.s
 // RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
 // rdar://9503326
 // rdar://9606600

Modified: cfe/trunk/test/CodeGenObjC/arc-ivar-layout.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc-ivar-layout.m?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/arc-ivar-layout.m (original)
+++ cfe/trunk/test/CodeGenObjC/arc-ivar-layout.m Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fobjc-arc -fobjc-nonfragile-abi -triple x86_64-apple-darwin -O0 -S %s -o %t-64.s
+// RUN: %clang_cc1 -fobjc-arc -fobjc-nonfragile-abi -fobjc-runtime-has-weak -triple x86_64-apple-darwin -O0 -S %s -o %t-64.s
 // RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
 // rdar://8991729
 

Modified: cfe/trunk/test/CodeGenObjC/arc-no-runtime.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc-no-runtime.m?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/arc-no-runtime.m (original)
+++ cfe/trunk/test/CodeGenObjC/arc-no-runtime.m Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-arc -fobjc-nonfragile-abi -fobjc-no-arc-runtime -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-arc -fobjc-nonfragile-abi -emit-llvm %s -o - | FileCheck %s
 
 // rdar://problem/9224855
 void test0() {

Modified: cfe/trunk/test/CodeGenObjC/arc-unopt.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc-unopt.m?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/arc-unopt.m (original)
+++ cfe/trunk/test/CodeGenObjC/arc-unopt.m Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fblocks -fobjc-arc -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fobjc-runtime-has-weak -fblocks -fobjc-arc -o - %s | FileCheck %s
 
 // A test to ensure that we generate fused calls at -O0.
 

Modified: cfe/trunk/test/CodeGenObjC/arc-weak-property.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc-weak-property.m?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/arc-weak-property.m (original)
+++ cfe/trunk/test/CodeGenObjC/arc-weak-property.m Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fblocks -fobjc-arc -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fobjc-runtime-has-weak -fblocks -fobjc-arc -o - %s | FileCheck %s
 // rdar://8899430
 
 @interface WeakPropertyTest {

Modified: cfe/trunk/test/CodeGenObjC/arc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc.m?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/arc.m (original)
+++ cfe/trunk/test/CodeGenObjC/arc.m Tue Jul  5 19:26:06 2011
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fblocks -fobjc-arc -O2 -disable-llvm-optzns -o - %s | FileCheck %s
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fblocks -fobjc-arc -o - %s | FileCheck -check-prefix=CHECK-GLOBALS %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fblocks -fobjc-arc -fobjc-runtime-has-weak -O2 -disable-llvm-optzns -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fblocks -fobjc-arc -fobjc-runtime-has-weak -o - %s | FileCheck -check-prefix=CHECK-GLOBALS %s
 
 // CHECK: define void @test0
 void test0(id x) {

Modified: cfe/trunk/test/CodeGenObjC/autorelease.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/autorelease.m?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/autorelease.m (original)
+++ cfe/trunk/test/CodeGenObjC/autorelease.m Tue Jul  5 19:26:06 2011
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -fobjc-nonfragile-abi -o - %s | FileCheck %s
-// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -emit-llvm -fobjc-nonfragile-abi -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -fobjc-nonfragile-abi -fobjc-runtime-has-arc -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -emit-llvm -fobjc-nonfragile-abi -fobjc-runtime-has-arc -o - %s | FileCheck %s
 // rdar://8881826
 // rdar://9412038
 

Modified: cfe/trunk/test/CodeGenObjCXX/arc-mangle.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/arc-mangle.mm?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/arc-mangle.mm (original)
+++ cfe/trunk/test/CodeGenObjCXX/arc-mangle.mm Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fobjc-nonfragile-abi -fobjc-arc -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -fobjc-nonfragile-abi -fobjc-arc -fobjc-runtime-has-weak -emit-llvm -o - %s | FileCheck %s
 
 // CHECK: define void @_Z1fPU8__strongP11objc_object(i8**)
 void f(__strong id *) {}

Modified: cfe/trunk/test/CodeGenObjCXX/arc-new-delete.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/arc-new-delete.mm?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/arc-new-delete.mm (original)
+++ cfe/trunk/test/CodeGenObjCXX/arc-new-delete.mm Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fobjc-nonfragile-abi -fobjc-arc -fblocks -triple x86_64-apple-darwin10.0.0 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -fobjc-nonfragile-abi -fobjc-arc -fobjc-runtime-has-weak -fblocks -triple x86_64-apple-darwin10.0.0 -emit-llvm -o - %s | FileCheck %s
 
 typedef __strong id strong_id;
 typedef __weak id weak_id;

Modified: cfe/trunk/test/CodeGenObjCXX/arc-pseudo-destructors.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/arc-pseudo-destructors.mm?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/arc-pseudo-destructors.mm (original)
+++ cfe/trunk/test/CodeGenObjCXX/arc-pseudo-destructors.mm Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fobjc-nonfragile-abi -fobjc-arc -fblocks -triple x86_64-apple-darwin10.0.0 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -fobjc-nonfragile-abi -fobjc-arc -fobjc-runtime-has-weak -fblocks -triple x86_64-apple-darwin10.0.0 -emit-llvm -o - %s | FileCheck %s
 
 // CHECK: define void @_Z28test_objc_object_pseudo_dtorPU8__strongP11objc_objectPU6__weakS0_
 void test_objc_object_pseudo_dtor(__strong id *ptr, __weak id *wptr) {

Modified: cfe/trunk/test/CodeGenObjCXX/arc-references.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/arc-references.mm?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/arc-references.mm (original)
+++ cfe/trunk/test/CodeGenObjCXX/arc-references.mm Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fblocks -fobjc-arc -O2 -disable-llvm-optzns -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fobjc-runtime-has-weak -fblocks -fobjc-arc -O2 -disable-llvm-optzns -o - %s | FileCheck %s
 
 @interface A
 @end

Modified: cfe/trunk/test/CodeGenObjCXX/arc.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/arc.mm?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/arc.mm (original)
+++ cfe/trunk/test/CodeGenObjCXX/arc.mm Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fblocks -fobjc-arc -O2 -disable-llvm-optzns -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fobjc-runtime-has-weak -fblocks -fobjc-arc -O2 -disable-llvm-optzns -o - %s | FileCheck %s
 
 // rdar://problem/9315552
 // The analogous ObjC testcase test46 in arr.m.

Modified: cfe/trunk/test/Driver/ios-simulator-arcruntime.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/ios-simulator-arcruntime.c?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/Driver/ios-simulator-arcruntime.c (original)
+++ cfe/trunk/test/Driver/ios-simulator-arcruntime.c Tue Jul  5 19:26:06 2011
@@ -1,6 +1,6 @@
-// RUN: %clang -### -ccc-host-triple i386-apple-darwin10 -arch i386 -mmacosx-version-min=10.6 -D__IPHONE_OS_VERSION_MIN_REQUIRED=40201 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS1 %s
-// RUN: %clang -### -ccc-host-triple i386-apple-darwin10 -arch i386 -mmacosx-version-min=10.6 -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS2 %s
+// RUN: %clang -### -x objective-c -ccc-host-triple i386-apple-darwin10 -arch i386 -mmacosx-version-min=10.6 -D__IPHONE_OS_VERSION_MIN_REQUIRED=40201 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS1 %s
+// RUN: %clang -### -x objective-c -ccc-host-triple i386-apple-darwin10 -arch i386 -mmacosx-version-min=10.6 -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS2 %s
 // 
 
-// CHECK-OPTIONS1: -fobjc-no-arc-runtime
-// CHECK-OPTIONS2-NOT: -fobjc-no-arc-runtime
+// CHECK-OPTIONS1-NOT: -fobjc-runtime-has-weak
+// CHECK-OPTIONS2: -fobjc-runtime-has-weak

Modified: cfe/trunk/test/Lexer/has_feature_objc_arc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/has_feature_objc_arc.m?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/Lexer/has_feature_objc_arc.m (original)
+++ cfe/trunk/test/Lexer/has_feature_objc_arc.m Tue Jul  5 19:26:06 2011
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -E %s -fobjc-nonfragile-abi -fobjc-arc "-triple" "x86_64-apple-macosx10.7.0" | FileCheck --check-prefix=CHECK-ARC %s
-// RUN: %clang_cc1 -E %s -fobjc-nonfragile-abi -fobjc-arc "-triple" "x86_64-apple-macosx10.6.0" -fobjc-no-arc-runtime | FileCheck --check-prefix=CHECK-ARCLITE %s
+// RUN: %clang_cc1 -E %s -fobjc-nonfragile-abi -fobjc-arc "-triple" "x86_64-apple-macosx10.7.0"  -fobjc-runtime-has-weak | FileCheck --check-prefix=CHECK-ARC %s
+// RUN: %clang_cc1 -E %s -fobjc-nonfragile-abi -fobjc-arc "-triple" "x86_64-apple-macosx10.6.0" | FileCheck --check-prefix=CHECK-ARCLITE %s
 
 #if __has_feature(objc_arc)
 void has_objc_arc_feature();

Modified: cfe/trunk/test/SemaObjC/arc-no-runtime.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/arc-no-runtime.m?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/arc-no-runtime.m (original)
+++ cfe/trunk/test/SemaObjC/arc-no-runtime.m Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fobjc-arc -fobjc-nonfragile-abi -fobjc-no-arc-runtime -verify %s
+// RUN: %clang_cc1 -fobjc-arc -fobjc-nonfragile-abi -verify %s
 
 // rdar://problem/9150784
 void test(void) {

Modified: cfe/trunk/test/SemaObjC/arc-non-pod-memaccess.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/arc-non-pod-memaccess.m?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/arc-non-pod-memaccess.m (original)
+++ cfe/trunk/test/SemaObjC/arc-non-pod-memaccess.m Tue Jul  5 19:26:06 2011
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -verify -fblocks -triple x86_64-apple-darwin10.0.0 %s
-// RUN: %clang_cc1 -x objective-c++ -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -verify -fblocks -triple x86_64-apple-darwin10.0.0 %s
+// RUN: %clang_cc1 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -fobjc-runtime-has-weak -verify -fblocks -triple x86_64-apple-darwin10.0.0 %s
+// RUN: %clang_cc1 -x objective-c++ -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -fobjc-runtime-has-weak -verify -fblocks -triple x86_64-apple-darwin10.0.0 %s
 
 #ifdef __cplusplus
 extern "C" {

Modified: cfe/trunk/test/SemaObjC/arc-property-decl-attrs.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/arc-property-decl-attrs.m?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/arc-property-decl-attrs.m (original)
+++ cfe/trunk/test/SemaObjC/arc-property-decl-attrs.m Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-nonfragile-abi -fobjc-runtime-has-weak -fsyntax-only -fobjc-arc -verify %s
 // rdar://9340606
 
 @interface Foo {

Modified: cfe/trunk/test/SemaObjC/arc-property-lifetime.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/arc-property-lifetime.m?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/arc-property-lifetime.m (original)
+++ cfe/trunk/test/SemaObjC/arc-property-lifetime.m Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-nonfragile-abi -fobjc-runtime-has-weak -fsyntax-only -fobjc-arc -verify %s
 // rdar://9340606
 
 @interface Foo {

Modified: cfe/trunk/test/SemaObjC/arc-property.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/arc-property.m?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/arc-property.m (original)
+++ cfe/trunk/test/SemaObjC/arc-property.m Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -fblocks -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-nonfragile-abi -fobjc-runtime-has-weak -fsyntax-only -fobjc-arc -fblocks -verify %s
 // rdar://9309489
 
 @interface MyClass {

Modified: cfe/trunk/test/SemaObjC/arc-type-conversion.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/arc-type-conversion.m?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/arc-type-conversion.m (original)
+++ cfe/trunk/test/SemaObjC/arc-type-conversion.m Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fobjc-nonfragile-abi -verify -fblocks %s
+// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fobjc-nonfragile-abi -fobjc-runtime-has-weak -verify -fblocks %s
 
 void * cvt(id arg)
 {

Modified: cfe/trunk/test/SemaObjC/arc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/arc.m?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/arc.m (original)
+++ cfe/trunk/test/SemaObjC/arc.m Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -fblocks -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-nonfragile-abi -fobjc-runtime-has-weak -fsyntax-only -fobjc-arc -fblocks -verify %s
 
 typedef unsigned long NSUInteger;
 

Modified: cfe/trunk/test/SemaObjC/warn-retain-cycle.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/warn-retain-cycle.m?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/warn-retain-cycle.m (original)
+++ cfe/trunk/test/SemaObjC/warn-retain-cycle.m Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fobjc-nonfragile-abi -fobjc-arc -fblocks -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fobjc-nonfragile-abi -fobjc-runtime-has-weak -fobjc-arc -fblocks -verify %s
 
 @interface Test0
 - (void) setBlock: (void(^)(void)) block;

Modified: cfe/trunk/test/SemaObjC/weak-property.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/weak-property.m?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/weak-property.m (original)
+++ cfe/trunk/test/SemaObjC/weak-property.m Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1  -fsyntax-only -fobjc-nonfragile-abi -fobjc-arc -verify %s
+// RUN: %clang_cc1  -fsyntax-only -fobjc-nonfragile-abi -fobjc-runtime-has-weak -fobjc-arc -verify %s
 // rdar://8899430
 
 @interface WeakPropertyTest {

Modified: cfe/trunk/test/SemaObjCXX/arc-libcxx.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/arc-libcxx.mm?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjCXX/arc-libcxx.mm (original)
+++ cfe/trunk/test/SemaObjCXX/arc-libcxx.mm Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fobjc-arc-cxxlib=libc++ -fobjc-nonfragile-abi -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fobjc-arc-cxxlib=libc++ -fobjc-nonfragile-abi -fobjc-runtime-has-weak -verify %s
 
 @interface A @end
 

Modified: cfe/trunk/test/SemaObjCXX/arc-libstdcxx.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/arc-libstdcxx.mm?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjCXX/arc-libstdcxx.mm (original)
+++ cfe/trunk/test/SemaObjCXX/arc-libstdcxx.mm Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fobjc-arc-cxxlib=libstdc++ -fobjc-nonfragile-abi -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fobjc-arc-cxxlib=libstdc++ -fobjc-nonfragile-abi -fobjc-runtime-has-weak -verify %s
 
 @interface A @end
 

Modified: cfe/trunk/test/SemaObjCXX/arc-object-init-destroy.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/arc-object-init-destroy.mm?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjCXX/arc-object-init-destroy.mm (original)
+++ cfe/trunk/test/SemaObjCXX/arc-object-init-destroy.mm Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -verify -Warc-abi -fblocks -triple x86_64-apple-darwin10.0.0 %s
+// RUN: %clang_cc1 -fobjc-nonfragile-abi -fobjc-runtime-has-weak -fsyntax-only -fobjc-arc -verify -Warc-abi -fblocks -triple x86_64-apple-darwin10.0.0 %s
 
 typedef __strong id strong_id;
 typedef __weak id weak_id;

Modified: cfe/trunk/test/SemaObjCXX/arc-overloading.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/arc-overloading.mm?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjCXX/arc-overloading.mm (original)
+++ cfe/trunk/test/SemaObjCXX/arc-overloading.mm Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -verify -fblocks %s
+// RUN: %clang_cc1 -fobjc-nonfragile-abi -fobjc-runtime-has-weak -fsyntax-only -fobjc-arc -verify -fblocks %s
 
 // Simple ownership conversions + diagnostics.
 int &f0(id __strong const *); // expected-note{{candidate function not viable: 1st argument ('__weak id *') has __weak ownership, but parameter has __strong ownership}}

Modified: cfe/trunk/test/SemaObjCXX/arc-templates.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/arc-templates.mm?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjCXX/arc-templates.mm (original)
+++ cfe/trunk/test/SemaObjCXX/arc-templates.mm Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -verify -fblocks %s
+// RUN: %clang_cc1 -fobjc-nonfragile-abi -fobjc-runtime-has-weak -fsyntax-only -fobjc-arc -verify -fblocks %s
 
 @interface A
 @end

Modified: cfe/trunk/test/SemaObjCXX/arc-type-conversion.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/arc-type-conversion.mm?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjCXX/arc-type-conversion.mm (original)
+++ cfe/trunk/test/SemaObjCXX/arc-type-conversion.mm Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -verify -fblocks %s
+// RUN: %clang_cc1 -fobjc-nonfragile-abi -fobjc-runtime-has-weak -fsyntax-only -fobjc-arc -verify -fblocks %s
 // rdar://8843600
 
 void * cvt(id arg) // expected-note{{candidate function not viable: cannot convert argument of incomplete type 'void *' to '__strong id'}}

Modified: cfe/trunk/test/SemaObjCXX/arc-type-traits.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/arc-type-traits.mm?rev=134453&r1=134452&r2=134453&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjCXX/arc-type-traits.mm (original)
+++ cfe/trunk/test/SemaObjCXX/arc-type-traits.mm Tue Jul  5 19:26:06 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fobjc-nonfragile-abi -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fobjc-nonfragile-abi -fobjc-runtime-has-weak -verify %s
 
 // Check the results of the various type-trait query functions on
 // lifetime-qualified types in ARC.





More information about the cfe-commits mailing list