[PATCH] D24933: Enable configuration files in clang

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 16 14:44:24 PST 2016


rsmith added inline comments.


================
Comment at: docs/UsersManual.rst:655-656
+
+Command line option `--config` can be used to specify configuration file in
+a clang invocation. For instance:
+
----------------
Rather than inventing a new mechanism, could we extend our existing `@file` facility to support comments and nested inclusion of further `@file`s?


================
Comment at: docs/UsersManual.rst:667
+extension `cfg` if it is not specified yet, and the obtained file name is searched
+for in the directories: `~/.llvm` and the directory where clang executable resides.
+The first found file is used. It is an error if the required file cannot be found.
----------------
hans wrote:
> The "add .cfg extension" magic seems a little awkward. It seems this is mixing the possibility of taking a filename and taking some other name.
> 
> For `clang --config myfile.cfg`, should it also search the current working directory?
> 
> I'm not keen on it searching in `~/.llvm`.
I'm also not keen on searching `~/.llvm`. Whoever makes the `blah-clang` symlink should get to control what the default configuration for `blah-clang` is, I think. But then this seems to immediately lead to the conclusion that we don't need this implicit-config-file feature at all, since you can replace a `blah-clang` symlink with a shell script containing `exec clang @blah.cfg "@$"` -- and it's better to handle it that way, since you get more control over where the config file lives.


https://reviews.llvm.org/D24933





More information about the cfe-commits mailing list