[clang-tools-extra] r198767 - Don't emit diagnostics for system headers.
Alexander Kornienko
alexfh at google.com
Wed Jan 8 07:21:08 PST 2014
Author: alexfh
Date: Wed Jan 8 09:21:08 2014
New Revision: 198767
URL: http://llvm.org/viewvc/llvm-project?rev=198767&view=rev
Log:
Don't emit diagnostics for system headers.
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2519
Modified:
clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.h
Modified: clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.h?rev=198767&r1=198766&r2=198767&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.h (original)
+++ clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.h Wed Jan 8 09:21:08 2014
@@ -116,6 +116,10 @@ public:
// library.
virtual void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
const Diagnostic &Info) LLVM_OVERRIDE {
+ // FIXME: Ensure that we don't get notes from user code related to errors
+ // from non-user code.
+ if (Diags->getSourceManager().isInSystemHeader(Info.getLocation()))
+ return;
if (DiagLevel != DiagnosticsEngine::Note) {
Errors.push_back(ClangTidyError(getMessage(Info)));
} else {
More information about the cfe-commits
mailing list