summaryrefslogtreecommitdiff
path: root/lib/Tooling/Tooling.cpp
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2019-06-26 21:11:51 +0000
committerAlex Lorenz <arphaman@gmail.com>2019-06-26 21:11:51 +0000
commit24d531c5bb2b8946ebe2253e24194fd63f3acbe7 (patch)
treec0f86ec8c2dfc5949e6b533bfe8ff81a2c2c0a02 /lib/Tooling/Tooling.cpp
parenta057056821e096990964f3416835c8477eb1b6bf (diff)
downloadclang-24d531c5bb2b8946ebe2253e24194fd63f3acbe7.tar.gz
[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
Diffstat (limited to 'lib/Tooling/Tooling.cpp')
-rw-r--r--lib/Tooling/Tooling.cpp7
1 files changed, 6 insertions, 1 deletions
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 {