[PATCH] D157241: [llvm-rc] Resolve the executable path if not present in Argv[0]

Tobias Hieta via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 7 00:23:01 PDT 2023


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

LGTM, I would change `P` to `nullptr`, unless there is a good reason to check the symbol there.



================
Comment at: llvm/tools/llvm-rc/llvm-rc.cpp:141
+  void *P = (void*) (intptr_t) findClang;
+  std::string MainExecPath = llvm::sys::fs::getMainExecutable(Argv0, P);
+  if (MainExecPath.empty())
----------------
You can just pass `nullptr` to `getMainExecutable` instead of a symbol, unless there is a good reason here (I don't think so?).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157241



More information about the llvm-commits mailing list