r372174 - [clang-scan-deps] Add verbose mode

Jan Korous via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 17 12:45:24 PDT 2019


Author: jkorous
Date: Tue Sep 17 12:45:24 2019
New Revision: 372174

URL: http://llvm.org/viewvc/llvm-project?rev=372174&view=rev
Log:
[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

Modified:
    cfe/trunk/tools/clang-scan-deps/ClangScanDeps.cpp

Modified: cfe/trunk/tools/clang-scan-deps/ClangScanDeps.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-scan-deps/ClangScanDeps.cpp?rev=372174&r1=372173&r2=372174&view=diff
==============================================================================
--- cfe/trunk/tools/clang-scan-deps/ClangScanDeps.cpp (original)
+++ cfe/trunk/tools/clang-scan-deps/ClangScanDeps.cpp Tue Sep 17 12:45:24 2019
@@ -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) {




More information about the cfe-commits mailing list