summaryrefslogtreecommitdiffstats
path: root/clang/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
commitd5f7196feb7da50564c5ad444f5fd3fecf08f340 (patch)
tree43e6c203d59ec62a657fba22caccce869ced99b6 /clang/lib/Tooling/Tooling.cpp
parentc0cad9836342a8aa6b0664412e769ae46bd49acd (diff)
downloadbcm5719-llvm-d5f7196feb7da50564c5ad444f5fd3fecf08f340.tar.gz
bcm5719-llvm-d5f7196feb7da50564c5ad444f5fd3fecf08f340.zip
[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 llvm-svn: 364474
Diffstat (limited to 'clang/lib/Tooling/Tooling.cpp')
-rw-r--r--clang/lib/Tooling/Tooling.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Tooling/Tooling.cpp b/clang/lib/Tooling/Tooling.cpp
index a7c64866a48..291df0ae333 100644
--- a/clang/lib/Tooling/Tooling.cpp
+++ b/clang/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 {
OpenPOWER on IntegriCloud