[PATCH] D119219: [llvm-rc]: Find <target>-clang over just clang

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 8 01:33:55 PST 2022


mstorsjo added a comment.

For these cases, I guess we'd end up executing `<triple>-clang -target <triple>`, which is a bit redundant, but it's probably not worth complicating the code to avoid that.

Ideally we'd have a test for this, but I think such a test for this can be pretty hard to fit into the test framework, so it can probably go in without.



================
Comment at: llvm/tools/llvm-rc/llvm-rc.cpp:128
 
-ErrorOr<std::string> findClang(const char *Argv0) {
+ErrorOr<std::string> findClang(const char *Argv0, StringRef triple) {
   StringRef Parent = llvm::sys::path::parent_path(Argv0);
----------------
Please follow the coding convention of the surrounding code here (local variables starting with a uppercase letter)


================
Comment at: llvm/tools/llvm-rc/llvm-rc.cpp:131
   ErrorOr<std::string> Path = std::error_code();
+  std::string TargetClang = llvm::formatv("{0}-clang", triple);
   if (!Parent.empty()) {
----------------
`(Triple + "-clang").str()` would probably be simpler here


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119219



More information about the llvm-commits mailing list