mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
Fix --enable-valgrind. Add room for the new arguments, and don't keep
a pointer to a temporary. llvm-svn: 30312
This commit is contained in:
parent
fcd43d78a2
commit
3c0bf01e9b
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user