]> granicus.if.org Git - clang/commitdiff
Change the driver's logic about Objective-C runtimes: abstract out a
authorJohn McCall <rjmccall@apple.com>
Wed, 6 Jul 2011 00:26:06 +0000 (00:26 +0000)
committerJohn McCall <rjmccall@apple.com>
Wed, 6 Jul 2011 00:26:06 +0000 (00:26 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134453 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 7eda0aa3fdcde7ba5a126b27d9485542547935c9..6d4dc5b8dcb0e670aa16a578fe026a30269c09e1 100644 (file)
@@ -131,7 +131,7 @@ public:
   // 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 @@ public:
     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;
index 653f346b9e2594c4391319b77202baee97d3f7d1..aab0213b9520065b7c9e67147aaadf7573a88f44 100644 (file)
@@ -494,10 +494,12 @@ def fobjc_arc : Flag<"-fobjc-arc">,
   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">,
index a570beaf794e0d9b8ec1d76d776ee7a102afef30..4836d3ffac224ea78a4c9df703b44ae73e0afebc 100644 (file)
@@ -26,6 +26,7 @@ namespace driver {
   class HostInfo;
   class InputArgList;
   class JobAction;
+  class ObjCRuntime;
   class Tool;
 
 /// ToolChain - Access to tools for a single platform.
@@ -166,9 +167,6 @@ public:
   /// 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 @@ public:
   /// 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;
index 2191980b955b90e284a3b53b025ce8c03ca05eb8..d415d0a889a4be600e9048b7f7f2e16ad9341455 100644 (file)
@@ -76,6 +76,7 @@ public:
   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.
index 7f3479604e2bb133c09145854f90cbd81aad8a75..0678a255d7100ec2ec5e1941e6bc0a5fc7d3ac8d 100644 (file)
@@ -189,7 +189,7 @@ CompilerInvocation *createInvocationForMigration(CompilerInvocation &origCI) {
   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();
 }
index ba556277cc814b87144bd4ef7d26624539a5ec42..97695cbccfa580b59d526b336719f3e6c3daf179 100644 (file)
@@ -98,12 +98,12 @@ public:
         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");
       }
 
     }
index e0009ac241aeb9cd7494b0af784c5618d305cfa0..0efc4c0fadf0113803123d3a50b239940544cb8d 100644 (file)
@@ -112,7 +112,7 @@ public:
   }
 
   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 @@ public:
     // 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 ");
index db9873b8174e9f330a1935f2007ac88e1f95ea43..d8ce1f4a755bfdf7087203ea5a6013057f8ba475 100644 (file)
@@ -1311,7 +1311,7 @@ static llvm::Constant *createARCRuntimeFunction(CodeGenModule &CGM,
 
   // 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 @@ void CodeGenFunction::EmitObjCAutoreleasePoolStmt(
 
   // 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 {
index 2657faa0d3a786e198443c565e62f2c2e3913a1d..e15e40295c15378f308d8fad8970639fb10c5cb8 100644 (file)
@@ -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"
 
index cbbbc5c4de2b2f75b6a922cf94ef85386b866a9e..0cce5175492943afc872e8bed01593b844b139e0 100644 (file)
@@ -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 @@ bool ToolChain::HasNativeLLVMSupport() const {
   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.
index b4501acbb1ad0cf296a022c433a31082944d9297..68ebc1b6b35776db16b1407466e137f442d80792 100644 (file)
@@ -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 @@ bool Darwin::HasNativeLLVMSupport() const {
   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 @@ bool Darwin::HasARCRuntime() const {
     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")
index 9ed0dc2ef8e922d29b04df93c45ea62f7dcd4036..d68016b3a2407620f2d7a51398e4570f5c47b463 100644 (file)
@@ -80,6 +80,8 @@ private:
   /// initialized.
   std::string MacosxVersionMin;
 
+  bool hasARCRuntime() const;
+
 private:
   void AddDeploymentTarget(DerivedArgList &Args) const;
 
@@ -184,7 +186,7 @@ public:
 
   virtual bool HasNativeLLVMSupport() const;
 
-  virtual bool HasARCRuntime() const;
+  virtual void configureObjCRuntime(ObjCRuntime &runtime) const;
 
   virtual DerivedArgList *TranslateArgs(const DerivedArgList &Args,
                                         const char *BoundArch) const;
index 4e70c5c372391bcd960f8cb7a6d18efcda29c14c..d0fd914bf0dcefef728a6d2f8ad821bf57e239bf 100644 (file)
@@ -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 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
                     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 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
                    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 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
 #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 @@ void darwin::Link::ConstructJob(Compilation &C, const JobAction &JA,
   // 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);
 
index 12e51a61e1f08222b8c86a23f43b4997ae7195fa..31c86432b754053ba29f425036dc169725f49383 100644 (file)
@@ -123,6 +123,8 @@ static void CodeGenOptsToArgs(const CodeGenOptions &Opts,
     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 @@ static void LangOptsToArgs(const LangOptions &Opts,
   }
   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 @@ static void ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
 
   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 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
       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;
   }
index b07fb4395fab15279616163e0b9dd0a68d1e18ff..9428cd5de0f348df5a2f6449088ec8d06157175d 100644 (file)
@@ -250,7 +250,7 @@ static void AddObjCXXARCLibcxxDefines(const LangOptions &LangOpts,
         << "}\n"
         << "\n";
       
-    if (!LangOpts.ObjCNoAutoRefCountRuntime) {
+    if (LangOpts.ObjCRuntimeHasWeak) {
       Out << "template <class _Tp>\n"
           << "inline __attribute__ ((__visibility__(\"hidden\"),"
           << "__always_inline__))\n"
@@ -318,7 +318,7 @@ static void AddObjCXXARCLibstdcxxDefines(const LangOptions &LangOpts,
         << "};\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"
index d7c4defb3687a5423c3d597d4acb023962a277d3..f1d03713a92514d080211b009030f48e18f8b2d6 100644 (file)
@@ -596,7 +596,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
            .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)
index 012e2569c33380718a69a3dac66cea01c4928272..b47d62780b90d670d65e6b67b2a3de2cb4380904 100644 (file)
@@ -592,7 +592,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S,
           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);
           }
index 3f211daeac9d0be5cba388b6e165a4a7d2408871..14184220064d9be8f42387e850e572e192a9ecf0 100644 (file)
@@ -3191,9 +3191,9 @@ static bool handleObjCOwnershipTypeAttr(TypeProcessingState &state,
     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()) {
index c65ef6879fb1f091758867671cb68aa0c7df61c1..0baa1d28ff5651bc3c5e58b20ce06e5fbad42fe7 100644 (file)
@@ -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
 
index 6093fd3c55ca94b336548476b56d6705a11442c1..93eebee0a77258f0128a1b1a264d063a99d789dc 100644 (file)
@@ -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
 
index 49c25a7a6296760cd0a2c6bf0973236d7fcb6946..8d9f21115c5365c07f0a932b20ed748a5ca23ce8 100644 (file)
@@ -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
 
index 88b41de5b6e5cc99e7bb0b21bf99038dcd00db9e..2d74ae2ed9f7d8bf9551e11e69e1f7b929132872 100644 (file)
@@ -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
 
index 8053cfe77362fb27907c6c225da8dc8d1a11cf04..81407f92e9bb496574f069c8135cd1bb1a86bd01 100644 (file)
@@ -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
 
index a2fa56d784605f5c7f20116953f33b8b7c737125..85093ac52d2736d7cc0bb4afbb3addb4c2df9f09 100644 (file)
@@ -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
 
index b6a04276365dbb8973a9716f6c85ebca5a4e7e67..50c35bacda060d9bf416bd50f5cf5c7f995300ea 100644 (file)
@@ -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
 
index e8a5b8851e136d7f31cff7f045fac0d665139b48..3dd8b690be2a45e901851214cc8cacd0934701f3 100644 (file)
@@ -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
index 93c9ff7fed6595f818df2fe99fbd20bf2eee6bc9..cb930fe3d3655596a16d03d3fd382dda5fc508ee 100644 (file)
@@ -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
 
index db1e42c44824dda56655f7b08710ca9e14639830..39f7da3460e5379481147c36edd480dc97574639 100644 (file)
@@ -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() {
index 73d110c948622a6f3107ae461d9753b1d8711caf..ed46052af84822b0de72aa8e7908bdd2051aa79e 100644 (file)
@@ -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.
 
index 2e274db198c752e1d0d17a0ffb5746e3e13a2d97..c0796046446e3ad9a77f593682ff823c3f17ff86 100644 (file)
@@ -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 {
index 2a51454e758ca9890b37cc2b87d030e4a7dcaf40..a7db3f04028b545a17cf1240c13637fdc8a15059 100644 (file)
@@ -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) {
index 1d81d010a37010a89d3f0780fa9f13ee736dc431..7bf40f11ffd15c15f63be4bfc22b7a53525d4f9e 100644 (file)
@@ -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
 
index 20af4dfccae493d463fae82b870bb79c3a6efd79..1955348f1c32676d7111b7cc22daa4afc5ed894b 100644 (file)
@@ -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 *) {}
index e638870fdd02f630cd1997b9f70fe8be4d50c37f..be92da51762ec53bb2c7ca4f5344f4809bebee32 100644 (file)
@@ -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;
index 27d98cb7cb0c9126178d067981e854820a3d2f3d..4023e90b7dc73bc34c10c166a6416bd503686037 100644 (file)
@@ -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) {
index b113d80027beab59a32a8daea89aa1920e0fe39b..3d0313d13ac82e1fce4000533c6b8e7b9d913b92 100644 (file)
@@ -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
index 43098553aaabb211fa13bf487307f293d649dced..d4d9ba7516025a548821b57c75a2a11346a4af48 100644 (file)
@@ -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.
index d35fe67a74e8a13d6bf19cea352df3f0801dd257..bec9f7b1fdc81fc7a62eea3be293c29fb5fcb9be 100644 (file)
@@ -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
index 18dab422b67fb9d4822e85cfce09f7f903ca359d..cd41900c60b70ac2ba90a0e05e585919cc90b6ad 100644 (file)
@@ -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();
index 0bf7d52fd21818bbdfed63a627eec98f8cd8d997..94299e235e8164772ef9952ef9ce0c1b8e3fb0ac 100644 (file)
@@ -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) {
index 46392bd115d0cb7129874a71e4b29bfb4c401dbd..c9a77519694d38ec33a44862c05821ebb2cb5f8d 100644 (file)
@@ -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" {
index 0a139c5260476b09057211cd45325ae934bdf673..0dd74b8ad5cecec8f70d7be8bd1a96a717126824 100644 (file)
@@ -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 {
index 99f6d2dfbcb4bd75e138f756927812fc796a5c3f..b1c84c75c05824c99edcabb74fa1b0f06a34d81e 100644 (file)
@@ -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 {
index c62448dbac6b2deed237486e06441c6bb9abdd67..0651f1808dc916dfbcc987fcf9d11b57463aa06d 100644 (file)
@@ -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 {
index bb5686b691b79fe33c8c9199c2c02713e0f48419..103db5695f49ac773d7c6af4e317ff5ec22e1df2 100644 (file)
@@ -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)
 {
index 0ec44b93514bc8abca9f90bab27422289b59e471..10df61e6009a14c546456446d6729bab1199a1f7 100644 (file)
@@ -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;
 
index fd69ce2e5b0053d9fae2fe14e5bc0e02ee3f209c..71385b8400bb204687070ef605b64a75d49e55a1 100644 (file)
@@ -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;
index 3fabac07a3802654df1f237144148edb6853b3fb..f0006076413d48ae0c28fb175fc804759056e96f 100644 (file)
@@ -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 {
index 7c3c82eb02870225ba53cdb29bb7e64e955eeb24..7992f602f51a345322d29b385c0ec834ac55d723 100644 (file)
@@ -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
 
index a055e36ca077e97342eebee2bf16740adaf6f3ed..edb7a9ef486a363b0953d65bc4139d061c23b4f8 100644 (file)
@@ -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
 
index 515dbf873cab2a77172e055a0520acac0ee313f7..196f4937184795eec3345015121e7b3cba15e4c0 100644 (file)
@@ -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;
index 2bce4bc894f83e605a09c99a150db69482a4b9e3..06b332cec85f283ba61f460416e1b88dac8f50b1 100644 (file)
@@ -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}}
index 73fc314e0e3a5a46ca82b615e956086e8ddd82b3..fa4e0a7776427005ad49a24118d0d783bc784e29 100644 (file)
@@ -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
index baf4b8208270ffe4f64f11ef817e40cd48b8743d..f52f54a50cc405158eed8f39b6befdc0ea151042 100644 (file)
@@ -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'}}
index 5f05e337e35312d2ad00f540ec2eb18a7f40626d..f50904b03c7320ed8a1d3abd365870430caed38f 100644 (file)
@@ -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.