[llvm-commits] CVS: llvm/tools/bugpoint/OptimizerDriver.cpp
Nick Lewycky
nicholas at mxc.ca
Wed Sep 13 21:20:35 PDT 2006
Changes in directory llvm/tools/bugpoint:
OptimizerDriver.cpp updated: 1.45 -> 1.46
---
Log message:
Fix --enable-valgrind. Add room for the new arguments, and don't keep
a pointer to a temporary.
---
Diffs of the changes: (+4 -3)
OptimizerDriver.cpp | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
Index: llvm/tools/bugpoint/OptimizerDriver.cpp
diff -u llvm/tools/bugpoint/OptimizerDriver.cpp:1.45 llvm/tools/bugpoint/OptimizerDriver.cpp:1.46
--- llvm/tools/bugpoint/OptimizerDriver.cpp:1.45 Wed Sep 13 22:49:54 2006
+++ llvm/tools/bugpoint/OptimizerDriver.cpp Wed Sep 13 23:20:17 2006
@@ -158,13 +158,14 @@
// setup the child process' arguments
const char** args = (const char**)
alloca(sizeof(const char*) *
- (Passes.size()+10+2*PluginLoader::getNumPlugins()));
+ (Passes.size()+13+2*PluginLoader::getNumPlugins()));
int n = 0;
+ sys::Path tool = sys::Program::FindProgramByName(ToolName);
if (UseValgrind) {
args[n++] = "valgrind";
args[n++] = "--error-exitcode=1";
args[n++] = "-q";
- args[n++] = sys::Program::FindProgramByName(ToolName).c_str();
+ args[n++] = tool.c_str();
} else
args[n++] = ToolName.c_str();
@@ -189,7 +190,7 @@
if (UseValgrind)
prog = sys::Program::FindProgramByName("valgrind");
else
- prog = sys::Program::FindProgramByName(ToolName);
+ prog = tool;
int result = sys::Program::ExecuteAndWait(prog,args,0,0,Timeout,&ErrMsg);
// If we are supposed to delete the bytecode file or if the passes crashed,
More information about the llvm-commits
mailing list