From 7ecbd32e4ee21ca01100287bd604f83308e894e7 Mon Sep 17 00:00:00 2001 From: Bob Wilson Date: Tue, 7 Feb 2012 01:17:55 +0000 Subject: Filter a few more options not recognized by gcc. These are new options that gcc doesn't recognize so the clang driver needs to remove them when it falls back to invoking gcc. llvm-svn: 149951 --- clang/lib/Driver/Tools.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'clang/lib/Driver/Tools.cpp') diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index ef065e8fc03..714a21a61a3 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/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(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(Option) -- cgit v1.2.3