<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/111806>111806</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang][driver][enhancement] More detailed configuration files needed
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          pawosm-arm
      </td>
    </tr>
</table>

<pre>
    The configuration files are described here: https://clang.llvm.org/docs/UsersManual.html#configuration-files

Currently they could be split across the target and/or compilation mode (namely, `<triple>-<driver>.cfg`). During practical use, I've noticed an urgent requirement for more detailed split, namely `<triple>-<driver>-<role>.cfg` and in case of the default target, `<driver>-<role>.cfg`. The roles could be defined as such:

- `compile`, e.g. `clang++-compile.cfg`
- `compile_omp`. e.g. `clang-compile_omp.cfg` (would be used whenever user specify -fopenmp*)
- `link`, e.g. `flang-link.cfg`
- `link_omp`, e.g. `clang++-link_omp.cfg`

With this arrangement, I would be able to put (for example):

- `-funroll-loops -fno-math-errno` into `clang.cfg` and `clang++.cfg`,
- `-mpcu=native` into `clang_omp.cfg`, `clang++_omp.cfg` and `flang_omp.cfg`
- `-Wl,-rpath=<CFGDIR>/../lib` into `clang-link.cfg`, `clang++-link.cfg` and `flang-link.cfg`
- `-Wl,-rpath=<CFGDIR>/../lib -Wl,-rpath=<CFGDIR>/../lib/aarch64-unknown-linux-gnu` into `clang-link_omp.cfg`, `clang++-link.cfg` and `flang-link_omp.cfg`

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVUuTozYQ_jXypQsKC2PjA4cZPKT2sJdUUntMCakBZYVE9PCs_31KYM_g9ezUXnhIdPf3aNTMOdlrxIoUz6Q4bVjwg7HVxF6NGxNmx01rxKX6a0DgRneyD5Z5aTR0UqEDZhEEOm5liwIGtEjyJxi8nxzJnwhtCG24YrpPlTqPqbE9oY0w3BHa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