From 24d531c5bb2b8946ebe2253e24194fd63f3acbe7 Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Wed, 26 Jun 2019 21:11:51 +0000 Subject: [clang-scan-deps] Introduce the DependencyScanning library with the thread worker code and better error handling This commit extracts out the code that will powers the fast scanning worker into a new file in a new DependencyScanning library. The error and output handling is improved so that the clients can gather errors/results from the worker directly. Differential Revision: https://reviews.llvm.org/D63681 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@364474 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Tooling/Tooling.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/Tooling/Tooling.cpp') diff --git a/lib/Tooling/Tooling.cpp b/lib/Tooling/Tooling.cpp index a7c64866a4..291df0ae33 100644 --- a/lib/Tooling/Tooling.cpp +++ b/lib/Tooling/Tooling.cpp @@ -517,7 +517,8 @@ int ClangTool::run(ToolAction *Action) { if (!Invocation.run()) { // FIXME: Diagnostics should be used instead. - llvm::errs() << "Error while processing " << File << ".\n"; + if (PrintErrorMessage) + llvm::errs() << "Error while processing " << File << ".\n"; ProcessingFailed = true; } } @@ -569,6 +570,10 @@ void ClangTool::setRestoreWorkingDir(bool RestoreCWD) { this->RestoreCWD = RestoreCWD; } +void ClangTool::setPrintErrorMessage(bool PrintErrorMessage) { + this->PrintErrorMessage = PrintErrorMessage; +} + namespace clang { namespace tooling { -- cgit v1.2.1