[PATCH] D157275: [Driver] Select newest GCC installation on Solaris

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 15 09:08:49 PDT 2023


MaskRay accepted this revision.
MaskRay added a comment.
This revision is now accepted and ready to land.

Thanks!



================
Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:2258
 
-      Prefixes.push_back(CandidatePrefix);
+      SolarisPrefixes.push_back(CandidatePrefix);
     }
----------------
ro wrote:
> MaskRay wrote:
> > It's better to use https://en.wikipedia.org/wiki/Schwartzian_transform here to avoid calling `llvm::sys::path::filename` and `Generic_GCC::GCCVersion::Parse` in the comparator. Then the comparator is just `A < B` and can just be removed.
> This is way shorter and efficient indeed.  Patch updated.
Use `emplace_back`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157275



More information about the cfe-commits mailing list