llvm::FindExecutable(): Retrieve the name with suffix.exe, if available.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Thu, 2 Sep 2010 03:46:04 +0000 (03:46 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Thu, 2 Sep 2010 03:46:04 +0000 (03:46 +0000)
bugpoint uses it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112803 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/SystemUtils.cpp

index 299032f1871562b6f35fef059c2b8d5c638fa8a4..421b38111e0963600976e846d46352dd39f2c3af 100644 (file)
@@ -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();