зеркало из https://github.com/microsoft/clang.git
Move -fnext-runtime defaulting to driver (and change clang-cc default to
-fnext-runtime), instead of using getDefaultLangOptions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89058 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
0be42c44f0
Коммит
c5a97ec194
|
@ -126,7 +126,8 @@ public:
|
|||
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;
|
||||
|
|
|
@ -158,8 +158,6 @@ static void getDarwinIPhoneOSDefines(std::vector<char> &Defs,
|
|||
/// 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.
|
||||
|
|
|
@ -887,9 +887,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
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);
|
||||
|
@ -955,6 +953,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
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)) {
|
||||
|
|
|
@ -396,7 +396,8 @@ static void LangOptsToArgs(const LangOptions &Opts,
|
|||
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)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// 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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
|
||||
// RUN: clang-cc -emit-llvm -o %t %s
|
||||
|
||||
@interface INTF
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
|
||||
// RUN: clang-cc -emit-llvm -o %t %s
|
||||
|
||||
@interface BASE
|
||||
+ (int) BaseMeth;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
|
||||
// RUN: clang-cc -emit-llvm -o %t %s
|
||||
|
||||
@interface Test { }
|
||||
+ (Test *)crash;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 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
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
|
||||
// RUN: clang-cc --emit-llvm -o %t %s
|
||||
|
||||
@interface Object
|
||||
- (id)new;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
|
||||
// RUN: clang-cc --emit-llvm -o %t %s
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
|
||||
// RUN: clang-cc --emit-llvm -o %t %s
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 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
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 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
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 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);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
|
||||
// RUN: clang-cc --emit-llvm -o %t %s
|
||||
|
||||
__attribute__((visibility("hidden")))
|
||||
@interface Hidden
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// 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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
|
||||
// RUN: clang-cc --emit-llvm -o %t %s
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
|
||||
// RUN: clang-cc --emit-llvm -o %t %s
|
||||
|
||||
@interface Object
|
||||
- (id) new;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 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;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 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;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 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
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 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;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 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
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 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
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 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
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
|
||||
// RUN: clang-cc -emit-llvm -o %t %s
|
||||
|
||||
@interface Object
|
||||
- (id) new;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
|
||||
// RUN: clang-cc -emit-llvm -o %t %s
|
||||
|
||||
typedef struct {
|
||||
unsigned f0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
|
||||
// RUN: clang-cc --emit-llvm -o %t %s
|
||||
|
||||
@protocol NSObject
|
||||
- (void *)description;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
|
||||
// RUN: clang-cc -emit-llvm -o %t %s
|
||||
|
||||
@interface Object
|
||||
- (id) new;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang-cc -fnext-runtime --emit-llvm -o %t %s
|
||||
// RUN: clang-cc --emit-llvm -o %t %s
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang-cc -fnext-runtime -emit-llvm %s -o %t
|
||||
// RUN: clang-cc -emit-llvm %s -o %t
|
||||
|
||||
void p(const char*, ...);
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 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);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang-cc -fnext-runtime -emit-llvm -o %t %s
|
||||
// RUN: clang-cc -emit-llvm -o %t %s
|
||||
|
||||
@interface SUPER
|
||||
+ (void)Meth;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 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 {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// 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;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 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"
|
||||
|
|
|
@ -83,19 +83,15 @@
|
|||
// 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
|
||||
|
|
|
@ -540,11 +540,6 @@ static llvm::cl::opt<bool>
|
|||
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"));
|
||||
|
@ -1268,9 +1263,7 @@ void clang::InitializeLangOptions(LangOptions &Options,
|
|||
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())
|
||||
|
|
Загрузка…
Ссылка в новой задаче