[llvm-commits] [PATCH] Bugpoint/Support: Fix llvm::FindExecutable not looking for files ending with .exe

NAKAMURA Takumi geek4civic at gmail.com
Tue Aug 31 14:05:14 PDT 2010


Michael,

An refined patch is attached. Please take a look.
Confirmed on mingw, mingw-cross, f12 and centos5.

  - get rid of extra sys::Path variable FoundPath
  - suppose value of FindProgramByName() must be valid when it is not empty


...Takumi
-------------- next part --------------
diff --git a/lib/Support/SystemUtils.cpp b/lib/Support/SystemUtils.cpp
index 299032f..421b381 100644
--- a/lib/Support/SystemUtils.cpp
+++ b/lib/Support/SystemUtils.cpp
@@ -49,6 +49,10 @@ sys::Path llvm::FindExecutable(const std::string &ExeName,
     Result.appendComponent(ExeName);
     if (Result.canExecute())
       return Result;
+    // Expect to retrieve the pathname with suffix .exe.
+    Result = sys::Program::FindProgramByName(Result.str());
+    if (!Result.empty())
+      return Result;
   }
 
   return sys::Path();


More information about the llvm-commits mailing list