summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/OptimizerDriver.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-08-24 17:44:07 +0000
committerChris Lattner <sabre@nondot.org>2010-08-24 17:44:07 +0000
commit5afc1e7b312df02c7c9279135345bbb723584876 (patch)
treed03cc2c648354b3b60a1a66084577c8547057f67 /llvm/tools/bugpoint/OptimizerDriver.cpp
parent734cdb58f1b3a8c06ca73346e0569200a77d0700 (diff)
downloadbcm5719-llvm-5afc1e7b312df02c7c9279135345bbb723584876.tar.gz
bcm5719-llvm-5afc1e7b312df02c7c9279135345bbb723584876.zip
Apply "Win32's Hybrid path separator in argv[0] should be accepted to bugpoint",
patch by NAKAMURA Takumi! llvm-svn: 111929
Diffstat (limited to 'llvm/tools/bugpoint/OptimizerDriver.cpp')
-rw-r--r--llvm/tools/bugpoint/OptimizerDriver.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/llvm/tools/bugpoint/OptimizerDriver.cpp b/llvm/tools/bugpoint/OptimizerDriver.cpp
index 6d37761bcde..8f5ab722f02 100644
--- a/llvm/tools/bugpoint/OptimizerDriver.cpp
+++ b/llvm/tools/bugpoint/OptimizerDriver.cpp
@@ -27,6 +27,7 @@
#include "llvm/Target/TargetData.h"
#include "llvm/Support/FileUtilities.h"
#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/SystemUtils.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/System/Path.h"
@@ -150,16 +151,8 @@ bool BugDriver::runPasses(Module *Program,
// setup the child process' arguments
SmallVector<const char*, 8> Args;
- std::string Opt;
- llvm::StringRef TN(ToolName);
- if (TN.find('/') == llvm::StringRef::npos) {
- Opt = "opt";
- } else {
- std::pair<llvm::StringRef, llvm::StringRef> P = TN.rsplit('/');
- Opt = P.first.str() + "/" + "opt";
- }
-
- sys::Path tool = sys::Program::FindProgramByName(Opt);
+ sys::Path tool = FindExecutable("opt", getToolName(), (void*)"opt");
+ std::string Opt = tool.str();
if (UseValgrind) {
Args.push_back("valgrind");
Args.push_back("--error-exitcode=1");
OpenPOWER on IntegriCloud