[Driver] Enable nested configuration files
authorSerge Pavlov <sepavloff@gmail.com>
Thu, 20 Oct 2022 05:24:50 +0000 (12:24 +0700)
committerSerge Pavlov <sepavloff@gmail.com>
Wed, 16 Nov 2022 06:32:27 +0000 (13:32 +0700)
commit1f67dc8b7c225290d1b3eb93d90e2c9861aeefc0
treef643b44b93e3fdb6ec8d9809e2ebeaea75cdf6be
parentfde4ef19737e142fbe2fe2a3edd31963a254d3dd
[Driver] Enable nested configuration files

Users may partition parameters specified by configuration file and put
different groups into separate files. These files are inserted into the
main file using constructs `@file`. Relative file names in it are
resolved relative to the including configuration file and this is not
convenient in some cases. A configuration file, which resides in system
directory, may need to include a file with user-defined parameters and
still provide default definitions if such file is absent.

To solve such problems, the option `--config=` is allowed inside
configuration files. Like `@file` it results in insertion of
command-line arguments but the algorithm of file search is different and
allows overriding system definitions with user ones.

Differential Revision: https://reviews.llvm.org/D136354
clang/docs/UsersManual.rst
clang/include/clang/Basic/DiagnosticDriverKinds.td
clang/lib/Driver/Driver.cpp
clang/test/Driver/Inputs/config-6.cfg
clang/test/Driver/config-file-errs.c
clang/test/Driver/config-file.c
clang/unittests/Driver/ToolChainTest.cpp
llvm/lib/Support/CommandLine.cpp