Index: include/clang/Driver/Options.td =================================================================== --- include/clang/Driver/Options.td +++ include/clang/Driver/Options.td @@ -298,6 +298,9 @@ def Wdeprecated : Flag<["-"], "Wdeprecated">, Group, Flags<[CC1Option]>; def Wno_deprecated : Flag<["-"], "Wno-deprecated">, Group, Flags<[CC1Option]>; def Wextra : Flag<["-"], "Wextra">, Group, Flags<[CC1Option]>; +def Wc_COMMA : CommaJoined<["-"], "Wc,">, Flags<[DriverOption, CoreOption]>, + HelpText<"Pass the comma separated arguments in to the clang compiler">, + MetaVarName<"">; def Wl_COMMA : CommaJoined<["-"], "Wl,">, Flags<[LinkerInput, RenderAsInput]>, HelpText<"Pass the comma separated arguments in to the linker">, MetaVarName<"">; Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -5080,9 +5080,9 @@ A->claim(); } - // Forward -Xclang arguments to -cc1, and -mllvm arguments to the LLVM option - // parser. - Args.AddAllArgValues(CmdArgs, options::OPT_Xclang); + // Forward -Xclang, and -Wc, arguments to -cc1, and -mllvm arguments to the + // LLVM option parser. + Args.AddAllArgValues(CmdArgs, options::OPT_Xclang, options::OPT_Wc_COMMA); for (const Arg *A : Args.filtered(options::OPT_mllvm)) { A->claim();