summaryrefslogtreecommitdiff
path: root/tools/bugpoint
diff options
context:
space:
mode:
authorMatthijs Kooijman <matthijs@stdin.nl>2008-06-12 13:02:26 +0000
committerMatthijs Kooijman <matthijs@stdin.nl>2008-06-12 13:02:26 +0000
commitfbea227f41348157191a0217ecb110cc015e9a4f (patch)
tree0e8d9357936f4756eb5227557befca952bb0ebc9 /tools/bugpoint
parentcf45ca04084e7888051cc6ec9c9c37e10a118ee6 (diff)
downloadllvm-fbea227f41348157191a0217ecb110cc015e9a4f.tar.gz
llvm-fbea227f41348157191a0217ecb110cc015e9a4f.tar.bz2
llvm-fbea227f41348157191a0217ecb110cc015e9a4f.tar.xz
Add -silence-passes option to bugpoint. This option suppresses output generated
when bugpoint is running passes in a child process. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52234 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint')
-rw-r--r--tools/bugpoint/OptimizerDriver.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/bugpoint/OptimizerDriver.cpp b/tools/bugpoint/OptimizerDriver.cpp
index b08171bc58..3ded5e866b 100644
--- a/tools/bugpoint/OptimizerDriver.cpp
+++ b/tools/bugpoint/OptimizerDriver.cpp
@@ -114,6 +114,8 @@ int BugDriver::runPassesAsChild(const std::vector<const PassInfo*> &Passes) {
return 0;
}
+cl::opt<bool> 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<const PassInfo*> &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,