[PATCH] D142933: Add -print-multi-selection-flags argument

Michael Platings via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 2 10:50:01 PST 2023


michaelplatings added a comment.

In D142933#4099043 <https://reviews.llvm.org/D142933#4099043>, @Joe wrote:

> I did briefly try to pass a ToolChain to Gnu.cpp functions, but it became intrusive and had to add it in 5+ places, so unless I'm missing a trick to get the ToolChain from the Driver, my vote would go to the former.

I looked into moving `getMultiSelectionFlags` into the `Driver` class but it felt wrong.

I think the place you need to call `getMultiSelectionFlags` is from `findRISCVBareMetalMultilibs` and `findRISCVMultilibs`. They will indeed need changing to take a `const ToolChain&`. They are called from `ScanGCCForMultilibs` which is a method of `GCCInstallationDetector`. `GCCInstallationDetector` could have a `const ToolChain&` member. `GCCInstallationDetector` is only instantiated from the `Generic_GCC` constructor - `Generic_GCC` is a subclass of `ToolChain` so it can pass `*this` to the `GCCInstallationDetector` constructor. I think that change would not be too intrusive.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142933



More information about the cfe-commits mailing list