[cfe-commits] r149951 - /cfe/trunk/lib/Driver/Tools.cpp

Bob Wilson bob.wilson at apple.com
Mon Feb 6 17:17:56 PST 2012


Author: bwilson
Date: Mon Feb  6 19:17:55 2012
New Revision: 149951

URL: http://llvm.org/viewvc/llvm-project?rev=149951&view=rev
Log:
Filter a few more options not recognized by gcc.  <rdar://problem/10814020>

These are new options that gcc doesn't recognize so the clang driver needs
to remove them when it falls back to invoking gcc.

Modified:
    cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=149951&r1=149950&r2=149951&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Mon Feb  6 19:17:55 2012
@@ -3003,13 +3003,27 @@
     StringRef Option = *it;
     bool RemoveOption = false;
 
-    // Remove -faltivec
-    if (Option.equals("-faltivec")) {
-      it = CmdArgs.erase(it);
+    // Erase both -fmodule-cache-path and its argument.
+    if (Option.equals("-fmodule-cache-path") && it+2 != ie) {
+      it = CmdArgs.erase(it, it+2);
       ie = CmdArgs.end();
       continue;
     }
 
+    // Remove unsupported -f options.
+    if (Option.startswith("-f")) {
+      // Remove -f/-fno- to reduce the number of cases.
+      if (Option.startswith("-fno-"))
+        Option = Option.substr(5);
+      else
+        Option = Option.substr(2);
+      RemoveOption = llvm::StringSwitch<bool>(Option)
+        .Case("altivec", true)
+        .Case("modules", true)
+        .Case("diagnostics-show-note-include-stack", true)
+        .Default(false);
+    }
+
     // Handle machine specific options.
     if (Option.startswith("-m")) {
       RemoveOption = llvm::StringSwitch<bool>(Option)





More information about the cfe-commits mailing list