[PATCH] D13229: Add -Wc, option

don hinton via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 28 14:54:53 PDT 2015


hintonda created this revision.
hintonda added a subscriber: cfe-commits.

Add -Wc,<arg> option (similar to -Wl,<arg>) to go along with -Xclang.  This makes it easier to pass multiple options to cc1.

http://reviews.llvm.org/D13229

Files:
  include/clang/Driver/Options.td
  lib/Driver/Tools.cpp

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();
 
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<W_Group>, Flags<[CC1Option]>;
 def Wno_deprecated : Flag<["-"], "Wno-deprecated">, Group<W_Group>, Flags<[CC1Option]>;
 def Wextra : Flag<["-"], "Wextra">, Group<W_Group>, Flags<[CC1Option]>;
+def Wc_COMMA : CommaJoined<["-"], "Wc,">, Flags<[DriverOption, CoreOption]>,
+  HelpText<"Pass the comma separated arguments in <arg> to the clang compiler">,
+  MetaVarName<"<arg>">;
 def Wl_COMMA : CommaJoined<["-"], "Wl,">, Flags<[LinkerInput, RenderAsInput]>,
   HelpText<"Pass the comma separated arguments in <arg> to the linker">,
   MetaVarName<"<arg>">;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13229.35911.patch
Type: text/x-patch
Size: 1412 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150928/0fa48991/attachment.bin>


More information about the cfe-commits mailing list