diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2006-09-14 04:20:17 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2006-09-14 04:20:17 +0000 |
commit | e290c6d250cdf67887a5f16ac9d459f83f9f0e30 (patch) | |
tree | ccdc84c3e6e5945c994904eebce53966535ab40b /tools | |
parent | 40394bc4197b0e67f4effa5bbf7e655138be82c3 (diff) | |
download | external_llvm-e290c6d250cdf67887a5f16ac9d459f83f9f0e30.zip external_llvm-e290c6d250cdf67887a5f16ac9d459f83f9f0e30.tar.gz external_llvm-e290c6d250cdf67887a5f16ac9d459f83f9f0e30.tar.bz2 |
Fix --enable-valgrind. Add room for the new arguments, and don't keep
a pointer to a temporary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30312 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bugpoint/OptimizerDriver.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/bugpoint/OptimizerDriver.cpp b/tools/bugpoint/OptimizerDriver.cpp index 8087ddb..dddf7ce 100644 --- a/tools/bugpoint/OptimizerDriver.cpp +++ b/tools/bugpoint/OptimizerDriver.cpp @@ -158,13 +158,14 @@ bool BugDriver::runPasses(const std::vector<const PassInfo*> &Passes, // 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 @@ bool BugDriver::runPasses(const std::vector<const PassInfo*> &Passes, 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, |