[llvm-commits] [llvm] r111929 - /llvm/trunk/tools/bugpoint/OptimizerDriver.cpp
Chris Lattner
sabre at nondot.org
Tue Aug 24 10:44:07 PDT 2010
Author: lattner
Date: Tue Aug 24 12:44:07 2010
New Revision: 111929
URL: http://llvm.org/viewvc/llvm-project?rev=111929&view=rev
Log:
Apply "Win32's Hybrid path separator in argv[0] should be accepted to bugpoint",
patch by NAKAMURA Takumi!
Modified:
llvm/trunk/tools/bugpoint/OptimizerDriver.cpp
Modified: llvm/trunk/tools/bugpoint/OptimizerDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/OptimizerDriver.cpp?rev=111929&r1=111928&r2=111929&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/OptimizerDriver.cpp (original)
+++ llvm/trunk/tools/bugpoint/OptimizerDriver.cpp Tue Aug 24 12:44:07 2010
@@ -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 @@
// 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");
More information about the llvm-commits
mailing list