[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 clang/include/clang/Driver/Dri

[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 clang/test/Dri

[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 cfe-commits@lists.ll

[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. `-.c

[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 minimal

[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 D134337#380

[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 wil

[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" pref

[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 `cfg`

[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 possib

[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 algorit

[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 ___ cfe-commits

[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 correctly

[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 clang/lib/

[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 c

[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 mo