Index: lib/Tooling/AllTUsExecution.cpp =================================================================== --- lib/Tooling/AllTUsExecution.cpp +++ lib/Tooling/AllTUsExecution.cpp @@ -53,6 +53,11 @@ } // namespace +static llvm::cl::opt Filter( + "filter", + llvm::cl::desc("Only process files that match this filter"), + llvm::cl::init(".*")); + AllTUsToolExecutor::AllTUsToolExecutor( const CompilationDatabase &Compilations, unsigned ThreadCount, std::shared_ptr PCHContainerOps) @@ -110,7 +115,10 @@ llvm::errs() << "Error while getting current working directory: " << EC.message() << "\n"; } + llvm::Regex RegexFilter(Filter); for (std::string File : Files) { + if (Filter.getNumOccurrences() != 0 && !RegexFilter.match(File)) + continue; Pool.async( [&](std::string Path) { Log("[" + std::to_string(Count()) + "/" + TotalNumStr +