[PATCH] D34290: [Driver] Do a PATH lookup when using only program name with -no-canonical-prefixes

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 16 13:49:20 PDT 2017


hans added a comment.

Thanks!

Please add to the description that this is for PR9576.



================
Comment at: tools/driver/driver.cpp:58
+    SmallString<128> ExecutablePath(Argv0);
+    // Do a PATH lookup, if there are no directory components.
+    if (llvm::sys::path::filename(ExecutablePath) == ExecutablePath)
----------------
What if "clang" is in the current directory? Presumably that should then be preferred over PATH.. will we get that right with this patch?

Another way would be to check access() on Argv0, which is what we do when trying to execute anyway. Is there any downside to that?


Repository:
  rL LLVM

https://reviews.llvm.org/D34290





More information about the cfe-commits mailing list