[PATCH] D134208: [clang] [Driver] Do not transform explicit --config filename

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 19 12:36:51 PDT 2022


mgorny created this revision.
mgorny added reviewers: sepavloff, MaskRay.
Herald added a subscriber: StephenFan.
Herald added a project: All.
mgorny requested review of this revision.

Disable transformations (e.g. attempting to replace target architecture)
in the config filename that is passed explicitly via `--config`.  This
behavior is surprising and confusing -- if user passes an explicit
config filename, Clang should use it as is.  The transformations are
still applied when the name is deduced from filename.

Update the tests accordingly.  This primarily ensures that full filename
with .cfg suffix is passed to --config (appending `.cfg` implicitly is
not documented, and would collide with use of filenames with other
suffixes).  The config-file2.c suite is removed entirely as it tested
the transformations on the argument to --config.  However, the aspects
of that that were not tested as part of config-file3.c are now added
there (based on config filename deduced from executable).

This change streamlines the code in Driver::loadConfigFile(), opening
the possibility of further changes, including support for handling
multiple --config options and refactoring of filename deduction.


https://reviews.llvm.org/D134208

Files:
  clang/lib/Driver/Driver.cpp
  clang/test/Driver/config-file-errs.c
  clang/test/Driver/config-file.c
  clang/test/Driver/config-file2.c
  clang/test/Driver/config-file3.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134208.461307.patch
Type: text/x-patch
Size: 13871 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220919/b6c18000/attachment-0001.bin>


More information about the cfe-commits mailing list