[PATCH] D33013: Driver must return non-zero code on errors in command line
Alexander Kornienko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon May 15 04:54:36 PDT 2017
alexfh added inline comments.
================
Comment at: lib/Tooling/CompilationDatabase.cpp:208
IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = new DiagnosticOptions();
- UnusedInputDiagConsumer DiagClient;
+ TextDiagnosticPrinter DiagnosticPrinter(llvm::errs(), &*DiagOpts);
+ UnusedInputDiagConsumer DiagClient(DiagnosticPrinter);
----------------
This code is used as a library not only for command-line tools. Directly using stderr is wrong in many use cases of the Tooling library. It should instead somehow let the user of the library get these errors via a provided DiagnosticConsumer. Not sure how to do this here without a more careful reading of the code, but wanted to let you know that this change causes a regression at least for clang-tidy (and likely for many other Clang tools).
https://reviews.llvm.org/D33013
More information about the cfe-commits
mailing list