[llvm] r184204 - Return a std::string from PrependMainExecutablePath.

Rafael Espindola rafael.espindola at gmail.com
Tue Jun 18 09:47:56 PDT 2013


Author: rafael
Date: Tue Jun 18 11:47:55 2013
New Revision: 184204

URL: http://llvm.org/viewvc/llvm-project?rev=184204&view=rev
Log:
Return a std::string from PrependMainExecutablePath.

Modified:
    llvm/trunk/tools/bugpoint/ToolRunner.cpp

Modified: llvm/trunk/tools/bugpoint/ToolRunner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ToolRunner.cpp?rev=184204&r1=184203&r2=184204&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/ToolRunner.cpp (original)
+++ llvm/trunk/tools/bugpoint/ToolRunner.cpp Tue Jun 18 11:47:55 2013
@@ -237,8 +237,9 @@ void AbstractInterpreter::anchor() { }
 /// directory. An empty string is returned on error; note that this function
 /// just mainpulates the path and doesn't check for executability.
 /// @brief Find a named executable.
-static sys::Path PrependMainExecutablePath(const std::string &ExeName,
-                                           const char *Argv0, void *MainAddr) {
+static std::string PrependMainExecutablePath(const std::string &ExeName,
+                                             const char *Argv0,
+                                             void *MainAddr) {
   // 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.
@@ -250,7 +251,7 @@ static sys::Path PrependMainExecutablePa
     Result.appendSuffix(sys::Path::GetEXESuffix());
   }
 
-  return Result;
+  return Result.str();
 }
 
 // LLI create method - Try to find the LLI executable
@@ -258,7 +259,7 @@ AbstractInterpreter *AbstractInterpreter
                                                     std::string &Message,
                                      const std::vector<std::string> *ToolArgs) {
   std::string LLIPath =
-    PrependMainExecutablePath("lli", Argv0, (void *)(intptr_t)&createLLI).str();
+      PrependMainExecutablePath("lli", Argv0, (void *)(intptr_t) & createLLI);
   if (!LLIPath.empty()) {
     Message = "Found lli: " + LLIPath + "\n";
     return new LLI(LLIPath, ToolArgs);
@@ -542,7 +543,7 @@ LLC *AbstractInterpreter::createLLC(cons
                                     const std::vector<std::string> *GCCArgs,
                                     bool UseIntegratedAssembler) {
   std::string LLCPath =
-    PrependMainExecutablePath("llc", Argv0, (void *)(intptr_t)&createLLC).str();
+      PrependMainExecutablePath("llc", Argv0, (void *)(intptr_t) & createLLC);
   if (LLCPath.empty()) {
     Message = "Cannot find `llc' in executable directory!\n";
     return 0;
@@ -630,7 +631,7 @@ int JIT::ExecuteProgram(const std::strin
 AbstractInterpreter *AbstractInterpreter::createJIT(const char *Argv0,
                    std::string &Message, const std::vector<std::string> *Args) {
   std::string LLIPath =
-    PrependMainExecutablePath("lli", Argv0, (void *)(intptr_t)&createJIT).str();
+      PrependMainExecutablePath("lli", Argv0, (void *)(intptr_t) & createJIT);
   if (!LLIPath.empty()) {
     Message = "Found lli: " + LLIPath + "\n";
     return new JIT(LLIPath, Args);





More information about the llvm-commits mailing list