diff options
author | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2019-06-11 14:14:24 +0000 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2019-06-11 14:14:24 +0000 |
commit | 8edd8da4874d79e07a6398088d6831b74758dbc2 (patch) | |
tree | 670318825b057b29721c55872b0503cf0c2411e4 /clang/tools/libclang/Indexing.cpp | |
parent | 9487963244e4c805cf0f5798d903bdb10012b59d (diff) | |
download | bcm5719-llvm-8edd8da4874d79e07a6398088d6831b74758dbc2.tar.gz bcm5719-llvm-8edd8da4874d79e07a6398088d6831b74758dbc2.zip |
[libclang] Allow skipping warnings from all included files
Depending on the included files and the used warning flags, e.g. -
Weverything, a huge number of warnings can be reported for included
files. As processing that many diagnostics comes with a performance
impact and not all clients are interested in those diagnostics, add a
flag to skip them.
Differential Revision: https://reviews.llvm.org/D48116
llvm-svn: 363067
Diffstat (limited to 'clang/tools/libclang/Indexing.cpp')
-rw-r--r-- | clang/tools/libclang/Indexing.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/tools/libclang/Indexing.cpp b/clang/tools/libclang/Indexing.cpp index ad3dc70ea3d..63bae0717c4 100644 --- a/clang/tools/libclang/Indexing.cpp +++ b/clang/tools/libclang/Indexing.cpp @@ -443,10 +443,14 @@ static CXErrorCode clang_indexSourceFile_Impl( if (CXXIdx->isOptEnabled(CXGlobalOpt_ThreadBackgroundPriorityForIndexing)) setThreadBackgroundPriority(); - bool CaptureDiagnostics = !Logger::isLoggingEnabled(); + CaptureDiagsKind CaptureDiagnostics = CaptureDiagsKind::All; + if (TU_options & CXTranslationUnit_IgnoreNonErrorsFromIncludedFiles) + CaptureDiagnostics = CaptureDiagsKind::AllWithoutNonErrorsFromIncludes; + if (Logger::isLoggingEnabled()) + CaptureDiagnostics = CaptureDiagsKind::None; CaptureDiagnosticConsumer *CaptureDiag = nullptr; - if (CaptureDiagnostics) + if (CaptureDiagnostics != CaptureDiagsKind::None) CaptureDiag = new CaptureDiagnosticConsumer(); // Configure the diagnostics. |