[PATCH] D134337: [clang] [Driver] More flexible rules for loading default configs

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 27 22:59:32 PDT 2022


mgorny marked 4 inline comments as done.
mgorny added inline comments.


================
Comment at: clang/docs/ReleaseNotes.rst:243
+  ``<target>.cfg`` and ``<driver>.cfg`` if the former is not found. `Target`
+  is always the effective target (with respect to ``-target``, ``-m32``, etc.)
+  and `driver` first tries the canonical name for the driver (respecting
----------------
MaskRay wrote:
> `-target` => `--target=`
> 
> avoid legacy spelling
Ah, so it needs `=` (I really hate the option parsing in clang, you know?).

BTW that's what got me to use `-target`:

```
$ clang --target foo
clang-16: error: unsupported option '--target'; did you mean '-target'?
```


================
Comment at: clang/test/Driver/config-file3.c:33
+// RUN: ln -s %clang %t/testdmode/x86_64-unknown-linux-gnu-clang
+// RUN: echo > %t/testdmode/x86_64-unknown-linux-gnu-clang++.cfg
+// RUN: echo > %t/testdmode/x86_64-unknown-linux-gnu-clang-g++.cfg
----------------
pengfei wrote:
> MaskRay wrote:
> > Since %t is rebuilt. You can just use `touch`
> `touch` may not work on Windows?
Well, my experience tells me to avoid external commands when the goal can be achieved via a builtin but `touch` is more popular in clang indeed.


================
Comment at: clang/test/Driver/config-file3.c:47
+// FULL1: Configuration file: {{.*}}/testdmode/x86_64-unknown-linux-gnu-clang++.cfg
+// FULL1-NOT: Configuration file: {{.*}}/testdmode/x86_64-unknown-linux-gnu-clang-g++.cfg
+// FULL1-NOT: Configuration file: {{.*}}/testdmode/x86_64-unknown-linux-gnu-clang.cfg
----------------
MaskRay wrote:
> Is `// FULL1-NOT: Configuration file:` sufficient?
Indeed. I forgot that FileCheck is weird-ish about retrying the matches ;-).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134337/new/

https://reviews.llvm.org/D134337



More information about the cfe-commits mailing list