Only use argv[0] as the main executable name if it exists.
authorSean Silva <chisophugis@gmail.com>
Mon, 15 Apr 2019 22:07:56 +0000 (22:07 +0000)
committerSean Silva <chisophugis@gmail.com>
Mon, 15 Apr 2019 22:07:56 +0000 (22:07 +0000)
commitde68a375181f4e831f4d558a75508e0426ba7327
tree7482b26e96a7e34a569d24f4ca311242b428598b
parent800a0c3e4b0655ba23afe40ff1d21bc531158bfc
Only use argv[0] as the main executable name if it exists.

Under some environments, argv[0] doesn't hold a valid file name, but
sys::fs::getMainExecutable will find the main executable properly.

This patch tweaks the logic to fall back to sys::fs::getMainExecutable
in more situations.

Differential Revision: https://reviews.llvm.org/D60730

llvm-svn: 358455
llvm/lib/Support/Signals.cpp