[cfe-commits] r89315 - in /cfe/trunk: lib/Driver/Tools.cpp test/Analysis/null-deref-ps.c test/CodeGen/libcalls.c test/Driver/analyze.c test/Driver/clang-translation.c test/Driver/clang_f_opts.c test/Sema/unused-expr.c tools/clang-cc/Options.cpp
Daniel Dunbar
daniel at zuster.org
Wed Nov 18 20:55:23 PST 2009
Author: ddunbar
Date: Wed Nov 18 22:55:23 2009
New Revision: 89315
URL: http://llvm.org/viewvc/llvm-project?rev=89315&view=rev
Log:
Switch -f{builtin,math-errno,rtti} and -analyzer-purge-dead to -...no... variants instead of using llvm::cl::init(true) arguments.
Modified:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Analysis/null-deref-ps.c
cfe/trunk/test/CodeGen/libcalls.c
cfe/trunk/test/Driver/analyze.c
cfe/trunk/test/Driver/clang-translation.c
cfe/trunk/test/Driver/clang_f_opts.c
cfe/trunk/test/Sema/unused-expr.c
cfe/trunk/tools/clang-cc/Options.cpp
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=89315&r1=89314&r2=89315&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Nov 18 22:55:23 2009
@@ -779,12 +779,11 @@
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 @@
// -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 @@
// -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,
Modified: cfe/trunk/test/Analysis/null-deref-ps.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/null-deref-ps.c?rev=89315&r1=89314&r2=89315&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/null-deref-ps.c (original)
+++ cfe/trunk/test/Analysis/null-deref-ps.c Wed Nov 18 22:55:23 2009
@@ -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;
Modified: cfe/trunk/test/CodeGen/libcalls.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/libcalls.c?rev=89315&r1=89314&r2=89315&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/libcalls.c (original)
+++ cfe/trunk/test/CodeGen/libcalls.c Wed Nov 18 22:55:23 2009
@@ -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
Modified: cfe/trunk/test/Driver/analyze.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/analyze.c?rev=89315&r1=89314&r2=89315&view=diff
==============================================================================
--- cfe/trunk/test/Driver/analyze.c (original)
+++ cfe/trunk/test/Driver/analyze.c Wed Nov 18 22:55:23 2009
@@ -6,4 +6,4 @@
// CHECK: "-analyze"
// CHECK: "-target-feature" "+sse"
-// CHECK: "--fmath-errno=0"
+// CHECK: "-fno-math-errno"
Modified: cfe/trunk/test/Driver/clang-translation.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/clang-translation.c?rev=89315&r1=89314&r2=89315&view=diff
==============================================================================
--- cfe/trunk/test/Driver/clang-translation.c (original)
+++ cfe/trunk/test/Driver/clang-translation.c Wed Nov 18 22:55:23 2009
@@ -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
Modified: cfe/trunk/test/Driver/clang_f_opts.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/clang_f_opts.c?rev=89315&r1=89314&r2=89315&view=diff
==============================================================================
--- cfe/trunk/test/Driver/clang_f_opts.c (original)
+++ cfe/trunk/test/Driver/clang_f_opts.c Wed Nov 18 22:55:23 2009
@@ -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
Modified: cfe/trunk/test/Sema/unused-expr.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/unused-expr.c?rev=89315&r1=89314&r2=89315&view=diff
==============================================================================
--- cfe/trunk/test/Sema/unused-expr.c (original)
+++ cfe/trunk/test/Sema/unused-expr.c Wed Nov 18 22:55:23 2009
@@ -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);
Modified: cfe/trunk/tools/clang-cc/Options.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/Options.cpp?rev=89315&r1=89314&r2=89315&view=diff
==============================================================================
--- cfe/trunk/tools/clang-cc/Options.cpp (original)
+++ cfe/trunk/tools/clang-cc/Options.cpp Wed Nov 18 22:55:23 2009
@@ -104,8 +104,7 @@
"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 @@
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 @@
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 @@
"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 @@
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 @@
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 @@
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 @@
// OpenCL and C++ both have bool, true, false keywords.
Options.Bool = Options.OpenCL | Options.CPlusPlus;
- Options.MathErrno = MathErrno;
+ Options.MathErrno = !NoMathErrno;
Options.InstantiationDepth = TemplateDepth;
More information about the cfe-commits
mailing list