From d89349b08256ee4de350a13a4d18ce2b964b5991 Mon Sep 17 00:00:00 2001 From: Jan Korous Date: Tue, 17 Sep 2019 19:45:24 +0000 Subject: [PATCH] [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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372174 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/clang-scan-deps/ClangScanDeps.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/clang-scan-deps/ClangScanDeps.cpp b/tools/clang-scan-deps/ClangScanDeps.cpp index 6e8d9a9ed9..ebb42c0346 100644 --- a/tools/clang-scan-deps/ClangScanDeps.cpp +++ b/tools/clang-scan-deps/ClangScanDeps.cpp @@ -177,6 +177,11 @@ llvm::cl::opt SkipExcludedPPRanges( "until reaching the end directive."), llvm::cl::init(true), llvm::cl::cat(DependencyScannerCategory)); +llvm::cl::opt 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) { -- 2.40.0