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

2022-11-06 Thread Arfrever Frehtes Taifersar Arahesis via Phabricator via cfe-commits
Arfrever added a comment. After reading this discussion, I need some clarification. If there were the followining symlinks pointing to `clang`: `i386-pc-linux-gnu-clang`, `i486-pc-linux-gnu-clang`, `i586-pc-linux-gnu-clang`, `i686-pc-linux-gnu-clang`, `x86_64-pc-linux-gnu-clang`. Then do I

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

2022-10-19 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D134337#3866267 , @mgorny wrote: > In D134337#3865905 , @tstellar > wrote: > >> In D134337#3865753 , @mgorny wrote: >> >>> In

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

2022-10-18 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. In D134337#3865905 , @tstellar wrote: > In D134337#3865753 , @mgorny wrote: > >> In D134337#3865541 , @tstellar >> wrote: >> >>> I know I'm a

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

2022-10-18 Thread Sam James via Phabricator via cfe-commits
thesamesam added a comment. In D134337#3865905 , @tstellar wrote: > In D134337#3865753 , @mgorny wrote: > >> In D134337#3865541 , @tstellar >> wrote: >> >>> I know I'm a

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

2022-10-18 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment. In D134337#3865753 , @mgorny wrote: > In D134337#3865541 , @tstellar > wrote: > >> I know I'm a little late here, but having a default config file that's >> always loaded makes

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

2022-10-18 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. In D134337#3865541 , @tstellar wrote: > I know I'm a little late here, but having a default config file that's always > loaded makes triaging issues much harder, because now every time someone > files a bug, we need to ask for

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

2022-10-18 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment. In D134337#3864288 , @mgorny wrote: > In D134337#3863744 , @tstellar > wrote: > >> In what scenarios will clang load the clang.cfg file? > > It will load it if all of the following are

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

2022-10-18 Thread Michał Górny via Phabricator via cfe-commits
mgorny marked an inline comment as done. mgorny added a comment. In D134337#3863744 , @tstellar wrote: > In what scenarios will clang load the clang.cfg file? It will load it if all of the following are true: 1. `--no-default-config` is **not** passed.

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

2022-10-17 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment. In what scenarios will clang load the clang.cfg file? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134337/new/ https://reviews.llvm.org/D134337 ___ cfe-commits mailing list

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

2022-10-17 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments. Comment at: clang/docs/UsersManual.rst:954 + +For example, ``x86_64-pc-linux-gnu-clang-g++`` will attempt to load two +configuration files named respectively:: Is `x86_64-pc-linux-gnu-clang-g++ ` being passed to --driver= in this

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

2022-09-30 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D134337#3827522 , @nickdesaulniers wrote: > In D134337#3824862 , @MaskRay wrote: > >> It's unclear Clang wants to support GCC style specs file and whether GCC >> wants to adopt

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

2022-09-30 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. In D134337#3824862 , @MaskRay wrote: > It's unclear Clang wants to support GCC style specs file and whether GCC > wants to adopt another system beside its specs. > I lean toward there isn't much cooperation as we might

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

2022-09-30 Thread Michał Górny via Phabricator via cfe-commits
mgorny marked an inline comment as done. mgorny added inline comments. Comment at: clang/test/Driver/config-file3.c:176 // -// SHORT-NAME: Configuration file: {{.*}}/testdmode/qqq.cfg -// SHORT-NAME: -Werror -// SHORT-NAME-NOT: -Wundefined-func-template +// FULL3-NOT:

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

2022-09-29 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D134337#3824683 , @ojeda wrote: > Thanks Nick for the ping. Indeed, `rustc` allows to use a "target > specification file" to create new targets that are not built-in, as a JSON > file. > > They are unstable though, since

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

2022-09-29 Thread Michał Górny via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG063e17d8b04b: [clang] [Driver] More flexible rules for loading default configs (authored by mgorny). Herald added a project: clang. Repository:

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

2022-09-29 Thread Miguel Ojeda via Phabricator via cfe-commits
ojeda added a comment. Thanks Nick for the ping. Indeed, `rustc` allows to use a "target specification file" to create new targets that are not built-in, as a JSON file. They are unstable though, since they are fairly tied to LLVM, and I think the Rust compiler team prefers to stabilize flags

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

2022-09-29 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. It might be nice to work with `rustc` folks on the format of these configs. A frequent difficulty between Rust and C interop is the totally different command line flags necessary to compile code meant to link together and match as much of the ABI as possible.

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

2022-09-29 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/test/Driver/config-file3.c:176 // -// SHORT-NAME: Configuration file: {{.*}}/testdmode/qqq.cfg -// SHORT-NAME: -Werror -// SHORT-NAME-NOT: -Wundefined-func-template +// FULL3-NOT: Configuration file: +// FULL3: Configuration

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

2022-09-29 Thread Michał Górny via Phabricator via cfe-commits
mgorny updated this revision to Diff 463944. mgorny marked an inline comment as done. mgorny added a comment. Change confusing comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134337/new/ https://reviews.llvm.org/D134337 Files: clang/docs/ReleaseNotes.rst

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

2022-09-29 Thread Michał Górny via Phabricator via cfe-commits
mgorny marked 2 inline comments as done. mgorny added inline comments. Comment at: clang/lib/Driver/Driver.cpp:1065-1080 + StringRef EffectiveDriverMode; + if (CLOptions) +EffectiveDriverMode = CLOptions->getLastArgValue(options::OPT_driver_mode); + if

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

2022-09-29 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/lib/Driver/Driver.cpp:1065-1080 + StringRef EffectiveDriverMode; + if (CLOptions) +EffectiveDriverMode = CLOptions->getLastArgValue(options::OPT_driver_mode); + if (EffectiveDriverMode.empty()) +EffectiveDriverMode =

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

2022-09-29 Thread Michał Górny via Phabricator via cfe-commits
mgorny added inline comments. Comment at: clang/include/clang/Driver/Driver.h:758 + /// Return the typical executable name for the specified driver \p Mode. + static const char *getExecutableForDriverMode(DriverMode Mode); }; MaskRay wrote: > This should be

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

2022-09-29 Thread Michał Górny via Phabricator via cfe-commits
mgorny updated this revision to Diff 463825. mgorny marked 2 inline comments as done. mgorny added a comment. Address @MaskRay 's comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134337/new/ https://reviews.llvm.org/D134337 Files: clang/docs/ReleaseNotes.rst

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

2022-09-29 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/include/clang/Driver/Driver.h:758 + /// Return the typical executable name for the specified driver \p Mode. + static const char *getExecutableForDriverMode(DriverMode Mode); }; This should be private

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

2022-09-29 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff accepted this revision. sepavloff added a comment. LGTM. Thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134337/new/ https://reviews.llvm.org/D134337 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2022-09-28 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. @sepavloff, @arichardson, does this approach look OK? I've included the cheribsd name in tests. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134337/new/ https://reviews.llvm.org/D134337 ___ cfe-commits mailing list

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

2022-09-28 Thread Michał Górny via Phabricator via cfe-commits
mgorny updated this revision to Diff 463548. mgorny edited the summary of this revision. mgorny added a comment. Herald added subscribers: pcwang-thead, s.egerton, simoncook. Implement the backwards compatible logic for using name prefix if 1) no target override options are used, and 2) name

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

2022-09-28 Thread Michał Górny via Phabricator via cfe-commits
mgorny marked an inline comment as done. mgorny added inline comments. Comment at: clang/test/Driver/config-file3.c:27 -//--- Invocation qqq-clang-g++ tries to find config file qqq-clang-g++.cfg first. +//--- Invocation x86_64-unknown-linux-gnu-clang-g++ tries

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

2022-09-28 Thread Alexander Richardson via Phabricator via cfe-commits
arichardson added inline comments. Comment at: clang/test/Driver/config-file3.c:27 -//--- Invocation qqq-clang-g++ tries to find config file qqq-clang-g++.cfg first. +//--- Invocation x86_64-unknown-linux-gnu-clang-g++ tries x86_64-unknown-linux-gnu-clang++.cfg first. //

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

2022-09-28 Thread Michał Górny via Phabricator via cfe-commits
mgorny updated this revision to Diff 463531. mgorny marked 2 inline comments as done. mgorny added a comment. Swap driver and target config loading order. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134337/new/ https://reviews.llvm.org/D134337 Files: clang/docs/ReleaseNotes.rst

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

2022-09-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/test/Driver/config-file3.c:27 -//--- Invocation qqq-clang-g++ tries to find config file qqq-clang-g++.cfg first. +//--- Invocation x86_64-unknown-linux-gnu-clang-g++ tries x86_64-unknown-linux-gnu-clang++.cfg first. //

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

2022-09-28 Thread Michał Górny via Phabricator via cfe-commits
mgorny added inline comments. Comment at: clang/test/Driver/config-file3.c:27 -//--- Invocation qqq-clang-g++ tries to find config file qqq-clang-g++.cfg first. +//--- Invocation x86_64-unknown-linux-gnu-clang-g++ tries x86_64-unknown-linux-gnu-clang++.cfg first. //

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

2022-09-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/test/Driver/config-file3.c:27 -//--- Invocation qqq-clang-g++ tries to find config file qqq-clang-g++.cfg first. +//--- Invocation x86_64-unknown-linux-gnu-clang-g++ tries x86_64-unknown-linux-gnu-clang++.cfg first. //

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

2022-09-28 Thread Michał Górny via Phabricator via cfe-commits
mgorny added inline comments. Comment at: clang/test/Driver/config-file3.c:27 -//--- Invocation qqq-clang-g++ tries to find config file qqq-clang-g++.cfg first. +//--- Invocation x86_64-unknown-linux-gnu-clang-g++ tries x86_64-unknown-linux-gnu-clang++.cfg first. //

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

2022-09-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/test/Driver/config-file3.c:27 -//--- Invocation qqq-clang-g++ tries to find config file qqq-clang-g++.cfg first. +//--- Invocation x86_64-unknown-linux-gnu-clang-g++ tries x86_64-unknown-linux-gnu-clang++.cfg first. //

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

2022-09-28 Thread Michał Górny via Phabricator via cfe-commits
mgorny added inline comments. Comment at: clang/test/Driver/config-file3.c:27 -//--- Invocation qqq-clang-g++ tries to find config file qqq-clang-g++.cfg first. +//--- Invocation x86_64-unknown-linux-gnu-clang-g++ tries x86_64-unknown-linux-gnu-clang++.cfg first. //

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

2022-09-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/lib/Driver/Driver.cpp:1098 + // Try loading separate config for the target (variants 3. and 4.) + CfgFileName = RealTriple.str() + ".cfg"; + if (searchForFile(CfgFilePath, CfgFileSearchDirs, CfgFileName, getVFS()) &&

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

2022-09-28 Thread Michał Górny via Phabricator via cfe-commits
mgorny added inline comments. Comment at: clang/lib/Driver/Driver.cpp:1098 + // Try loading separate config for the target (variants 3. and 4.) + CfgFileName = RealTriple.str() + ".cfg"; + if (searchForFile(CfgFilePath, CfgFileSearchDirs, CfgFileName, getVFS()) &&

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

2022-09-28 Thread Alexander Richardson via Phabricator via cfe-commits
arichardson added inline comments. Comment at: clang/test/Driver/config-file3.c:27 -//--- Invocation qqq-clang-g++ tries to find config file qqq-clang-g++.cfg first. +//--- Invocation x86_64-unknown-linux-gnu-clang-g++ tries x86_64-unknown-linux-gnu-clang++.cfg first. //

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

2022-09-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/lib/Driver/Driver.cpp:1098 + // Try loading separate config for the target (variants 3. and 4.) + CfgFileName = RealTriple.str() + ".cfg"; + if (searchForFile(CfgFilePath, CfgFileSearchDirs, CfgFileName, getVFS()) &&

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

2022-09-28 Thread Michał Górny via Phabricator via cfe-commits
mgorny updated this revision to Diff 463464. mgorny added a comment. Rename the bool to `TryModeSuffix`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134337/new/ https://reviews.llvm.org/D134337 Files: clang/docs/ReleaseNotes.rst clang/docs/UsersManual.rst

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

2022-09-28 Thread Michał Górny via Phabricator via cfe-commits
mgorny marked 2 inline comments as done. mgorny added inline comments. Comment at: clang/lib/Driver/Driver.cpp:1089 + + bool ModeSuffixUnique = !ClangNameParts.ModeSuffix.empty() && + ClangNameParts.ModeSuffix != RealMode.str();

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

2022-09-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/docs/ReleaseNotes.rst:236-239 +- Clang now supports loading multiple configuration files. The files from + default configuration paths are loaded first, unless ``--no-default-config`` + option is used. All files explicitly

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

2022-09-28 Thread Michał Górny via Phabricator via cfe-commits
mgorny updated this revision to Diff 463455. mgorny marked an inline comment as done. mgorny added a comment. Updated docs per @sepavloff 's suggestions. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134337/new/ https://reviews.llvm.org/D134337 Files: clang/docs/ReleaseNotes.rst

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

2022-09-28 Thread Michał Górny via Phabricator via cfe-commits
mgorny marked 4 inline comments as done. mgorny added inline comments. Comment at: clang/docs/ReleaseNotes.rst:236-239 +- Clang now supports loading multiple configuration files. The files from + default configuration paths are loaded first, unless ``--no-default-config`` +

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

2022-09-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/docs/ReleaseNotes.rst:236-239 +- Clang now supports loading multiple configuration files. The files from + default configuration paths are loaded first, unless ``--no-default-config`` + option is used. All files explicitly

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

2022-09-28 Thread Michał Górny via Phabricator via cfe-commits
mgorny updated this revision to Diff 463433. mgorny marked 2 inline comments as done. mgorny added a comment. Use `llvm_unreachable()`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134337/new/ https://reviews.llvm.org/D134337 Files: clang/docs/ReleaseNotes.rst

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

2022-09-28 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/Driver/Driver.cpp:6195 + + assert(false && "Unhandled Mode"); + return "clang"; MaskRay wrote: > If the switch covers all enum

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

2022-09-28 Thread Michał Górny via Phabricator via cfe-commits
mgorny updated this revision to Diff 463424. mgorny marked 2 inline comments as done. mgorny added a comment. Use `--target=` instead of `-target`. Use `touch` instead of `echo >`. Shorten FileCheck matches and guarantee that only expected configs appear. CHANGES SINCE LAST ACTION

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

2022-09-27 Thread Michał Górny via Phabricator via cfe-commits
mgorny marked 4 inline comments as done. mgorny added inline comments. Comment at: clang/docs/ReleaseNotes.rst:243 + ``.cfg`` and ``.cfg`` if the former is not found. `Target` + is always the effective target (with respect to ``-target``, ``-m32``, etc.) + and `driver` first

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

2022-09-27 Thread Phoebe Wang via Phabricator via cfe-commits
pengfei added inline comments. 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

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

2022-09-27 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. Thanks. The previous behavior is too magical. I like this version. Comment at: clang/docs/ReleaseNotes.rst:243 + ``.cfg`` and ``.cfg`` if the former is not found. `Target` + is always the effective target (with respect to ``-target``, ``-m32``, etc.)

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

2022-09-27 Thread Michał Górny via Phabricator via cfe-commits
mgorny updated this revision to Diff 463413. mgorny retitled this revision from "[clang] [Driver] More flexible rules for loading default configs (WIP)" to "[clang] [Driver] More flexible rules for loading default configs". mgorny added a comment. Update release notes. I may have been a bit

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

2022-09-27 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a reviewer: thesamesam. mgorny added a comment. Adding @thesamesam to reviewers since he's been testing it on Gentoo, and I'd like to get his ACK too. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134337/new/ https://reviews.llvm.org/D134337

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

2022-09-27 Thread Michał Górny via Phabricator via cfe-commits
mgorny updated this revision to Diff 463288. mgorny added a comment. Added doc update. Would use some help with release notes. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134337/new/ https://reviews.llvm.org/D134337 Files: clang/docs/UsersManual.rst

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

2022-09-27 Thread Michał Górny via Phabricator via cfe-commits
mgorny updated this revision to Diff 463274. mgorny added a comment. Update tests. Docs coming up next. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134337/new/ https://reviews.llvm.org/D134337 Files: clang/include/clang/Driver/Driver.h clang/lib/Driver/Driver.cpp

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

2022-09-27 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. Thanks. Since the algorithm's good, I'll work on updating the docs and tests. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134337/new/ https://reviews.llvm.org/D134337 ___ cfe-commits mailing list

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

2022-09-27 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D134337#3817878 , @mgorny wrote: > Ok, how about this variant? I think it's the simplest I can come up with that > roughly matches the old behavior and adds what's necessary for the new. > > The algorithm is to use: > > 1.

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

2022-09-27 Thread Michał Górny via Phabricator via cfe-commits
mgorny updated this revision to Diff 463201. mgorny edited the summary of this revision. mgorny added a comment. Ok, how about this variant? I think it's the simplest I can come up with that roughly matches the old behavior and adds what's necessary for the new. The algorithm is to use: 1.

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

2022-09-27 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. In D134337#3817133 , @sepavloff wrote: > It make sense but the algorithm looks overcomplicated. The current > implementation is already too complex and documenting the new algorithm is a > challenge. > > What about making

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

2022-09-27 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D134337#3815705 , @MaskRay wrote: > In D134337#3815412 , @mgorny wrote: > >> In D134337#3815339 , @sepavloff >> wrote: >> >>> In

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

2022-09-26 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D134337#3815412 , @mgorny wrote: > In D134337#3815339 , @sepavloff > wrote: > >> In D134337#3805368 , @mgorny wrote: >> >>> For target, it

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

2022-09-26 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. In D134337#3815339 , @sepavloff wrote: > In D134337#3805368 , @mgorny wrote: > >> For target, it will try: >> >> 1. `i386.cfg` (effective triple) >> 2. `i386-pc-linux-gnu.cfg` ("fixed"

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

2022-09-26 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D134337#3813798 , @mgorny wrote: > In D134337#3813779 , @sepavloff > wrote: > >> First clang tries to find `x86_64-pc-linux-gnu-clang.cfg`. Just tool name >> with added suffix

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

2022-09-25 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. In D134337#3813779 , @sepavloff wrote: > First clang tries to find `x86_64-pc-linux-gnu-clang.cfg`. Just tool name > with added suffix `cfg`. No target override, no attempt to split tool name > into components. It provides

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

2022-09-25 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. I would propose to slightly modify the config file search algorithm. For the tool named as `x86_64-pc-linux-gnu-clang`, the existing algorithm would search for the files: - `i386-clang.cfg` - `i386.cfg` - `x86_64-clang.cfg` - `x86_64.cfg` We could modify this

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

2022-09-24 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. @sepavloff, gentle ping. I'm waiting for your ACK/NAK on the algo in https://reviews.llvm.org/D134337#3805368. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134337/new/ https://reviews.llvm.org/D134337 ___

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

2022-09-21 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/lib/Driver/Driver.cpp:6195 + + assert(false && "Unhandled Mode"); + return "clang"; If the switch covers all enum members, we typically use llvm_unreachable to work around a GCC -Wswitch warning. Clang

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

2022-09-21 Thread Michał Górny via Phabricator via cfe-commits
mgorny updated this revision to Diff 461960. mgorny added a comment. Simplify getting driver mode — it turns out it's set for us already! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134337/new/ https://reviews.llvm.org/D134337 Files: clang/include/clang/Driver/Driver.h

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

2022-09-21 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. To explain this better, let's take the following example call: x86_64-pc-linux-gnu-clang --driver-mode=g++ -target i386 This maps to: - effective triple: `i386` (from `-target`) - effective mode: `clang++` (from `--driver-mode`) - name prefix: `x86_64-pc-linux-gnu` -

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

2022-09-21 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. @sepavloff, I'd appreciate if you could take a look at the logic before I start updating tests. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134337/new/ https://reviews.llvm.org/D134337 ___ cfe-commits mailing list

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

2022-09-21 Thread Michał Górny via Phabricator via cfe-commits
mgorny created this revision. mgorny added reviewers: sepavloff, MaskRay. Herald added subscribers: StephenFan, pengfei. Herald added a reviewer: sscalpone. Herald added a project: All. mgorny requested review of this revision. Update the rules used to load default configuration files to permit