r179309 - Add a new -mimplicit-float option for symmetry with -mno-implicit-float.
Bob Wilson
bob.wilson at apple.com
Thu Apr 11 11:53:25 PDT 2013
Author: bwilson
Date: Thu Apr 11 13:53:25 2013
New Revision: 179309
URL: http://llvm.org/viewvc/llvm-project?rev=179309&view=rev
Log:
Add a new -mimplicit-float option for symmetry with -mno-implicit-float.
This new option is the default, but it is useful to have a flag to override
-mno-implicit-float by putting -mimplicit-float later on the command line.
Modified:
cfe/trunk/include/clang/Driver/Options.td
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/flags.c
Modified: cfe/trunk/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=179309&r1=179308&r2=179309&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Thu Apr 11 13:53:25 2013
@@ -930,6 +930,7 @@ def msoft_float : Flag<["-"], "msoft-flo
HelpText<"Use software floating point">;
def mno_implicit_float : Flag<["-"], "mno-implicit-float">, Group<m_Group>,
HelpText<"Don't generate implicit floating point instructions">;
+def mimplicit_float : Flag<["-"], "mimplicit-float">, Group<m_Group>;
def msse2 : Flag<["-"], "msse2">, Group<m_x86_Features_Group>;
def msse3 : Flag<["-"], "msse3">, Group<m_x86_Features_Group>;
def msse4a : Flag<["-"], "msse4a">, Group<m_x86_Features_Group>;
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=179309&r1=179308&r2=179309&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Thu Apr 11 13:53:25 2013
@@ -815,7 +815,9 @@ void Clang::AddARMTargetArgs(const ArgLi
CmdArgs.push_back("-mno-global-merge");
}
- if (Args.hasArg(options::OPT_mno_implicit_float))
+ if (!Args.hasFlag(options::OPT_mimplicit_float,
+ options::OPT_mno_implicit_float,
+ true))
CmdArgs.push_back("-no-implicit-float");
}
@@ -1255,6 +1257,7 @@ void Clang::AddX86TargetArgs(const ArgLi
Args.hasArg(options::OPT_fapple_kext));
if (Arg *A = Args.getLastArg(options::OPT_msoft_float,
options::OPT_mno_soft_float,
+ options::OPT_mimplicit_float,
options::OPT_mno_implicit_float)) {
const Option &O = A->getOption();
NoImplicitFloat = (O.matches(options::OPT_mno_implicit_float) ||
Modified: cfe/trunk/test/Driver/flags.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/flags.c?rev=179309&r1=179308&r2=179309&view=diff
==============================================================================
--- cfe/trunk/test/Driver/flags.c (original)
+++ cfe/trunk/test/Driver/flags.c Thu Apr 11 13:53:25 2013
@@ -10,6 +10,9 @@
// RUN: %clang -target i386-apple-darwin9 -### -S -mno-implicit-float %s 2>&1 | FileCheck -check-prefix=TEST4 %s
// TEST4: "-no-implicit-float"
+// RUN: %clang -target i386-apple-darwin9 -### -S -mno-implicit-float -mimplicit-float %s 2>&1 | FileCheck -check-prefix=TEST4A %s
+// TEST4A-NOT: "-no-implicit-float"
+
// RUN: %clang -target i386-apple-darwin9 -### -S -mkernel %s 2>&1 | FileCheck -check-prefix=TEST5 %s
// TEST5: "-no-implicit-float"
@@ -18,3 +21,6 @@
// RUN: %clang -target armv7-apple-darwin10 -### -S -mno-implicit-float %s 2>&1 | FileCheck -check-prefix=TEST7 %s
// TEST7: "-no-implicit-float"
+
+// RUN: %clang -target armv7-apple-darwin10 -### -S -mno-implicit-float -mimplicit-float %s 2>&1 | FileCheck -check-prefix=TEST8 %s
+// TEST8-NOT: "-no-implicit-float"
More information about the cfe-commits
mailing list