Port GetMainExecutable over to PathV2.

I will remove the V1 version as soon as I change clang in the next commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184914 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2013-06-26 05:01:35 +00:00
parent 2c63b27e9f
commit 50188c1f42
6 changed files with 126 additions and 8 deletions

View File

@@ -252,8 +252,8 @@ static std::string PrependMainExecutablePath(const std::string &ExeName,
// Check the directory that the calling program is in. We can do
// this if ProgramPath contains at least one / character, indicating that it
// is a relative path to the executable itself.
sys::Path Main = sys::Path::GetMainExecutable(Argv0, MainAddr);
StringRef Result = sys::path::parent_path(Main.str());
std::string Main = sys::fs::getMainExecutable(Argv0, MainAddr);
StringRef Result = sys::path::parent_path(Main);
if (!Result.empty()) {
SmallString<128> Storage = Result;