[PATCH] D134790: [Driver] Add --config= as canonical spelling of --config

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 27 23:06:32 PDT 2022


MaskRay updated this revision to Diff 463427.
MaskRay added a comment.

.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134790/new/

https://reviews.llvm.org/D134790

Files:
  clang/docs/UsersManual.rst
  clang/include/clang/Driver/Options.td
  clang/test/Driver/config-file.c


Index: clang/test/Driver/config-file.c
===================================================================
--- clang/test/Driver/config-file.c
+++ clang/test/Driver/config-file.c
@@ -8,6 +8,7 @@
 //--- Config file (full path) in output of -###
 //
 // RUN: %clang --config %S/Inputs/config-1.cfg -S %s -### 2>&1 | FileCheck %s -check-prefix CHECK-HHH
+// RUN: %clang --config=%S/Inputs/config-1.cfg -S %s -### 2>&1 | FileCheck %s -check-prefix CHECK-HHH
 // CHECK-HHH: Configuration file: {{.*}}Inputs{{.}}config-1.cfg
 // CHECK-HHH: -Werror
 // CHECK-HHH: -std=c99
Index: clang/include/clang/Driver/Options.td
===================================================================
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -900,8 +900,9 @@
 def client__name : JoinedOrSeparate<["-"], "client_name">;
 def combine : Flag<["-", "--"], "combine">, Flags<[NoXarchOption, Unsupported]>;
 def compatibility__version : JoinedOrSeparate<["-"], "compatibility_version">;
-def config : Separate<["--"], "config">, Flags<[NoXarchOption, CoreOption]>,
-  HelpText<"Specifies configuration file">;
+def config : Joined<["--"], "config=">, Flags<[NoXarchOption, CoreOption]>, MetaVarName<"<file>">,
+  HelpText<"Specify configuration file">;
+def : Separate<["--"], "config">, Alias<config>;
 def no_default_config : Flag<["--"], "no-default-config">, Flags<[NoXarchOption, CoreOption]>,
   HelpText<"Disable loading default configuration files">;
 def config_system_dir_EQ : Joined<["--"], "config-system-dir=">, Flags<[NoXarchOption, CoreOption, HelpHidden]>,
Index: clang/docs/UsersManual.rst
===================================================================
--- clang/docs/UsersManual.rst
+++ clang/docs/UsersManual.rst
@@ -887,14 +887,14 @@
 from default locations. If both variants are present, the default configuration
 files are loaded first.
 
-The command line option ``--config`` can be used to specify explicit
+The command line option ``--config=`` can be used to specify explicit
 configuration files in a Clang invocation. If the option is used multiple times,
 all specified files are loaded, in order. For example:
 
 ::
 
-    clang --config /home/user/cfgs/testing.txt
-    clang --config debug.cfg --config runtimes.cfg
+    clang --config=/home/user/cfgs/testing.txt
+    clang --config=debug.cfg --config=runtimes.cfg
 
 If the provided argument contains a directory separator, it is considered as
 a file path, and options are read from that file. Otherwise the argument is
@@ -966,7 +966,7 @@
 In cases where a configuration file is deployed alongside SDK contents, the
 SDK directory can remain fully portable by using ``<CFGDIR>`` prefixed paths.
 In this way, the user may only need to specify a root configuration file with
-``--config`` to establish every aspect of the SDK with the compiler:
+``--config=`` to establish every aspect of the SDK with the compiler:
 
 ::
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134790.463427.patch
Type: text/x-patch
Size: 2933 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220928/a4c36dd2/attachment.bin>


More information about the cfe-commits mailing list