[PATCH] D109621: [clang][Driver] Default to loading clang.cfg if config file not specified

2022-06-18 Thread Matthew Smith via Phabricator via cfe-commits
asymptotically updated this revision to Diff 438106.
asymptotically added a comment.
Herald added a subscriber: MaskRay.
Herald added a project: All.

Updated users' manual following Arfrever's feedback.


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

https://reviews.llvm.org/D109621

Files:
  clang/docs/UsersManual.rst
  clang/lib/Driver/Driver.cpp


Index: clang/lib/Driver/Driver.cpp
===
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -1032,7 +1032,7 @@
 CfgFileName = ClangNameParts.TargetPrefix + '-' + 
ClangNameParts.ModeSuffix;
 
   if (CfgFileName.empty())
-return false;
+CfgFileName = "clang";
 
   // Determine architecture part of the file name, if it is present.
   StringRef CfgFileArch = CfgFileName;
Index: clang/docs/UsersManual.rst
===
--- clang/docs/UsersManual.rst
+++ clang/docs/UsersManual.rst
@@ -876,8 +876,9 @@
 
 Another way to specify a configuration file is to encode it in executable name.
 For example, if the Clang executable is named `armv7l-clang` (it may be a
-symbolic link to `clang`), then Clang will search for file `armv7l.cfg` in the
-directory where Clang resides.
+symbolic link to `clang`), then Clang will search for file `armv7l-clang.cfg` 
in
+the directories mentioned above. If the executable is named `clang`, the Clang
+will attempt to load the configuration file named `clang.cfg`.
 
 If a driver mode is specified in invocation, Clang tries to find a file 
specific
 for the specified mode. For example, if the executable file is named


Index: clang/lib/Driver/Driver.cpp
===
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -1032,7 +1032,7 @@
 CfgFileName = ClangNameParts.TargetPrefix + '-' + ClangNameParts.ModeSuffix;
 
   if (CfgFileName.empty())
-return false;
+CfgFileName = "clang";
 
   // Determine architecture part of the file name, if it is present.
   StringRef CfgFileArch = CfgFileName;
Index: clang/docs/UsersManual.rst
===
--- clang/docs/UsersManual.rst
+++ clang/docs/UsersManual.rst
@@ -876,8 +876,9 @@
 
 Another way to specify a configuration file is to encode it in executable name.
 For example, if the Clang executable is named `armv7l-clang` (it may be a
-symbolic link to `clang`), then Clang will search for file `armv7l.cfg` in the
-directory where Clang resides.
+symbolic link to `clang`), then Clang will search for file `armv7l-clang.cfg` in
+the directories mentioned above. If the executable is named `clang`, the Clang
+will attempt to load the configuration file named `clang.cfg`.
 
 If a driver mode is specified in invocation, Clang tries to find a file specific
 for the specified mode. For example, if the executable file is named
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D109621: [clang][Driver] Default to loading clang.cfg if config file not specified

2021-09-10 Thread Matthew Smith via Phabricator via cfe-commits
asymptotically created this revision.
asymptotically added reviewers: rsmith, sepavloff.
asymptotically added a project: clang.
asymptotically requested review of this revision.
Herald added a subscriber: cfe-commits.

If a configuration file is not supplied (either via the driver name or through 
the `--config` parameter), default to using `clang.cfg`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109621

Files:
  clang/docs/UsersManual.rst
  clang/lib/Driver/Driver.cpp


Index: clang/lib/Driver/Driver.cpp
===
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -908,7 +908,7 @@
 CfgFileName = ClangNameParts.TargetPrefix + '-' + 
ClangNameParts.ModeSuffix;
 
   if (CfgFileName.empty())
-return false;
+CfgFileName = "clang";
 
   // Determine architecture part of the file name, if it is present.
   StringRef CfgFileArch = CfgFileName;
Index: clang/docs/UsersManual.rst
===
--- clang/docs/UsersManual.rst
+++ clang/docs/UsersManual.rst
@@ -875,7 +875,8 @@
 Another way to specify a configuration file is to encode it in executable name.
 For example, if the Clang executable is named `armv7l-clang` (it may be a
 symbolic link to `clang`), then Clang will search for file `armv7l.cfg` in the
-directory where Clang resides.
+directories mentioned above. If the executable is named `clang`, the Clang will
+attempt to load the configuration file named `clang.cfg`.
 
 If a driver mode is specified in invocation, Clang tries to find a file 
specific
 for the specified mode. For example, if the executable file is named


Index: clang/lib/Driver/Driver.cpp
===
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -908,7 +908,7 @@
 CfgFileName = ClangNameParts.TargetPrefix + '-' + ClangNameParts.ModeSuffix;
 
   if (CfgFileName.empty())
-return false;
+CfgFileName = "clang";
 
   // Determine architecture part of the file name, if it is present.
   StringRef CfgFileArch = CfgFileName;
Index: clang/docs/UsersManual.rst
===
--- clang/docs/UsersManual.rst
+++ clang/docs/UsersManual.rst
@@ -875,7 +875,8 @@
 Another way to specify a configuration file is to encode it in executable name.
 For example, if the Clang executable is named `armv7l-clang` (it may be a
 symbolic link to `clang`), then Clang will search for file `armv7l.cfg` in the
-directory where Clang resides.
+directories mentioned above. If the executable is named `clang`, the Clang will
+attempt to load the configuration file named `clang.cfg`.
 
 If a driver mode is specified in invocation, Clang tries to find a file specific
 for the specified mode. For example, if the executable file is named
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits