Skip to content

Commit

Permalink
[clang-scan-deps] Add verbose mode
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jkorous-apple committed Sep 17, 2019
1 parent e2c61d7 commit 1b87364
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions clang/tools/clang-scan-deps/ClangScanDeps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 1b87364

Please sign in to comment.