[cfe-commits] r137842 - in /cfe/trunk: lib/Driver/Tools.cpp lib/Driver/Tools.h test/Driver/apple-kext-i386.cpp

Bob Wilson bob.wilson at apple.com
Wed Aug 17 14:44:14 PDT 2011


On Aug 17, 2011, at 11:24 AM, Chad Rosier wrote:

> Author: mcrosier
> Date: Wed Aug 17 13:24:55 2011
> New Revision: 137842
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=137842&view=rev
> Log:
> [driver] Clang doesn't support -mkernel/-fapple-kext for i386, so it's 
> automatically invoking llvm-gcc's cc1plus, which doesn't support all options
> supported by Clang.  Therefore, filter out unsupported options.
> rdar://9964354
> 
> Modified:
>    cfe/trunk/lib/Driver/Tools.cpp
>    cfe/trunk/lib/Driver/Tools.h
>    cfe/trunk/test/Driver/apple-kext-i386.cpp
> 
> Modified: cfe/trunk/lib/Driver/Tools.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=137842&r1=137841&r2=137842&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Driver/Tools.cpp (original)
> +++ cfe/trunk/lib/Driver/Tools.cpp Wed Aug 17 13:24:55 2011
> @@ -2446,6 +2446,18 @@
>   return Args.MakeArgString(Res + ".d");
> }
> 
> +void darwin::CC1::RemoveCC1UnsupportedArgs(ArgStringList &CmdArgs) const {
> +  for (ArgStringList::iterator it = CmdArgs.begin(), ie = CmdArgs.end(); 
> +       it != ie;) {
> +    if (!strcmp(*it, "-Wno-self-assign")) {

All of the unsupported warning options will have both "-W" and "-Wno-" versions.  You'll need to check for both.  Depending on how many of them there are, a table might be nice, if that's convenient.

> +      it = CmdArgs.erase(it);
> +      it = CmdArgs.end();
> +    }
> +    else
> +      ++it;
> +  }

The usual style convention in LLVM is to put the "else" on the same line as the closing brace.  If the "then" clause has braces, as it does here, we usually put braces around the "else" clause even when it's a single statement.






More information about the cfe-commits mailing list