summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-26 05:01:35 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-26 05:01:35 +0000
commit50188c1f42c122640ab9ccac2134acf371c26b2c (patch)
tree05539e5a83063a0eeda3c9211dfb8153cc750f0c /tools
parent2c63b27e9f36dddc2660639026b19e606ad52cd0 (diff)
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
Diffstat (limited to 'tools')
-rw-r--r--tools/bugpoint/ToolRunner.cpp4
-rw-r--r--tools/llvm-config/llvm-config.cpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp
index 4e6f6e27cca..9cc5f9a7e6b 100644
--- a/tools/bugpoint/ToolRunner.cpp
+++ b/tools/bugpoint/ToolRunner.cpp
@@ -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;
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
index 5151d1a0911..fc3ab68f7d8 100644
--- a/tools/llvm-config/llvm-config.cpp
+++ b/tools/llvm-config/llvm-config.cpp
@@ -162,11 +162,11 @@ Typical components:\n\
}
/// \brief Compute the path to the main executable.
-llvm::sys::Path GetExecutablePath(const char *Argv0) {
+std::string GetExecutablePath(const char *Argv0) {
// This just needs to be some symbol in the binary; C++ doesn't
// allow taking the address of ::main however.
void *P = (void*) (intptr_t) GetExecutablePath;
- return llvm::sys::Path::GetMainExecutable(Argv0, P);
+ return llvm::sys::fs::getMainExecutable(Argv0, P);
}
int main(int argc, char **argv) {
@@ -180,7 +180,7 @@ int main(int argc, char **argv) {
// tree.
bool IsInDevelopmentTree;
enum { MakefileStyle, CMakeStyle, CMakeBuildModeStyle } DevelopmentTreeLayout;
- llvm::SmallString<256> CurrentPath(GetExecutablePath(argv[0]).str());
+ llvm::SmallString<256> CurrentPath(GetExecutablePath(argv[0]));
std::string CurrentExecPrefix;
std::string ActiveObjRoot;