[PATCH] D133325: [Driver] Allow search of included response files as configuration files

Serge Pavlov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 5 09:44:30 PDT 2022


sepavloff created this revision.
sepavloff added reviewers: rjmccall, aaron.ballman, kadircet, sammccall, jackoalan.
Herald added a subscriber: hiraditya.
Herald added a project: All.
sepavloff requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay.
Herald added projects: clang, LLVM.

Normally a file included into configuration file by directive `@file` is
searched for relative the including configuration file. In some cases it
is not convenient. Configuration parameters may be logically partitioned
into caterories (like 'platform variant' and 'processor variant') and it
is convenient to have different configuration files for these
categories maintained separately. Similar motivation was described in
https://discourse.llvm.org/t/rfc-adding-a-default-file-location-to-config-file-support/63606.
Simple file inclusion by `@file` does not help, because in this case the
path to `file` is specified relative to the directory of the used
configuration file, but it actually is not dependent on the latter. Using
absolute paths is not convenient and it still do not allow user to
easily override the settings.

This change implements option `--search-config-dirs`, which modifies the
search algorithm, - files included by `@file` are searched for as
configuration files, in the same directories, and can be overridden by a
user. With this facility a configuration file can include other files
like in:

  @platform.cfg
  @processor.cfg
  ...other options...

The effect is as if two configuration files are loaded, both are
searched for in well-known places and can be overridden if user
provides a file with the same name in user configuration directory.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D133325

Files:
  clang/docs/UsersManual.rst
  clang/include/clang/Driver/Driver.h
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/Driver.cpp
  clang/test/Driver/Inputs/config/config-3.cfg
  clang/test/Driver/config-file.c
  clang/unittests/Driver/ToolChainTest.cpp
  llvm/include/llvm/Support/CommandLine.h
  llvm/lib/Support/CommandLine.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133325.458034.patch
Type: text/x-patch
Size: 21089 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220905/c956a5d3/attachment.bin>


More information about the llvm-commits mailing list