Commit Graph

61 Commits

Author SHA1 Message Date
Alexander Kornienko 9de3a98c4e Fixed a crash when handling diagnostics without a valid file location, e.g. 'error reading <file>'.
llvm-svn: 202987
2014-03-05 15:44:36 +00:00
Chandler Carruth edc9e38810 [cleanup] Re-sort headers with llvm/utils/sort_includes.py.
llvm-svn: 202809
2014-03-04 10:03:05 +00:00
Alexander Kornienko 31219d3abd Added a naive NOLINT implementation.
Summary:
Added a naive NOLINT implementation. It doesn't care about specific
linter categories, just the "// NOLINT" on the same line as a diagnostic.

Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2896

llvm-svn: 202452
2014-02-28 00:27:50 +00:00
Alexander Kornienko 54461eb389 Improve clang-tidy diagnostic output and filtering.
Summary:
This patch introduces several improvements to clang-tidy diagnostic;
  1. Make filtering of messages from non-user code more reliable. Output an
     error when it or any of the related notes touches user code. This fixes an
     assertion when an error has a location in a system header, and one of the
     notes relates to user code.
  2. In order for 1. to work, subscribe to the static analyzer diagnostics using
     a custom PathDiagnosticConsumer.
  3. Enable colors on supported terminals.
  4. Output FixItHints.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2714

llvm-svn: 200924
2014-02-06 14:50:10 +00:00
Alexander Kornienko 6d129d5454 Fix crash when handling an argument parsing-related warning.
Summary: Don't crash on warnings coming before the translation unit starts.

Reviewers: klimek, djasper

Reviewed By: djasper

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2676

llvm-svn: 200702
2014-02-03 15:55:35 +00:00
Alp Toker a143676664 Fix another invalid getCustomDiagID() use to unbreak the build
It was calling the utility wrapper that now requires a constant string
following clang r200132. The StringRef version on DiagnosticIDs appears to have
been what was intended so change to that.

llvm-svn: 200142
2014-01-26 08:36:03 +00:00
Alexander Kornienko 41bfe8dde1 Add the check name to the clang-tidy diagnostic output.
Summary:
Pass check names all the way from ClangTidyModule through
ClangTidyCheck and ClangTidyContext to ClangTidyError, and output it in
handleErrors. This allows to find mis-behaving check and disable it easily.

Reviewers: djasper, klimek

Reviewed By: djasper

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2534

llvm-svn: 199094
2014-01-13 10:50:51 +00:00
Alexander Kornienko 0ba86b73aa Re-applied r198807, r198808 with an additional change to fix linking in configure Release+Asserts build.
llvm-svn: 198875
2014-01-09 16:31:25 +00:00
Alexander Kornienko 73f7b0273e Reverted r198807, r198808, as they cause link errors in configure builds. Will look at this later.
llvm-svn: 198832
2014-01-09 02:21:52 +00:00
Alexander Kornienko 875288bd82 Updated file comment.
llvm-svn: 198808
2014-01-08 23:35:01 +00:00
Alexander Kornienko a89f99c1e2 Restructured code, no functional changes.
Summary:
Moved implementation of classes declared in
ClangTidyDiagnosticConsumer.h to ClangTidyDiagnosticConsumer.cpp.
Added a FIXME note in ClangTidyDiagnosticConsumer::HandleDiagnostic.

Reviewers: klimek, djasper

Reviewed By: klimek

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2520

llvm-svn: 198807
2014-01-08 23:30:40 +00:00