Commit Graph

1865 Commits

Author SHA1 Message Date
Alexander Kornienko eedcd9c1ea [clang-tidy misc-move-const-arg] more specific messages + suggest alternative solution
llvm-svn: 279666
2016-08-24 21:23:24 +00:00
Eugene Zelenko 5f45722b03 Clang-tidy documentation style. Two Google checks are aliases.
Differential revision: https://reviews.llvm.org/D23815

llvm-svn: 279659
2016-08-24 20:05:36 +00:00
Eugene Zelenko 29da951a3a [Documentation] Fix style of Clang-tidy readability-non-const-parameter.
llvm-svn: 279541
2016-08-23 17:57:24 +00:00
Alexander Kornienko bb56052b66 [clang-tidy] Merge ExtraArgs(Before) instead of overriding them.
Added proper tests.

llvm-svn: 279519
2016-08-23 14:48:29 +00:00
Alexander Kornienko 42fd75ea86 [clang-tidy] Fix the order of ExtraArgsBefore
Added tests for the relative order of -extra-arg(-before) and ExtraArgs(Before).

llvm-svn: 279516
2016-08-23 14:13:31 +00:00
Daniel Marjamaki 9e4ecfaec7 [clang-tidy] readability-non-const-parameter: add new check that warns when function parameters should be const
The check will warn when the constness will make the function interface safer.

Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D15332

llvm-svn: 279507
2016-08-23 10:09:08 +00:00
Eugene Zelenko f0ae81da0b Fix style in some Clang-tidy checks documentation.
Differential revision: https://reviews.llvm.org/D23728

llvm-svn: 279494
2016-08-23 00:19:43 +00:00
Alexander Kornienko 179c18d338 [clang-tidy docs] Further cleanup of options
llvm-svn: 279442
2016-08-22 17:19:23 +00:00
Kirill Bobyrev 405699ef1d minor header guards and help messages cleanup
llvm-svn: 279226
2016-08-19 09:36:14 +00:00
Eugene Zelenko a1c76530d9 [Documentation] Fixed style in modernize-use-emplace.rst.
llvm-svn: 279170
2016-08-18 22:11:27 +00:00
Alexander Kornienko 0f85498a0b [clang-tidy docs] Move option descriptions to the Options section
+ random fixes

llvm-svn: 279115
2016-08-18 18:43:47 +00:00
Alexander Kornienko 93794b2351 [clang-tidy docs] Minor fix
llvm-svn: 279051
2016-08-18 11:12:03 +00:00
Alexander Kornienko 23768f4d03 [clang-tidy docs] Fix formatting.
llvm-svn: 279050
2016-08-18 11:10:52 +00:00
Alexander Kornienko 76eae751b5 [clang-tidy docs] Fix build errors on Sphinx 1.4.5
llvm-svn: 279049
2016-08-18 11:06:09 +00:00
Eugene Zelenko cb93ba56ec [Release notes] Mention Emacs integration in Include-fixer.
llvm-svn: 279009
2016-08-17 23:36:22 +00:00
Eugene Zelenko c139a1c252 [Documentation] Remove duplicated checks groups descriptions from clang-tidy/index.rst.
Differential revision: https://reviews.llvm.org/D23596

llvm-svn: 279006
2016-08-17 23:20:00 +00:00
Zachary Turner 4178b0b611 Revert "Add a test for clang-tidy using the clang-cl driver."
This reverts commit fd1908ce445eba4544d64cc68b3c03249e4bf614.

This should be the correct CL to revert.  The clang-side patch
that enabled this functionality was reverted, so this test needs
to be reverted until it gets fixed.

llvm-svn: 278979
2016-08-17 21:01:13 +00:00
Zachary Turner d08eb4b8bf Revert "Revert "[Include-fixer] Install executables and support scripts""
This reverts commit 2aff596257e1c45fa54baae823ecbe61a785174e.

I'm having a bad day apparently.  I reverted the wrong CL.  This
puts it back.

llvm-svn: 278978
2016-08-17 20:58:14 +00:00
Zachary Turner e5fba53bed Revert "[Include-fixer] Install executables and support scripts"
This reverts commit b725a314a9b7f746c37f70909ec3c4dcb6d9f6b5.

The patch that made this test work needed to be reverted, so this
test needs to be reverted as well.

llvm-svn: 278977
2016-08-17 20:56:47 +00:00
Zachary Turner e4d8225e72 Add a test for clang-tidy using the clang-cl driver.
Reviewed By: alexfh
Differential Revision: https://reviews.llvm.org/D23480

llvm-svn: 278968
2016-08-17 20:14:10 +00:00
Eugene Zelenko 473da657c7 [Include-fixer] Install executables and support scripts
Differential revision: https://reviews.llvm.org/D23045

llvm-svn: 278949
2016-08-17 17:27:56 +00:00
Martin Bohme e9a265a267 Adapt to TraverseLambdaCapture interface change from D23204
Summary:
Depends on D23204.

This is intended to be submitted immediately after D23204 lands.

Reviewers: jdennett, alexfh

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D23543

llvm-svn: 278934
2016-08-17 15:00:22 +00:00
Haojian Wu ab37264aa7 [include-fixer] Update -help message.
llvm-svn: 278922
2016-08-17 11:31:19 +00:00
Reid Kleckner 23c2eac34d Remove most instances of REQUIRES: shell from the tools/extra tests
None of these tests actually require bash, they just have quoting bugs
when paths contain backslashes and colons. Fix them with the "%/T" lit
substitution variants.

llvm-svn: 278815
2016-08-16 16:07:46 +00:00
Haojian Wu 80c1c9f6d8 [clang-tidy] readability-implicit-bool-cast forgets to store its options.
Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D23544

llvm-svn: 278791
2016-08-16 11:15:05 +00:00
Kirill Bobyrev bc84fc9f1d [clang-rename] fix broken build
As Eric Fiselier pointed out, r278760 breaks build, because RecursiveASTVisitor
doesn't have a const overload. This patch is a quick fix.

llvm-svn: 278780
2016-08-16 06:19:06 +00:00
Kirill Bobyrev 6b7d8c2944 [clang-rename] cleanup `auto` usages
As Alexander pointed out, LLVM Coding Standards are more conservative about
using auto, i.e. it should be used in the following situations:

* When the type is obvious, i.e. explicitly mentioned in the same expression.
For example `if (const clang::FieldDecl *FieldDecl = Initializer->getMember())`.
* When the type is totally non-obvious and one iterates over something. For
example
`for (const auto &CurrDecl : Context.getTranslationUnitDecl()->decls())`.

Otherwise the type should be explicitly stated.

Reviewers: alexfh

Differential Revision: https://reviews.llvm.org/D23397

llvm-svn: 278760
2016-08-15 23:20:05 +00:00
Eugene Zelenko d09a44a220 [Documentation] Improve checks groups descriptions in clang-tidy/index.rst
Use table to avoid tautology. List all existing checks groups. Use alphabetical order.

Differential revision: https://reviews.llvm.org/D23471

llvm-svn: 278686
2016-08-15 17:44:29 +00:00
Alexander Droste 1512f9a0f9 [clang-tidy] MPIBufferDerefCheck
...
This check verifies if a buffer passed to an MPI (Message Passing Interface)
function is sufficiently dereferenced. Buffers should be passed as a single
pointer or array. As MPI function signatures specify void * for their buffer
types, insufficiently dereferenced buffers can be passed, like for example
as double pointers or multidimensional arrays, without a compiler warning
emitted.

Instructions on how to apply the check can be found at:
https://github.com/0ax1/MPI-Checker/tree/master/examples

Reviewers: Haojian Wu
Differential revision: https://reviews.llvm.org/D22729

llvm-svn: 278553
2016-08-12 19:30:31 +00:00
Zachary Turner 6a91af7eb7 Remove accidentally committed file.
llvm-svn: 278547
2016-08-12 18:39:05 +00:00
Zachary Turner 18cfbc4b8e Analyze include order on a per-file basis.
The include order check would get notified of all include
directives in a depth-first manner.  This created the
possibility of an include directive from a header file
interfering with the sort order of a set of two distinct
blocks from the top level cpp file, if that include directive
was on just the right line.

With this patch we bucket the include directives by the file
in which they appear in and process one bucket at a time,
so that directives from different files do not get mixed
together into the same list.

Reviewed By: alexfh
Differential Revision: https://reviews.llvm.org/D23434

llvm-svn: 278546
2016-08-12 18:38:26 +00:00
Kirill Bobyrev c018e4d665 [clang-tidy] fix readability-else-after-return test
As pointed by Yung Douglas, exceptions in
test/clang-tidy/readability-else-after-return.cpp are causing PS4 bots to be
red, because exceptions aren't enabled by default on PS4 target. This patch is a
fix.

llvm-svn: 278324
2016-08-11 08:18:39 +00:00
Eugene Zelenko 3ed5011d51 [Documentation] Improve consistency.
Mention Clang-rename Emacs integration in release notes.

llvm-svn: 278295
2016-08-10 22:00:49 +00:00
Eugene Zelenko 9ef6b6b4f4 [Documentation] Fix style and grammar mistake in Clang-tidy readability-else-after-return description spotted by Alexander Kornienko.
llvm-svn: 278279
2016-08-10 19:49:38 +00:00
Eugene Zelenko 12b0acc727 [Documentation] Highlighting consistency and spelling mistake fix in Clang-tidy readability-else-after-return description.
llvm-svn: 278263
2016-08-10 18:30:14 +00:00
Eugene Zelenko cdfdb4f110 [Release Notes] Consistency in Clang-tidy entries' style.
llvm-svn: 278262
2016-08-10 18:15:51 +00:00
Kirill Bobyrev 34789edbbf [clang-tidy] enhance readability-else-after-return
`readability-else-after-return` only warns about `return` calls, but LLVM Coding
Standars stat that `throw`, `continue`, `goto`, etc after `return` calls are
bad, too.

Reviwers: alexfh, aaron.ballman

Differential Revision: https://reviews.llvm.org/D23265

llvm-svn: 278257
2016-08-10 18:05:47 +00:00
Eugene Zelenko 7fa868b31d [Documentation] Fix grammar mistakes in docs/clang-tidy/index.rst spotted by Alexander Kornienko.
llvm-svn: 278255
2016-08-10 18:02:15 +00:00
Kirill Bobyrev 8694cb97c2 [clang-tidy] minor improvements in modernise-deprecated-headers check
This patch introduces a minor list of changes as proposed by Richard Smith in
the mailing list.

See original comments with an impact on the future check state below:

[comments.begin

> +                          {"complex.h", "ccomplex"},

It'd be better to convert this one to <complex>, or leave it alone.
<ccomplex> is an unnecessary wart.

(The contents of C++11's <complex.h> / <ccomplex> / <complex> (all of
which are identical) aren't comparable to C99's <complex.h>, so if
this was C++98 code using the C99 header, the code will be broken with
or without this transformation.)

> +                          {"iso646.h", "ciso646"},

Just delete #includes of this one. <ciso646> does nothing.

> +              {"stdalign.h", "cstdalign"},
> +              {"stdbool.h", "cstdbool"},

We should just delete these two includes. These headers do nothing in C++.

comments.end]

Reviewers: alexfh, aaron.ballman

Differential Revision: https://reviews.llvm.org/D17990

llvm-svn: 278254
2016-08-10 18:01:45 +00:00
Kirill Bobyrev 607f50cdb3 [clang-rename] fix test introduced in r278221
llvm-svn: 278225
2016-08-10 13:46:36 +00:00
Kirill Bobyrev 3168418a7c [clang-rename] remove bunch of deprecated tests
llvm-svn: 278223
2016-08-10 13:32:37 +00:00
Kirill Bobyrev 77f522cb42 [clang-rename] merge tests when possible
The only difference between some tests is -offset passed to clang-rename. It
makes sense to merge them into a single file and add multiple tool invocations.

Reviewers: alexfh

Differential Revision: https://reviews.llvm.org/D23158

llvm-svn: 278221
2016-08-10 13:28:30 +00:00
Miklos Vajna c29c81a03f clang-rename YAML reader: address post-commit comments
llvm-svn: 278201
2016-08-10 07:13:29 +00:00
Eugene Zelenko b614148024 [Documentation] Fix spelling mistakes in docs/clang-tidy/index.rst.
llvm-svn: 278198
2016-08-10 01:55:51 +00:00
Miklos Vajna 3d71b51bc5 clang-rename rename-all: support reading old/newname pairs from a YAML file
This is handy in case by the time clang-rename is invoked, an external
tool already genereated a list of oldname -> newname pairs to handle.

Reviewers: omtcyfz

Differential Revision: https://reviews.llvm.org/D23198

llvm-svn: 278145
2016-08-09 18:20:41 +00:00
Kirill Bobyrev 7fa3395364 [clang-rename] cleanup: use isWritten
nit: use isWritten and const auto *Initializer in
NamedDeclFindingASTVisitor::VisitCXXConstructorDecl method.
Test plan: make -j8 check-clang-tools (passed)

Patch by Alexander Shaposhnikov!

Reviewers: omtcyfz

Differential Revision: https://reviews.llvm.org/D23298

llvm-svn: 278112
2016-08-09 10:03:33 +00:00
Simon Pilgrim 6cfad71fd7 Fix Wdocumentation unknown parameter warning
llvm-svn: 278111
2016-08-09 10:02:11 +00:00
Haojian Wu c99f72868d [include-fixer] Support processing multiple files in one run.
Summary:
Previously, if we pass multiple files or a file pattern (e.g. /path/to/*.cc) to
include-fixer, include-fixer will apply all replacements to the first argument,
which probably causes crashes.

With this patch, include-fixer can process multiple files now.

Vim and Emacs integration are tested manually.

Reviewers: bkramer

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D23266

llvm-svn: 278102
2016-08-09 08:26:19 +00:00
Eric Liu 7e5445267f Fix clang-tidy crash when a single fix is applied on multiple files.
Summary:
tooling::Replacements only holds replacements for a single file, so
this patch makes Fix a map from file paths to tooling::Replacements so that it
can be applied on multiple files.

Reviewers: hokein, alexfh

Subscribers: Prazek, cfe-commits

Differential Revision: https://reviews.llvm.org/D23257

llvm-svn: 278101
2016-08-09 07:54:49 +00:00
Kirill Bobyrev 31fd7fb5e6 [clang-rename] fix bug with initializer lists
Clang-rename is currently not able to find a symbol in initializer list. This
patch fixes described issue.

Reviewers: alexfh

Differential Revision: https://reviews.llvm.org/D23193

llvm-svn: 278099
2016-08-09 07:14:48 +00:00