After upgrading clang 17 ---> 18, libtooling (which I call programmatically) displays something like "[2/2] Processing file /full/path.cpp." for each file I feed it. How do I suppress this message?
Thanks.
There are two places that Clang can print "Processing file", but only one was recently introduced, so you're probably seeing the message added to Clang 18 by PR 75904.
The added code, in clang/lib/Tooling/Tooling.cpp
, looks like:
if (NumOfTotalFiles > 1)
llvm::errs() << "[" + std::to_string(++ProcessedFileCounter) + "/" +
std::to_string(NumOfTotalFiles) +
"] Processing file " + File
<< ".\n";
Unfortunately, this change did not include a mechanism to disable it.
So the options I see are:
Remove that code from your copy of the source and rebuild.
Arrange to only pass one source file at a time.
Not use the Tooling library. Personally, I use ASTUnit::loadFromCompilerInvocation
in order to have more control over tool startup and command line processing, and that approach would, as it happens, also avoid that particular message. (This isn't a recommendation, just an option.)