Граф коммитов

29 Коммитов

Автор SHA1 Сообщение Дата
Piotr Padlewski 889329f9f2 Add boost-use-to-string
http://reviews.llvm.org/D18136

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@268079 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 17:58:29 +00:00
Benjamin Kramer d99fffa95b [clang-tidy] Add "clang-tidy as a clang plugin" skeleton.
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
2016-03-03 08:58:12 +00:00
Alexander Kornienko cfa943ba85 [clang-tidy] Add UnnecessaryCopyInitialization check to new "performance" module in ClangTidy
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
2015-12-30 10:24:40 +00:00
Aaron Ballman d2ec07d917 Add a new module for the C++ Core Guidelines, and the first checker for those guidelines: cppcoreguidelines-pro-type-reinterpret-cast.
Patch by Matthias Gehre!

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@249399 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-06 13:31:00 +00:00
Aaron Ballman 40646627cf Adding a new clang-tidy module to house CERT-specific checkers, and map existing checkers to CERT secure coding rules and recommendations for both C (https://www.securecoding.cert.org/confluence/display/c/SEI+CERT+C+Coding+Standard) and C++ (https://www.securecoding.cert.org/confluence/pages/viewpage.action?pageId=637).
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@249130 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-02 13:27:19 +00:00
Alexander Kornienko 844122ab7c [clang-tidy] Move IncludeSorter.* and IncludeInserter.* to clang-tidy/utils/
This is better structurally and it also fixes a linker error in the configure
build.


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@245052 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 14:31:31 +00:00
Alexander Kornienko 78f15552b8 [clang-tidy] Create clang-tidy module modernize. Add pass-by-value check.
This is the first step for migrating cppmodernize to clang-tidy.

http://reviews.llvm.org/D11946

Patch by Angel Garcia!


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@245045 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 13:17:11 +00:00
Manuel Klimek 8bc93b0d43 Fix strict dependency uncovered by windows bot.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@244598 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 13:11:29 +00:00
Manuel Klimek 9340f00dcb Add an IncludeInserter to clang-tidy.
Will be used to allow checks to insert includes at the right position.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@244586 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 11:37:48 +00:00
NAKAMURA Takumi d1e04ffeb3 [CMake] Add dependencies on clangToolingCore.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@220890 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-30 00:44:01 +00:00
Alexander Kornienko 30fdf3337b Add NamespaceCommentCheck to the Google module.
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
2014-09-22 10:41:39 +00:00
Benjamin Kramer 4d4f7226e0 [clang-tidy] Add a generic header guard checker + LLVM implementation.
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
2014-08-13 13:57:57 +00:00
Alp Toker dfd9ace057 Track clang r213171
The clang rewriter is now a core facility.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213172 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-16 16:50:17 +00:00
NAKAMURA Takumi 479bfce77e [CMake] Update libdeps.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212920 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-14 05:01:53 +00:00
Alexander Kornienko daa7400882 Add clang-tidy -line-filter option to filter findings by line ranges.
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
2014-05-22 16:07:11 +00:00
Alexander Kornienko abb8eaee37 Added a module for checks not related to LLVM or Google coding style.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@202970 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-05 13:14:32 +00:00
NAKAMURA Takumi 61727cdab2 [CMake] Use LINK_LIBS instead of target_link_libraries().
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@202238 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-26 06:41:29 +00:00
NAKAMURA Takumi f13446e67f [CMake] Apply DEPENDS to clangTidy.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@201977 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-23 13:43:01 +00:00
Alexander Kornienko 9f497ca294 Re-applied r198807, r198808 with an additional change to fix linking in configure Release+Asserts build.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@198875 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-09 16:31:25 +00:00
Alexander Kornienko 6b32d80efc Reverted r198807, r198808, as they cause link errors in configure builds. Will look at this later.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@198832 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-09 02:21:52 +00:00
Alexander Kornienko 02b6612627 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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@198807 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-08 23:30:40 +00:00
Alexander Kornienko e50ff0cc51 Rework of r198404 to avoid changes in the build configuration.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@198405 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-03 10:50:17 +00:00
NAKAMURA Takumi e983483afe clang-tody: Rework r198403, to fix build.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@198404 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-03 10:24:51 +00:00
NAKAMURA Takumi 8f09b43367 clang-tidy: Fix build since r198402 in the case that the source tree of clang-tools-extra is not located on clang/tools/extra.
FIXME: Get rid of private headers in other modules.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@198403 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-03 09:49:13 +00:00
NAKAMURA Takumi e50d2fe35e [CMake] clang-tools-extra: Update dependencies.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@196860 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-10 01:41:10 +00:00
NAKAMURA Takumi 65b22001ec [CMake] clang-tools-extra may not depend on LLVM CodeGen.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@196805 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-09 19:27:57 +00:00
Manuel Klimek b6cf4afd66 Make clang's static analyzer checks available through clang-tidy.
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
2013-11-14 15:49:44 +00:00
Daniel Jasper 83616dd322 Fix clang-tidy dependencies and bad file comment.
This addresses comments in post-commit review of r187345.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@187707 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-04 15:56:30 +00:00
Daniel Jasper 62bb8df359 Initial architecture for clang-tidy.
This is the first version of a possible clang-tidy architecture. The
purpose of clang-tidy is to detect errors in adhering to common coding
patterns, e.g. described in the LLVM Coding Standards.

This is still heavily in flux.

Review: http://llvm-reviews.chandlerc.com/D884

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@187345 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-29 08:19:24 +00:00