[clang] 95ae517 - [Driver] Remove CLDXCFlag by allowing CLFlag to specify visibility. NFC

Justin Bogner via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 15 15:01:30 PDT 2023


Author: Justin Bogner
Date: 2023-08-15T15:00:19-07:00
New Revision: 95ae517bb4c332149b3c45cd7d1e6edf8b40077e

URL: https://github.com/llvm/llvm-project/commit/95ae517bb4c332149b3c45cd7d1e6edf8b40077e
DIFF: https://github.com/llvm/llvm-project/commit/95ae517bb4c332149b3c45cd7d1e6edf8b40077e.diff

LOG: [Driver] Remove CLDXCFlag by allowing CLFlag to specify visibility. NFC

Added: 
    

Modified: 
    clang/include/clang/Driver/Options.td

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index e1e543be6e179c..d8d11497ea11e1 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -7603,46 +7603,43 @@ def cl_compile_Group : OptionGroup<"<clang-cl compile-only options>">,
 def cl_ignored_Group : OptionGroup<"<clang-cl ignored options>">,
   Group<cl_Group>;
 
-class CLFlag<string name> : Option<["/", "-"], name, KIND_FLAG>,
-  Group<cl_Group>, Flags<[NoXarchOption]>, Visibility<[CLOption]>;
+class CLFlag<string name, list<OptionVisibility> vis = [CLOption]> :
+  Option<["/", "-"], name, KIND_FLAG>,
+  Group<cl_Group>, Flags<[NoXarchOption]>, Visibility<vis>;
 
-class CLDXCFlag<string name> : Option<["/", "-"], name, KIND_FLAG>,
-  Group<cl_Group>, Flags<[NoXarchOption]>, Visibility<[CLOption, DXCOption]>;
+class CLCompileFlag<string name, list<OptionVisibility> vis = [CLOption]> :
+  Option<["/", "-"], name, KIND_FLAG>,
+  Group<cl_compile_Group>, Flags<[NoXarchOption]>, Visibility<vis>;
 
-class CLCompileFlag<string name> : Option<["/", "-"], name, KIND_FLAG>,
-  Group<cl_compile_Group>, Flags<[NoXarchOption]>, Visibility<[CLOption]>;
+class CLIgnoredFlag<string name, list<OptionVisibility> vis = [CLOption]> :
+  Option<["/", "-"], name, KIND_FLAG>,
+  Group<cl_ignored_Group>, Flags<[NoXarchOption]>, Visibility<vis>;
 
-class CLIgnoredFlag<string name> : Option<["/", "-"], name, KIND_FLAG>,
-  Group<cl_ignored_Group>, Flags<[NoXarchOption]>, Visibility<[CLOption]>;
+class CLJoined<string name, list<OptionVisibility> vis = [CLOption]> :
+  Option<["/", "-"], name, KIND_JOINED>,
+  Group<cl_Group>, Flags<[NoXarchOption]>, Visibility<vis>;
 
-class CLJoined<string name> : Option<["/", "-"], name, KIND_JOINED>,
-  Group<cl_Group>, Flags<[NoXarchOption]>, Visibility<[CLOption]>;
+class CLCompileJoined<string name, list<OptionVisibility> vis = [CLOption]> :
+  Option<["/", "-"], name, KIND_JOINED>,
+  Group<cl_compile_Group>, Flags<[NoXarchOption]>, Visibility<vis>;
 
-class CLDXCJoined<string name> : Option<["/", "-"], name, KIND_JOINED>,
-  Group<cl_Group>, Flags<[NoXarchOption]>, Visibility<[CLOption, DXCOption]>;
+class CLIgnoredJoined<string name, list<OptionVisibility> vis = [CLOption]> :
+  Option<["/", "-"], name, KIND_JOINED>,
+  Group<cl_ignored_Group>, Flags<[NoXarchOption, HelpHidden]>, Visibility<vis>;
 
-class CLCompileJoined<string name> : Option<["/", "-"], name, KIND_JOINED>,
-  Group<cl_compile_Group>, Flags<[NoXarchOption]>, Visibility<[CLOption]>;
+class CLJoinedOrSeparate<string name, list<OptionVisibility> vis = [CLOption]> :
+  Option<["/", "-"], name, KIND_JOINED_OR_SEPARATE>,
+  Group<cl_Group>, Flags<[NoXarchOption]>, Visibility<vis>;
 
-class CLIgnoredJoined<string name> : Option<["/", "-"], name, KIND_JOINED>,
-  Group<cl_ignored_Group>, Flags<[NoXarchOption, HelpHidden]>,
-  Visibility<[CLOption]>;
+class CLCompileJoinedOrSeparate<string name,
+                                list<OptionVisibility> vis = [CLOption]> :
+  Option<["/", "-"], name, KIND_JOINED_OR_SEPARATE>,
+  Group<cl_compile_Group>, Flags<[NoXarchOption]>, Visibility<vis>;
 
-class CLJoinedOrSeparate<string name> : Option<["/", "-"], name,
-  KIND_JOINED_OR_SEPARATE>, Group<cl_Group>, Flags<[NoXarchOption]>,
-  Visibility<[CLOption]>;
-
-class CLDXCJoinedOrSeparate<string name> : Option<["/", "-"], name,
-  KIND_JOINED_OR_SEPARATE>, Group<cl_Group>, Flags<[NoXarchOption]>,
-  Visibility<[CLOption, DXCOption]>;
-
-class CLCompileJoinedOrSeparate<string name> : Option<["/", "-"], name,
-  KIND_JOINED_OR_SEPARATE>, Group<cl_compile_Group>,
-  Flags<[NoXarchOption]>, Visibility<[CLOption]>;
-
-class CLRemainingArgsJoined<string name> : Option<["/", "-"], name,
-  KIND_REMAINING_ARGS_JOINED>, Group<cl_Group>, Flags<[NoXarchOption]>,
-  Visibility<[CLOption]>;
+class CLRemainingArgsJoined<string name,
+                            list<OptionVisibility> vis = [CLOption]> :
+  Option<["/", "-"], name, KIND_REMAINING_ARGS_JOINED>,
+  Group<cl_Group>, Flags<[NoXarchOption]>, Visibility<vis>;
 
 // Aliases:
 // (We don't put any of these in cl_compile_Group as the options they alias are
@@ -7713,7 +7710,7 @@ def _SLASH_help : CLFlag<"help">, Alias<help>,
 def _SLASH_HELP : CLFlag<"HELP">, Alias<help>;
 def _SLASH_hotpatch : CLFlag<"hotpatch">, Alias<fms_hotpatch>,
   HelpText<"Create hotpatchable image">;
-def _SLASH_I : CLDXCJoinedOrSeparate<"I">,
+def _SLASH_I : CLJoinedOrSeparate<"I", [CLOption, DXCOption]>,
   HelpText<"Add directory to include search path">, MetaVarName<"<dir>">,
   Alias<I>;
 def _SLASH_J : CLFlag<"J">, HelpText<"Make char type unsigned">,
@@ -7721,7 +7718,7 @@ def _SLASH_J : CLFlag<"J">, HelpText<"Make char type unsigned">,
 
 // The _SLASH_O option handles all the /O flags, but we also provide separate
 // aliased options to provide separate help messages.
-def _SLASH_O : CLDXCJoined<"O">,
+def _SLASH_O : CLJoined<"O", [CLOption, DXCOption]>,
   HelpText<"Set multiple /O flags at once; e.g. '/O2y-' for '/O2 /Oy-'">,
   MetaVarName<"<flags>">;
 def : CLFlag<"O1">, Alias<_SLASH_O>, AliasArgs<["1"]>,
@@ -7734,7 +7731,7 @@ def : CLFlag<"Ob1">, Alias<_SLASH_O>, AliasArgs<["b1"]>,
   HelpText<"Only inline functions explicitly or implicitly marked inline">;
 def : CLFlag<"Ob2">, Alias<_SLASH_O>, AliasArgs<["b2"]>,
   HelpText<"Inline functions as deemed beneficial by the compiler">;
-def : CLDXCFlag<"Od">, Alias<_SLASH_O>, AliasArgs<["d"]>,
+def : CLFlag<"Od", [CLOption, DXCOption]>, Alias<_SLASH_O>, AliasArgs<["d"]>,
   HelpText<"Disable optimization">;
 def : CLFlag<"Og">, Alias<_SLASH_O>, AliasArgs<["g"]>,
   HelpText<"No effect">;


        


More information about the cfe-commits mailing list