diff options
author | Bob Wilson <bob.wilson@apple.com> | 2012-02-07 01:17:55 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2012-02-07 01:17:55 +0000 |
commit | 2872c8d5465623c1207b17873f228f5d96038d5e (patch) | |
tree | f65d605d1baa8d59cf5fa7b7f944772645257649 /lib/Driver/Tools.cpp | |
parent | 88ce85fa4f397e02084b07f221df5944bbf6d456 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149951 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index ef065e8fc0..714a21a61a 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -3003,13 +3003,27 @@ void darwin::CC1::RemoveCC1UnsupportedArgs(ArgStringList &CmdArgs) const { 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) |