[llvm-rc] Resolve the executable path if not present in Argv[0]
The llvm-rc tool tries to locate a suitable Clang executable to use for preprocessing. For this purpose, it first checks within the same directory as the llvm-rc tool, checking with a couple different names, followed by checking all of $PATH for another couple names. On Windows, the InitLLVM() function always sets up Argv[0] with the full path to the executable, while on Unix, Argv[0] is kept as is. Therefore, call getMainExecutable to try to resolve the directory of the executable before looking for colocated Clang executables. This makes 282744a9 actually have the desired effect. Differential Revision: https://reviews.llvm.org/D157241 (cherry picked from commit 8c6a0c8b)
parent
147b8357
Please register or sign in to comment