[PATCH] D13100: [mips] Separated mips specific -Wa options, so that they are not checked on other platforms.

Scott Egerton via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 23 07:55:42 PDT 2015


s.egerton created this revision.
s.egerton added reviewers: dsanders, vkalintiris.
s.egerton added a subscriber: cfe-commits.

This is a follow on to post review comments on revision r248276.

http://reviews.llvm.org/D13100

Files:
  lib/Driver/Tools.cpp

Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -2351,6 +2351,11 @@
         continue;
       }
 
+      bool IsMips = C.getDefaultToolChain().getArch() == llvm::Triple::mips ||
+                    C.getDefaultToolChain().getArch() == llvm::Triple::mipsel ||
+                    C.getDefaultToolChain().getArch() == llvm::Triple::mips64 ||
+                    C.getDefaultToolChain().getArch() == llvm::Triple::mips64el;
+
       if (Value == "-force_cpusubtype_ALL") {
         // Do nothing, this is the default and we don't support anything else.
       } else if (Value == "-L") {
@@ -2376,16 +2381,16 @@
       } else if (Value.startswith("-mcpu") || Value.startswith("-mfpu") ||
                  Value.startswith("-mhwdiv") || Value.startswith("-march")) {
         // Do nothing, we'll validate it later.
-      } else if (Value == "--trap") {
+      } else if (IsMips && Value == "--trap") {
         CmdArgs.push_back("-target-feature");
         CmdArgs.push_back("+use-tcc-in-div");
-      } else if (Value == "--break") {
+      } else if (IsMips && Value == "--break") {
         CmdArgs.push_back("-target-feature");
         CmdArgs.push_back("-use-tcc-in-div");
-      } else if (Value.startswith("-msoft-float")) {
+      } else if (IsMips && Value.startswith("-msoft-float")) {
         CmdArgs.push_back("-target-feature");
         CmdArgs.push_back("+soft-float");
-      } else if (Value.startswith("-mhard-float")) {
+      } else if (IsMips && Value.startswith("-mhard-float")) {
         CmdArgs.push_back("-target-feature");
         CmdArgs.push_back("-soft-float");
       } else {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13100.35502.patch
Type: text/x-patch
Size: 1715 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150923/f6c42ff6/attachment.bin>


More information about the cfe-commits mailing list