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

1178 Коммитов

Автор SHA1 Сообщение Дата
NAKAMURA Takumi 8bece3e60d Move an extra switch to clang-tools-extra/test/clang-tidy/misc-unused-parameters.cpp from check_clang_tidy.sh.
It also rolls back r242984 and r242985.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@243491 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-28 22:41:04 +00:00
Daniel Jasper a79ece6c03 misc-unused-parameters: Only remove parameters in the main source file.
In headers, they might always be pulled in to different TUs, even if
they are declared static or nested in an unnamed namespace.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@243414 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-28 13:19:12 +00:00
Daniel Jasper dffd1a4b60 misc-unused-parameters: Properly handle static class members.
Not sure why I wrote what I wrote before.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@243403 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-28 10:39:25 +00:00
Alexander Kornienko 2270a1f22c [clang-tidy] Set current main file name in tests.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@243272 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-27 14:54:31 +00:00
Aaron Ballman c87458d456 Trying again to a failing test the bots found with r243266.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@243269 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-27 13:59:24 +00:00
Aaron Ballman 4ac25ac173 Fixing a failing test the bots found with r243266.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@243268 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-27 13:47:35 +00:00
Daniel Jasper 09ebdf95ad misc-unused-parameters: Don't warn on ParmVarDecls in the return type.
As there don't seem to be a good way of formulating a matcher that
finds all pairs of functions and their ParmVarDecls, just match on
functionDecls and iterate over their parameters. This should also be
more efficient as some checks are only performed once per function.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@243267 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-27 13:46:37 +00:00
Aaron Ballman b691165aaf Updating the documentation for clang-tidy. Removes some non-ASCII characters from the documentation, and removes shell-specific single quote characters as they cause issues for some shells (such as on Windows).
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@243266 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-27 13:41:30 +00:00
Alexander Kornienko 33bc520278 [clang-tidy] Don't duplicate the leading slash.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@243265 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-27 13:07:50 +00:00
Daniel Jasper 6e44d3b7e5 misc-unused-parameters: Fix bug where the check was looking at
ParmVarDecls of function types.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@243026 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 17:26:36 +00:00
NAKAMURA Takumi 5740081a2e Fix the shell script check_clang_tidy.sh in r242984.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@242985 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 06:03:40 +00:00
NAKAMURA Takumi 44409b7dcc Appease test/clang-tidy/misc-unused-parameters.cpp for targeting *-win32, to add -fno-delayed-template-parsing.
Note, clang-tidy tests wouldn't run on Windows hosts since they are disabled with REQUIRES:shell.
The failure would be raised with cross building.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@242984 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 05:52:02 +00:00
Daniel Jasper e5e1975ff4 misc-unused-parameters: Fix handling of parameters in template functions.
The parameters of the function templates were being marked as
incorrectly be marked as unused. Added a test for this and changed the
check to use the same

  isReferenced() || !getDeclName()

logic as Sema::DiagnoseUnusedParameters.
Patch Scott Wallace, thank you!

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@242912 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 17:30:35 +00:00
Daniel Jasper e6f41b8dce Extend misc-unused-parameters to delete parameters of local functions.
Also see: llvm.org/PR24180.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@242659 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 03:42:38 +00:00
Daniel Jasper ad683268d8 Initial version of clang-tidy check to find and fix unused parameters.
Also see: llvm.org/PR24180.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@242654 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 01:06:44 +00:00
Benjamin Kramer cebf34aad3 [clang-modernize] Don't rely on iterator auto-dereferencing.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@242607 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-18 14:35:41 +00:00
Hans Wennborg 0a57cf6acb docs/conf.py: bump version to 3.8
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@242247 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-14 23:37:08 +00:00
John Thompson 1109a22b65 Added mechanism to modularize for doing a compilation precheck
to determine files that have comnpilation or dependency problems.
A new -display-file-lists option use this to display lists of good files
(no compile errors), problem files, and a combined list with
problem files preceded by a '#'.  The problem files list can be
used in the module map generation assistant mode to exclude
problem files.  The combined files list can be used during module
map development.  See added docs.


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@241880 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-10 00:37:25 +00:00
John Thompson f2c69a9438 Fixed line-endings.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@241744 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-08 22:00:56 +00:00
John Thompson 6020cf4d1d Fixed erroneous comments.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@241726 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-08 21:05:57 +00:00
John Thompson 7a33bc52b4 Fixed erroneous comment.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@241724 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-08 20:57:32 +00:00
Yaron Keren 15eba5ef95 Revert r241330. It compiled with Visual C++ 2013 and gcc 4.9.1 (mingw) but now fails the bots.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@241335 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-03 09:30:33 +00:00
Yaron Keren 002088f626 Replace some const std::string & with llvm::StringRef or std::string
and std::move to avoid implicit std::string construction.

Patch by Eugene Kosov.



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@241330 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-03 09:16:20 +00:00
Daniel Marjamaki d947af800e [clang-tidy] Enhance clang-tidy misc-macro-repeated-side-effects...
Enhance clang-tidy misc-macro-repeated-side-effects to handle ? and : better.

When ? is used in a macro, there are 2 possible control flow paths through the macro.
These paths are tracked separately so problems can be detected properly.

http://reviews.llvm.org/D10653



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@241245 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 07:49:55 +00:00
Daniel Marjamaki 4763f24973 [clang-tidy] minor coding style tweak. make functions static.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@241160 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 13:29:27 +00:00
Alexander Kornienko ddc0d245d5 [clang-tidy] Enhance clang-tidy readability-simplify-boolean-expr...
Enhance clang-tidy readability-simplify-boolean-expr to handle 'if (e) return
true; return false;' and improve replacement expressions.

This changeset extends the simplify boolean expression check in clang-tidy to
simplify if (e) return true; return false; to return e; (note the lack of an
else clause on the if statement.) By default, chained conditional assignment is
left unchanged, unless a configuration parameter is set to non-zero to override
this behavior.

It also improves the handling of replacement expressions to apply
static_cast<bool>(expr) when expr is not of type bool.

http://reviews.llvm.org/D9810

Patch by Richard Thomson!



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@241155 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 12:39:40 +00:00
Daniel Marjamaki 05592be802 [clang-tidy] Fix false positives in the macro parentheses checker
Summary:
There were false positives in C++ code where macro argument was a type.

Reviewers: alexfh

Differential Revision: http://reviews.llvm.org/D10801



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@240938 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 12:18:11 +00:00
Daniel Marjamaki b13d08f986 [clang-tidy] Fix false positives in misc-macro-parentheses checker
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@240399 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 12:45:14 +00:00
David Blaikie 8cfc1774fc Update for LLVM API change to return by InputArgList directly (rather than by pointer) from ParseArgs
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@240348 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 22:06:58 +00:00
David Blaikie c5a819de78 Update for ParseARgs ArrayRef-ification
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@240239 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-21 06:58:19 +00:00
Adrian Prantl f06b273ba6 Add missing dependency clangFrontend to clangQuery.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@240227 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 19:28:07 +00:00
Adrian Prantl cd17542212 Add missing dependency clangFrontend to unit test.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@240226 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20 19:21:04 +00:00
Justin Bogner e868ba55cb clang-tidy: Remove an unused private field. NFC
Clang was warning on this.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@239988 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-18 04:15:04 +00:00
Daniel Marjamaki b797d494fb clang-tidy: Add checker that warn when macro argument with side effects is repeated in the macro
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@239909 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-17 14:19:35 +00:00
Alexander Kornienko cff0e2dae7 [clang-tidy] Move user-defined matches to unnamed namespaces to prevent ODR violations.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@239904 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-17 13:11:37 +00:00
Daniel Marjamaki 0866fd184d clang-tidy: Add checker that warns about missing parentheses in macros
* calculations in the replacement list should be inside parentheses
* macro arguments should be inside parentheses



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@239820 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-16 14:27:31 +00:00
John Thompson 769f1da062 Fixed modularize to warn about missing headers referenced in a module map.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@239122 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-04 23:35:19 +00:00
Samuel Benzaquen f72b8a68db [clang-tidy] Force braces around leaf 'else if' for consistency.
Summary:
Force braces around leaf 'else if' for consistency.
This complements r233697.

Reviewers: alexfh

Subscribers: curdeius, cfe-commits

Differential Revision: http://reviews.llvm.org/D10245

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@239054 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-04 16:36:58 +00:00
John Thompson a756a4524c Fixed option description. '=' is required.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@238998 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-04 01:12:56 +00:00
John Thompson 0c5c442be6 Fixed option comment. '=' is required.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@238997 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-04 01:10:19 +00:00
Rafael Espindola 2aa28eef40 Update for clang API change.
Patch by Косов Евгений.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@238775 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 20:00:20 +00:00
Szabolcs Sipos 060433ce22 [clang-tidy] Fix for llvm.org/PR23355
misc-static-assert and misc-assert-side-effect will handle __builtin_expect based asserts correctly.


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@238548 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-29 09:49:59 +00:00
Alexander Kornienko 83140c0926 [clang-tidy] Renamed misc-noexcept-move-ctors to misc-noexcept-move-constructor
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@238326 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 14:24:11 +00:00
Alexander Kornienko a599a4dccc [clang-tidy] misc-noexcept-move-ctors should ignore implicit constructors and assignments.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@238202 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 14:35:09 +00:00
Alexander Kornienko 048422ba2c [clang-tidy] Don't issue most google-readability-casting warnings on .c files included in other files.
This is done sometimes for testing purposes, and the check needs to handle this
consistently.


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@238193 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 10:47:48 +00:00
Szabolcs Sipos 796a0a9994 [clang-tidy] Fix for llvm.org/PR23572
misc-static-assert won't report asserts whose conditions contain calls to non constexpr functions.


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@238098 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-23 14:21:01 +00:00
Alexander Kornienko 1fbea31870 Add a clang-tidy check for move constructors/assignment ops without noexcept.
Summary:
Add a clang-tidy check (misc-noexcept-move-ctors) for move constructors
and assignment operators not using noexcept.

http://llvm.org/PR23519

Reviewers: klimek

Reviewed By: klimek

Subscribers: curdeius, cfe-commits

Differential Revision: http://reviews.llvm.org/D9933

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@238013 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 10:31:17 +00:00
Alexander Kornienko 24d00fedd5 [clang-tidy] Disable google-readability-casting for .c files and their headers.
Some people have reasons to compile their .c files as C++ in some configurations
(e.g. for testing purposes), so just looking at LangOptions is not enough. This
patch disables the check on all .c files (and also for the headers included from
.c files).



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@237905 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-21 14:08:56 +00:00
Reid Kleckner e536262053 Copy lit shell changes from clang to clang-tools-extra, excluding some failing tests
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@237832 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20 20:33:18 +00:00
Justin Bogner 6736b82a87 docs: Spell a couple of cmake options with =ON in the docs
Patch by Albert Astals Cid. Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@237554 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 05:05:49 +00:00