forked from OSchip/llvm-project
Switch -f{builtin,math-errno,rtti} and -analyzer-purge-dead to -...no... variants instead of using llvm:🆑:init(true) arguments.
llvm-svn: 89315
This commit is contained in:
parent
71f5f9ff7f
commit
484afa2d3b
|
@ -779,12 +779,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
break;
|
||||
}
|
||||
|
||||
if (Args.hasFlag(options::OPT_fmath_errno,
|
||||
// -fmath-errno is default.
|
||||
if (!Args.hasFlag(options::OPT_fmath_errno,
|
||||
options::OPT_fno_math_errno,
|
||||
getToolChain().IsMathErrnoDefault()))
|
||||
CmdArgs.push_back("--fmath-errno=1");
|
||||
else
|
||||
CmdArgs.push_back("--fmath-errno=0");
|
||||
CmdArgs.push_back("-fno-math-errno");
|
||||
|
||||
if (Arg *A = Args.getLastArg(options::OPT_flimited_precision_EQ)) {
|
||||
CmdArgs.push_back("--limit-float-precision");
|
||||
|
@ -923,7 +922,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
|
||||
// -fbuiltin is default.
|
||||
if (!Args.hasFlag(options::OPT_fbuiltin, options::OPT_fno_builtin))
|
||||
CmdArgs.push_back("-fbuiltin=0");
|
||||
CmdArgs.push_back("-fno-builtin");
|
||||
|
||||
// -fblocks=0 is default.
|
||||
if (Args.hasFlag(options::OPT_fblocks, options::OPT_fno_blocks,
|
||||
|
@ -939,7 +938,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
|
||||
// -frtti is default.
|
||||
if (!Args.hasFlag(options::OPT_frtti, options::OPT_fno_rtti))
|
||||
CmdArgs.push_back("-frtti=0");
|
||||
CmdArgs.push_back("-fno-rtti");
|
||||
|
||||
// -fsigned-char is default.
|
||||
if (!Args.hasFlag(options::OPT_fsigned_char,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// RUN: clang-cc -triple i386-apple-darwin10 -analyze -analyzer-experimental-internal-checks -std=gnu99 -checker-cfref -verify %s -analyzer-constraints=basic -analyzer-store=basic
|
||||
// RUN: clang-cc -triple i386-apple-darwin10 -analyze -analyzer-experimental-internal-checks -std=gnu99 -checker-cfref -verify %s -analyzer-constraints=range -analyzer-store=basic
|
||||
// RUN: clang-cc -triple i386-apple-darwin10 -analyze -analyzer-experimental-internal-checks -std=gnu99 -checker-cfref -analyzer-store=region -analyzer-constraints=range -analyzer-purge-dead=false -verify %s
|
||||
// RUN: clang-cc -triple i386-apple-darwin10 -analyze -analyzer-experimental-internal-checks -std=gnu99 -checker-cfref -analyzer-store=region -analyzer-constraints=range -analyzer-no-purge-dead -verify %s
|
||||
// RUN: clang-cc -triple i386-apple-darwin10 -analyze -analyzer-experimental-internal-checks -std=gnu99 -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
|
||||
|
||||
typedef unsigned uintptr_t;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// RUN: clang-cc -fmath-errno=1 -emit-llvm -o %t %s -triple i386-unknown-unknown
|
||||
// RUN: clang-cc -emit-llvm -o %t %s -triple i386-unknown-unknown
|
||||
// RUN: grep "declare " %t | count 6
|
||||
// RUN: grep "declare " %t | grep "@llvm." | count 1
|
||||
// RUN: clang-cc -fmath-errno=0 -emit-llvm -o %t %s -triple i386-unknown-unknown
|
||||
// RUN: clang-cc -fno-math-errno -emit-llvm -o %t %s -triple i386-unknown-unknown
|
||||
// RUN: grep "declare " %t | count 6
|
||||
// RUN: grep "declare " %t | grep -v "@llvm." | count 0
|
||||
|
||||
|
|
|
@ -6,4 +6,4 @@
|
|||
|
||||
// CHECK: "-analyze"
|
||||
// CHECK: "-target-feature" "+sse"
|
||||
// CHECK: "--fmath-errno=0"
|
||||
// CHECK: "-fno-math-errno"
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
// RUN: grep '"--relocation-model" "static"' %t.log
|
||||
// RUN: grep '"--disable-fp-elim"' %t.log
|
||||
// RUN: grep '"--unwind-tables=0"' %t.log
|
||||
// RUN: grep '"--fmath-errno=1"' %t.log
|
||||
// RUN: grep '"-Os"' %t.log
|
||||
// RUN: grep '"-o" .*clang-translation.*' %t.log
|
||||
// RUN: grep '"--asm-verbose"' %t.log
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
// RUN: clang -### -S -x c /dev/null -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fno-math-errno -fno-common -fno-pascal-strings -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings %s 2> %t
|
||||
// RUN: grep -F '"-fblocks"' %t
|
||||
// RUN: grep -F '"--fmath-errno=1"' %t
|
||||
// RUN: grep -F '"-fpascal-strings"' %t
|
||||
// RUN: clang -### -S -x c /dev/null -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fno-math-errno -fno-common -fno-pascal-strings -fno-show-source-location -fshort-wchar %s 2> %t
|
||||
// RUN: grep -F '"-fbuiltin=0"' %t
|
||||
// RUN: grep -F '"-fno-builtin"' %t
|
||||
// RUN: grep -F '"-fno-common"' %t
|
||||
// RUN: grep -F '"--fmath-errno=0"' %t
|
||||
// RUN: grep -F '"-fno-math-errno"' %t
|
||||
// RUN: grep -F '"-fno-show-source-location"' %t
|
||||
// RUN: grep -F '"-fshort-wchar"' %t
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: clang-cc -fsyntax-only -verify -fmath-errno=0 %s
|
||||
// RUN: clang-cc -fsyntax-only -verify -fno-math-errno %s
|
||||
|
||||
int foo(int X, int Y);
|
||||
|
||||
|
|
|
@ -104,8 +104,7 @@ EagerlyAssume("analyzer-eagerly-assume",
|
|||
"symbolic constraints"));
|
||||
|
||||
static llvm::cl::opt<bool>
|
||||
PurgeDead("analyzer-purge-dead",
|
||||
llvm::cl::init(true),
|
||||
NoPurgeDead("analyzer-no-purge-dead",
|
||||
llvm::cl::desc("Remove dead symbols, bindings, and constraints before"
|
||||
" processing a statement"));
|
||||
|
||||
|
@ -440,8 +439,8 @@ TimeReport("ftime-report",
|
|||
namespace langoptions {
|
||||
|
||||
static llvm::cl::opt<bool>
|
||||
AllowBuiltins("fbuiltin", llvm::cl::init(true),
|
||||
llvm::cl::desc("Disable implicit builtin knowledge of functions"));
|
||||
NoBuiltin("fno-builtin",
|
||||
llvm::cl::desc("Disable implicit builtin knowledge of functions"));
|
||||
|
||||
static llvm::cl::opt<bool>
|
||||
AltiVec("faltivec", llvm::cl::desc("Enable AltiVec vector initializer syntax"));
|
||||
|
@ -532,7 +531,7 @@ MainFileName("main-file-name",
|
|||
llvm::cl::desc("Main file name to use for debug info"));
|
||||
|
||||
static llvm::cl::opt<bool>
|
||||
MathErrno("fmath-errno", llvm::cl::init(true),
|
||||
NoMathErrno("fno-math-errno",
|
||||
llvm::cl::desc("Require math functions to respect errno"));
|
||||
|
||||
static llvm::cl::opt<bool>
|
||||
|
@ -590,7 +589,7 @@ PascalStrings("fpascal-strings",
|
|||
"string literals"));
|
||||
|
||||
static llvm::cl::opt<bool>
|
||||
Rtti("frtti", llvm::cl::init(true),
|
||||
NoRtti("fno-rtti",
|
||||
llvm::cl::desc("Enable generation of rtti information"));
|
||||
|
||||
static llvm::cl::opt<bool>
|
||||
|
@ -786,7 +785,7 @@ void clang::InitializeAnalyzerOptions(AnalyzerOptions &Opts) {
|
|||
Opts.VisualizeEGUbi = VisualizeEGUbi;
|
||||
Opts.AnalyzeAll = AnalyzeAll;
|
||||
Opts.AnalyzerDisplayProgress = AnalyzerDisplayProgress;
|
||||
Opts.PurgeDead = PurgeDead;
|
||||
Opts.PurgeDead = !NoPurgeDead;
|
||||
Opts.EagerlyAssume = EagerlyAssume;
|
||||
Opts.AnalyzeSpecificFunction = AnalyzeSpecificFunction;
|
||||
Opts.EnableExperimentalChecks = AnalyzerExperimentalChecks;
|
||||
|
@ -1224,7 +1223,7 @@ void clang::InitializeLangOptions(LangOptions &Options,
|
|||
if (NoLaxVectorConversions.getPosition())
|
||||
Options.LaxVectorConversions = 0;
|
||||
Options.Exceptions = Exceptions;
|
||||
Options.Rtti = Rtti;
|
||||
Options.Rtti = !NoRtti;
|
||||
if (EnableBlocks.getPosition())
|
||||
Options.Blocks = EnableBlocks;
|
||||
if (CharIsSigned.getPosition())
|
||||
|
@ -1232,8 +1231,7 @@ void clang::InitializeLangOptions(LangOptions &Options,
|
|||
if (ShortWChar.getPosition())
|
||||
Options.ShortWChar = ShortWChar;
|
||||
|
||||
if (!AllowBuiltins)
|
||||
Options.NoBuiltin = 1;
|
||||
Options.NoBuiltin = NoBuiltin;
|
||||
if (Freestanding)
|
||||
Options.Freestanding = Options.NoBuiltin = 1;
|
||||
|
||||
|
@ -1248,7 +1246,7 @@ void clang::InitializeLangOptions(LangOptions &Options,
|
|||
// OpenCL and C++ both have bool, true, false keywords.
|
||||
Options.Bool = Options.OpenCL | Options.CPlusPlus;
|
||||
|
||||
Options.MathErrno = MathErrno;
|
||||
Options.MathErrno = !NoMathErrno;
|
||||
|
||||
Options.InstantiationDepth = TemplateDepth;
|
||||
|
||||
|
|
Loading…
Reference in New Issue