[all-commits] [llvm/llvm-project] a7d240: [clang] [Driver] Do not transform explicit --confi...

Michał Górny via All-commits all-commits at lists.llvm.org
Mon Sep 19 22:59:04 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a7d2409bac7fd9ef6b8c362f1ab54a9b6339a69a
      https://github.com/llvm/llvm-project/commit/a7d2409bac7fd9ef6b8c362f1ab54a9b6339a69a
  Author: Michał Górny <mgorny at moritz.systems>
  Date:   2022-09-20 (Tue, 20 Sep 2022)

  Changed paths:
    M clang/lib/Driver/Driver.cpp
    M clang/test/Driver/config-file-errs.c
    M clang/test/Driver/config-file.c
    R clang/test/Driver/config-file2.c
    M clang/test/Driver/config-file3.c

  Log Message:
  -----------
  [clang] [Driver] Do not transform explicit --config filename

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.

Differential Revision: https://reviews.llvm.org/D134208




More information about the All-commits mailing list