libtooling

clang 18 libtooling: How to suppress "processing file" message?


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.


Solution

  • 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: