[clang-scan-deps] Add verbose mode

When running in the default mode we don't print anything other than actual output to stdout to make automated processing easier.

Differential Revision: https://reviews.llvm.org/D67522

llvm-svn: 372174
This commit is contained in:
Jan Korous 2019-09-17 19:45:24 +00:00
parent e2c61d726e
commit 1b87364f51
1 changed files with 9 additions and 2 deletions

View File

@ -177,6 +177,11 @@ llvm::cl::opt<bool> SkipExcludedPPRanges(
"until reaching the end directive."),
llvm::cl::init(true), llvm::cl::cat(DependencyScannerCategory));
llvm::cl::opt<bool> Verbose("v", llvm::cl::Optional,
llvm::cl::desc("Use verbose output."),
llvm::cl::init(false),
llvm::cl::cat(DependencyScannerCategory));
} // end anonymous namespace
/// \returns object-file path derived from source-file path.
@ -284,8 +289,10 @@ int main(int argc, const char **argv) {
std::mutex Lock;
size_t Index = 0;
llvm::outs() << "Running clang-scan-deps on " << Inputs.size()
<< " files using " << NumWorkers << " workers\n";
if (Verbose) {
llvm::outs() << "Running clang-scan-deps on " << Inputs.size()
<< " files using " << NumWorkers << " workers\n";
}
for (unsigned I = 0; I < NumWorkers; ++I) {
auto Worker = [I, &Lock, &Index, &Inputs, &HadErrors, &WorkerTools]() {
while (true) {