ObjCConstantStringClass = 0;
C99 = Microsoft = CPlusPlus = CPlusPlus0x = 0;
CXXOperatorNames = PascalStrings = WritableStrings = 0;
- Exceptions = NeXTRuntime = Freestanding = NoBuiltin = 0;
+ Exceptions = Freestanding = NoBuiltin = 0;
+ NeXTRuntime = 1;
Rtti = 1;
LaxVectorConversions = 1;
HeinousExtensions = 0;
/// GetDarwinLanguageOptions - Set the default language options for darwin.
static void GetDarwinLanguageOptions(LangOptions &Opts,
const llvm::Triple &Triple) {
- Opts.NeXTRuntime = true;
-
unsigned MajorVersion = Triple.getDarwinMajorNumber();
// Blocks and stack protectors default to on for 10.6 (darwin10) and beyond.
Args.AddLastArg(CmdArgs, options::OPT_femit_all_decls);
Args.AddLastArg(CmdArgs, options::OPT_ffreestanding);
Args.AddLastArg(CmdArgs, options::OPT_fheinous_gnu_extensions);
- Args.AddLastArg(CmdArgs, options::OPT_fgnu_runtime);
Args.AddLastArg(CmdArgs, options::OPT_flax_vector_conversions);
- Args.AddLastArg(CmdArgs, options::OPT_fnext_runtime);
Args.AddLastArg(CmdArgs, options::OPT_fno_caret_diagnostics);
Args.AddLastArg(CmdArgs, options::OPT_fno_show_column);
Args.AddLastArg(CmdArgs, options::OPT_fobjc_gc_only);
getToolChain().getTriple().getOS() == llvm::Triple::Win32))
CmdArgs.push_back("-fms-extensions");
+ // -fnext-runtime is default.
+ if (!Args.hasFlag(options::OPT_fnext_runtime,
+ options::OPT_fgnu_runtime,
+ getToolChain().getTriple().getOS() == llvm::Triple::Darwin))
+ CmdArgs.push_back("-fgnu-runtime");
+
// -fshort-wchar default varies depending on platform; only
// pass if specified.
if (Arg *A = Args.getLastArg(options::OPT_fshort_wchar)) {
Res.push_back(Opts.Exceptions ? "1" : "0");
Res.push_back("-frtti");
Res.push_back(Opts.Rtti ? "1" : "0");
- Res.push_back(Opts.NeXTRuntime ? "-fnext-runtime" : "-fgnu-runtime");
+ if (!Opts.NeXTRuntime)
+ Res.push_back("-fgnu-runtime");
if (Opts.Freestanding)
Res.push_back("-ffreestanding");
if (Opts.NoBuiltin)
-// RUN: clang-cc -triple x86_64-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s
-// RUN: clang-cc -triple i386-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -triple x86_64-apple-darwin9 -emit-llvm -o %t %s
+// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm -o %t %s
// RUN: clang-cc -triple i386-pc-linux-gnu -emit-llvm -o %t %s
@interface Object
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -emit-llvm -o %t %s
@interface INTF
{
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -emit-llvm -o %t %s
@interface BASE
+ (int) BaseMeth;
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -emit-llvm -o %t %s
@interface Test { }
+ (Test *)crash;
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -emit-llvm -o %t %s
// RUN: clang-cc -fgnu-runtime -emit-llvm -o %t %s && grep NXConstantString %t | count 1
// RUN: clang-cc -fgnu-runtime -fconstant-string-class=NSConstantString -emit-llvm -o %t %s && grep NSConstantString %t | count 1
-// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
+// RUN: clang-cc --emit-llvm -o %t %s
@interface Object
- (id)new;
-// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
+// RUN: clang-cc --emit-llvm -o %t %s
#include <stdio.h>
-// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
+// RUN: clang-cc --emit-llvm -o %t %s
#include <stdio.h>
-// RUN: clang-cc -triple=i686-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -triple=i686-apple-darwin9 -emit-llvm -o %t %s
// RUN: grep -e "{Base=b2b3b4b5}" %t | count 1
// RUN: grep -e "{Derived=b2b3b4b5b5b4b3}" %t | count 1
-// RUN: clang-cc -triple=i686-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -triple=i686-apple-darwin9 -emit-llvm -o %t %s
// RUN: grep -e "@\\\22<X>\\\22" %t
// RUN: grep -e "@\\\22<X><Y>\\\22" %t
// RUN: grep -e "@\\\22<X><Y><Z>\\\22" %t
-// RUN: clang-cc -triple=i686-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -triple=i686-apple-darwin9 -emit-llvm -o %t %s
// RUN: grep -e "\^i" %t | count 1
// RUN: grep -e "\[0i\]" %t | count 1
-// RUN: clang-cc -triple=x86_64-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -triple=x86_64-apple-darwin9 -emit-llvm -o %t %s
// RUN: grep ji.00 %t | count 1
char *a = @encode(_Complex int);
-// RUN: clang-cc -triple=i686-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -triple=i686-apple-darwin9 -emit-llvm -o %t %s
// RUN: grep -e "\^{Innermost=CC}" %t | count 1
// RUN: grep -e "{Derived=#ib32b8b3b8sb16b8b8b2b8ccb6}" %t | count 1
// RUN: grep -e "{B1=#@c}" %t | count 1
-// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
+// RUN: clang-cc --emit-llvm -o %t %s
__attribute__((visibility("hidden")))
@interface Hidden
-// RUN: clang-cc -triple i386-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm -o %t %s
// RUN: grep '.lazy_reference .objc_class_name_A' %t | count 1
// RUN: grep '.lazy_reference .objc_class_name_Unknown' %t | count 1
// RUN: grep '.lazy_reference .objc_class_name_Protocol' %t | count 1
-// RUN: clang-cc -triple i386-apple-darwin9 -DWITH_IMPL -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -triple i386-apple-darwin9 -DWITH_IMPL -emit-llvm -o %t %s
// RUN: grep '.lazy_reference .objc_class_name_Root' %t | count 1
@interface Root
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -emit-llvm -o %t %s
void f0(id a) {
// This should have an implicit cast
-// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
+// RUN: clang-cc --emit-llvm -o %t %s
#include <stdio.h>
-// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
+// RUN: clang-cc --emit-llvm -o %t %s
// RUN: grep "objc_msgSend" %t | count 6
// RUN: clang-cc -fgnu-runtime --emit-llvm -o %t %s
// RUN: grep "objc_msg_lookup" %t | count 6
-// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
+// RUN: clang-cc --emit-llvm -o %t %s
@interface Object
- (id) new;
-// RUN: clang-cc -fnext-runtime -fobjc-gc -emit-llvm -o %t %s
+// RUN: clang-cc -fobjc-gc -emit-llvm -o %t %s
// RUN: grep objc_memmove_collectable %t | grep call | count 3
static int count;
-// RUN: clang-cc -triple x86_64-apple-darwin10 -fnext-runtime -fobjc-gc -emit-llvm -o %t %s
+// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s
// RUN: grep -F '@objc_assign_global' %t | count 26
@class NSObject;
-// RUN: clang-cc -triple x86_64-apple-darwin10 -fblocks -fnext-runtime -fobjc-gc -emit-llvm -o %t %s
+// RUN: clang-cc -triple x86_64-apple-darwin10 -fblocks -fobjc-gc -emit-llvm -o %t %s
// RUN: grep -F '@objc_assign_strongCast' %t | count 4
@interface DSATextSearch @end
-// RUN: clang-cc -triple=i686-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -triple=i686-apple-darwin9 -emit-llvm -o %t %s
// RUN: grep -e "T@\\\\22NSString\\\\22" %t
@interface NSString @end
-// RUN: clang-cc -triple=i686-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -triple=i686-apple-darwin9 -emit-llvm -o %t %s
// RUN: grep -e "T@\\\22<X>\\\22" %t
// RUN: grep -e "T@\\\22<X><Y>\\\22" %t
// RUN: grep -e "T@\\\22<X><Y><Z>\\\22" %t
-// RUN: clang-cc -fnext-runtime -fobjc-gc -emit-llvm -o %t %s
+// RUN: clang-cc -fobjc-gc -emit-llvm -o %t %s
@interface I {
__attribute__((objc_gc(strong))) signed long *_documentIDs;
-// RUN: clang-cc -triple i386-apple-darwin9 -fnext-runtime -fobjc-gc -emit-llvm -o %t %s
+// RUN: clang-cc -triple i386-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s
@interface PBXTarget
{
-// RUN: clang-cc -triple x86_64-apple-darwin10 -fnext-runtime -fobjc-gc -emit-llvm -o %t %s
+// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s
// RUN: grep -F '@objc_assign_global' %t | count 7
// RUN: grep -F '@objc_assign_ivar' %t | count 5
// RUN: grep -F '@objc_assign_strongCast' %t | count 8
-// RUN: clang-cc -triple x86_64-apple-darwin10 -fnext-runtime -fobjc-gc -emit-llvm -o %t %s
+// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s
// RUN: grep -F '@objc_assign_global' %t | count 21
// RUN: grep -F '@objc_assign_ivar' %t | count 11
-// RUN: clang-cc -triple i386-apple-darwin9 -fnext-runtime -emit-llvm %s -o %t
+// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm %s -o %t
@interface Foo
{
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -emit-llvm -o %t %s
@interface Object
- (id) new;
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -emit-llvm -o %t %s
typedef struct {
unsigned f0;
-// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
+// RUN: clang-cc --emit-llvm -o %t %s
@protocol NSObject
- (void *)description;
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -emit-llvm -o %t %s
@interface Object
- (id) new;
-// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
+// RUN: clang-cc --emit-llvm -o %t %s
#include <stdio.h>
-// RUN: clang-cc -fnext-runtime -emit-llvm %s -o %t
+// RUN: clang-cc -emit-llvm %s -o %t
void p(const char*, ...);
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -emit-llvm -o %t %s
// RUN: grep -e "^de.*objc_msgSend[0-9]*(" %t | count 1
-// RUN: clang-cc -DWITHDEF -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -DWITHDEF -emit-llvm -o %t %s
// RUN: grep -e "^de.*objc_msgSend[0-9]*(" %t | count 1
id objc_msgSend(int x);
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -emit-llvm -o %t %s
@interface SUPER
+ (void)Meth;
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -emit-llvm -o %t %s
// Test that meta-data for ivar lists with unnamed bitfield are generated.
//
@interface Foo {
-// RUN: clang-cc -triple i386-unknown-unknown -fnext-runtime -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-X86-32 %s
-// RUN: clang-cc -triple x86_64-unknown-unknown -fnext-runtime -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-X86-64 %s
+// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-X86-32 %s
+// RUN: clang-cc -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-X86-64 %s
@interface A
-(void) im0;
-// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
-// RUN: clang-cc -g -fnext-runtime -emit-llvm -o %t %s
+// RUN: clang-cc -emit-llvm -o %t %s
+// RUN: clang-cc -g -emit-llvm -o %t %s
#include "objc-language-features.inc"
// RUN: clang-cc -x=objective-c -E -dM < /dev/null | FileCheck -check-prefix OBJC %s
//
// OBJC:#define OBJC_NEW_PROPERTIES 1
+// OBJC:#define __NEXT_RUNTIME__ 1
// OBJC:#define __OBJC__ 1
//
-//
+//
// RUN: clang-cc -x=objective-c -fobjc-gc -E -dM < /dev/null | FileCheck -check-prefix OBJCGC %s
//
// OBJCGC:#define __OBJC_GC__ 1
//
//
-// RUN: clang-cc -x=objective-c -fnext-runtime -E -dM < /dev/null | FileCheck -check-prefix NEXTRT %s
-//
-// NEXTRT:#define __NEXT_RUNTIME__ 1
-//
-//
// RUN: clang-cc -x=objective-c -fobjc-nonfragile-abi -E -dM < /dev/null | FileCheck -check-prefix NONFRAGILE %s
//
// NONFRAGILE:#define OBJC_ZEROCOST_EXCEPTIONS 1
MathErrno("fmath-errno", llvm::cl::init(true),
llvm::cl::desc("Require math functions to respect errno"));
-static llvm::cl::opt<bool>
-NeXTRuntime("fnext-runtime",
- llvm::cl::desc("Generate output compatible with the NeXT "
- "runtime"));
-
static llvm::cl::opt<bool>
NoElideConstructors("fno-elide-constructors",
llvm::cl::desc("Disable C++ copy constructor elision"));
Options.InstantiationDepth = TemplateDepth;
// Override the default runtime if the user requested it.
- if (NeXTRuntime)
- Options.NeXTRuntime = 1;
- else if (GNURuntime)
+ if (GNURuntime)
Options.NeXTRuntime = 0;
if (!ObjCConstantStringClass.empty())