]> granicus.if.org Git - llvm/commit
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)
commit3738635a11dfeb0cb5247b0a08a2564430aa145a
tree1c8614ab290fa09254902433209543cd1417e6bd
parent7c6fd7edbf9c0915865872bf141fd16fa93821f6
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358455 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/Signals.cpp