X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=tools%2Fbugpoint%2FOptimizerDriver.cpp;h=3ded5e866b3e025baaea3eee40a49dcd3df6ff2d;hb=73b43b9b549a75fb0015c825df68abd95705a67c;hp=b08171bc587971d9d137cbafe993403c153ecc79;hpb=584c3bf6504ec0e56c54bbf02fce2d2bd1e6c0e1;p=oota-llvm.git diff --git a/tools/bugpoint/OptimizerDriver.cpp b/tools/bugpoint/OptimizerDriver.cpp index b08171bc587..3ded5e866b3 100644 --- a/tools/bugpoint/OptimizerDriver.cpp +++ b/tools/bugpoint/OptimizerDriver.cpp @@ -114,6 +114,8 @@ int BugDriver::runPassesAsChild(const std::vector &Passes) { return 0; } +cl::opt SilencePasses("silence-passes", cl::desc("Suppress output of running passes (both stdout and stderr)")); + /// runPasses - Run the specified passes on Program, outputting a bitcode file /// and writing the filename into OutputFile if successful. If the /// optimizations fail for some reason (optimizer crashes), return true, @@ -192,7 +194,12 @@ bool BugDriver::runPasses(const std::vector &Passes, prog = sys::Program::FindProgramByName("valgrind"); else prog = tool; - int result = sys::Program::ExecuteAndWait(prog, args, 0, 0, + + // Redirect stdout and stderr to nowhere if SilencePasses is given + sys::Path Nowhere; + const sys::Path *Redirects[3] = {0, &Nowhere, &Nowhere}; + + int result = sys::Program::ExecuteAndWait(prog, args, 0, (SilencePasses ? Redirects : 0), Timeout, MemoryLimit, &ErrMsg); // If we are supposed to delete the bitcode file or if the passes crashed,