- 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),