This doesn't really do much at the moment. You can load it via libclang
and set the -checks via an extra command line argument as illustrated in
the test case. Support for other options (including headers check) is
currently missing. Also when using this with libclang some checks may
not work with the precompiled preamble in place.
This can be used to easily show clang-tidy warnings in an editor
integration as all that's needed is adding command line flags that are
passed into libclang. Warnings and FixIts are exposed via the existing
CXDiagnostic machinery.
Differential Revision: http://reviews.llvm.org/D17807
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@262595 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
The patch adds a new ClangTidy check that detects when expensive-to-copy types are unnecessarily copy initialized from a const reference that has the same or are larger scope than the copy.
It currently only detects this when the copied variable is const qualified. But this will be extended to non const variables if they are only used in a const fashion.
Reviewers: alexfh
Subscribers: cfe-commits
Patch by Felix Berger!
Differential Revision: http://reviews.llvm.org/D15623
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@256632 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
This uses a bit hacky way to set the defaults for the spaces before
comments, but it's also one of the simplest ways. Fixed a bug with how the
SpacesBeforeComments option was used.
Reviewers: djasper
Reviewed By: djasper
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D5410
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@218240 91177308-0d34-0410-b5e6-96231b3b80d8
The implementation is split into a generic part and a LLVM-specific part.
Other codebases can implement it with their own style. The specific features
supported are:
- Verification (and fixing) of header guards against a style based on the file path
- Automatic insertion of header guards for headers that are missing them
- A warning when the header guard doesn't enable our fancy header guard optimization
(e.g. when there's an include preceeding the guard)
- Automatic insertion of a comment with the guard name after #endif.
For the LLVM style we disable #endif comments for now, they're not very common
in the codebase. We also only flag headers in the include directories, there
doesn't seem to be a common style outside.
Differential Revision: http://reviews.llvm.org/D4867
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@215548 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
This is going to be used for a clang-tidy-diff script to display
warnings in changed lines only. The option uses JSON, as its value is not
intended to be entered manually.
Reviewers: klimek
Reviewed By: klimek
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D3873
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@209450 91177308-0d34-0410-b5e6-96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@198807 91177308-0d34-0410-b5e6-96231b3b80d8
This is implemented in a way that the current static analyzer
architecture allows, in the future we might want to revisit this.
With this change static analyzer checks are available from clang-tidy
by specifying -checks=clang-analyzer-<name>.
This change also fixes the use of the compilation database to allow
clang-tidy to be used like any other clang tool.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@194707 91177308-0d34-0410-b5e6-96231b3b80d8