[PATCH] [Mips] Generate warning for invalid combination of '-mnan' and '-march' options.
Vladimir Radosavljevic
vladimir.radosavljevic at rt-rk.com
Wed Apr 8 02:07:22 PDT 2015
================
Comment at: lib/Driver/Tools.cpp:1119-1121
@@ +1118,5 @@
+ if (Val == "2008") {
+ if (mips::getSupportedNanEncoding(CPUName) & mips::Nan2008) {
+ Features.push_back("+nan2008");
+ } else {
+ Features.push_back("-nan2008");
----------------
dsanders wrote:
> Style nit: Unecessary braces around single-line if-statement.
Done.
================
Comment at: lib/Driver/Tools.cpp:1126-1128
@@ +1125,5 @@
+ } else if (Val == "legacy") {
+ if (mips::getSupportedNanEncoding(CPUName) & mips::NanLegacy) {
+ Features.push_back("-nan2008");
+ } else {
+ Features.push_back("+nan2008");
----------------
dsanders wrote:
> Style nit: Unecessary braces around single-line if-statement.
Done.
================
Comment at: test/Preprocessor/init.c:4419
@@ -4418,3 +4418,1 @@
//
-// RUN: %clang_cc1 -target-feature +nan2008 \
-// RUN: -E -dM -triple=mips-none-none < /dev/null \
----------------
atanasyan wrote:
> vradosavljevic wrote:
> > atanasyan wrote:
> > > By the way, why do you decide to remove that test at all? Does it fail now?
> > It doesn't fail now, but is wrong to pass +nan2008 with the default cpu (mips32r2), because mips32r2 architecture is on the legacy-only list.
> Let's pass a correct set of arguments and check that +nan2008 switches on the __mips_nan2008 macro. And maybe additionally check that -nan2008 with the same options switches the macro off.
Done.
http://reviews.llvm.org/D8170
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the cfe-commits
mailing list