Commit Graph

1893 Commits

Author SHA1 Message Date
Zachary Turner 8c9a7d7c41 Fix a few oversights in the clang-tidy VS plugin.
Over-zealous cleanup of using statements removed some that were
actually needed.  Also cleaned up a few warnings.

llvm-svn: 280844
2016-09-07 19:41:19 +00:00
Zachary Turner 1122be8e15 Add a clang-tidy visual studio extension.
For now this only adds the UI necessary to configure clang-tidy
settings graphically, and it enables reading in and saving out
of .clang-tidy files.  It does not actually run clang-tidy on
any source files yet.

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

llvm-svn: 280840
2016-09-07 18:28:55 +00:00
Zachary Turner b7a619c1fa Resubmit "Add a test for clang-tidy using the clang-cl driver."
This was originally reverted because the patch on the clang
tooling side was reverted.  That patch is being resubmitted,
so this patch is resubmitted as well.

llvm-svn: 280839
2016-09-07 18:28:42 +00:00
Haojian Wu cd63701245 [include-fixer] Support finding headers for the symbol under cursor.
Summary:
* Add a `query-symbol` option to query symbol without parsing the source file.
* Update Vim & Emacs integration scripts.

Reviewers: bkramer, massberg

Subscribers: cfe-commits

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

llvm-svn: 280824
2016-09-07 16:34:35 +00:00
Eugene Zelenko 1a14e4734e [include-fixer] Fix some Clang-tidy modernize-use-override and Include What You Use warnings; other minor fixes.
Differential revision: https://reviews.llvm.org/D24179

llvm-svn: 280741
2016-09-06 19:53:26 +00:00
Eugene Zelenko 31c9621320 [Release notes] Fix links.
Differential revision: https://reviews.llvm.org/D24201

llvm-svn: 280725
2016-09-06 17:52:44 +00:00
Kirill Bobyrev cd369a3802 [clang-rename] Add comment after namespace closing
llvm-svn: 280653
2016-09-05 09:42:02 +00:00
Kirill Bobyrev 8769778aca [clang-rename] Enforce LLVM policy about braces around single line control flow statement body.
Although it is not explicitly stated in LLVM Coding Standards, LLVM developers
prefer to omit braces around flow control statements with single line body.

For example the following piece of code

```
if (condition)
  std::cout << "Hello, world!" << std::endl;
```

is preferred to

```
if (condition) {
  std::cout << "Hello, world!" << std::endl;
}
```

So far clang-rename has ignored this. This patch makes clang-rename more
"LLVM-ish".

llvm-svn: 280640
2016-09-04 22:50:41 +00:00
Kirill Bobyrev 9504e3a4f0 [clang-rename] add failing test
For some reason clang-rename fails to rename method of templated class. Add
XFAIL test reproducing the issue.

llvm-svn: 280639
2016-09-04 22:28:39 +00:00
Kirill Bobyrev b2e2c19978 [clang-rename] Fix Clang-tidy and IWYU warnings; other minor fixes
Patch by Eugene Zelenko!

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

Reviewers: omtcyfz
llvm-svn: 280638
2016-09-04 22:19:52 +00:00
Hans Wennborg 5a39e2b0a5 Remove link to clang's release notes; keeping it up-to-date is hard
llvm-svn: 280539
2016-09-02 20:39:46 +00:00
Alexander Shaposhnikov bf3c84cff7 Add clang-reorder-fields to clang-tools-extra
This diff adds v0 of clang-reorder-fields tool to clang/tools/extra.
The main idea behind this tool is to simplify and make less error-prone refactoring of large codebases when
someone needs to change the order fields of a struct/class (for example to remove excessive padding).

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

llvm-svn: 280456
2016-09-02 02:56:07 +00:00
Alexander Shaposhnikov 3efddd22b9 Revert https://reviews.llvm.org/D23279 because the tests have failed on several platforms
llvm-svn: 280438
2016-09-02 00:24:06 +00:00
Alexander Shaposhnikov ae4ff453a4 Add clang-reorder-fields to clang-tools-extra
This diff adds v0 of clang-reorder-fields tool to clang/tools/extra.
The main idea behind this tool is to simplify and make less error-prone refactoring of large codebases when
someone needs to change the order fields of a struct/class (for example to remove excess padding).

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

llvm-svn: 280431
2016-09-01 23:49:48 +00:00
Haojian Wu 25df3b853b [include-fixer] Fix an undefined variable exception in vim script when there is
only one candidate header.

llvm-svn: 280359
2016-09-01 12:17:28 +00:00
Haojian Wu 997c31e54b [clang-tidy docs] Add missing option docs.
Reviewers: alexfh, Eugene.Zelenko, aaron.ballman

Subscribers: aaron.ballman, cfe-commits

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

llvm-svn: 280236
2016-08-31 13:21:18 +00:00
Haojian Wu 544a8d03ab [docs] Fix docs build error.
llvm-svn: 280235
2016-08-31 13:17:48 +00:00
Piotr Padlewski d57be707b8 [clang-tidy] modernize-make-{smart_ptr} private ctor bugfix
Summary:
Bugfix for 27321. When the constructor of stored pointer
type is private then it is invalid to change it to
make_shared or make_unique.

Reviewers: alexfh, aaron.ballman, hokein

Subscribers: cfe-commits

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

llvm-svn: 280180
2016-08-31 00:06:55 +00:00
Eugene Zelenko 8899d52c18 [Release notes] Fix highlighting.
llvm-svn: 280119
2016-08-30 17:47:07 +00:00
Haojian Wu 2c5ee4454d [clang-tidy docs] Fix build errors on Sphinx 1.4.6
llvm-svn: 280095
2016-08-30 14:29:36 +00:00
NAKAMURA Takumi 795a1e9a15 clang-tools-extra/test/clang-tidy/misc-move-forwarding-reference.cpp: Appease ms targets with -fno-delayed-template-parsing.
llvm-svn: 280078
2016-08-30 12:34:03 +00:00
Martin Bohme b1ce6c6d57 [clang-tidy] Add check 'misc-move-forwarding-reference'
Summary:
The check emits a warning if std::move() is applied to a forwarding reference, i.e. an rvalue reference of a function template argument type.

If a developer is unaware of the special rules for template argument deduction on forwarding references, it will seem reasonable to apply std::move() to the forwarding reference, in the same way that this would be done for a "normal" rvalue reference.

This has a consequence that is usually unwanted and possibly surprising: If the function that takes the forwarding reference as its parameter is called with an lvalue, that lvalue will be moved from (and hence placed into an indeterminate state) even though no std::move() was applied to the lvalue at the callsite.

As a fix, the check will suggest replacing the std::move() with a std::forward().

This patch requires D23004 to be submitted before it.

Reviewers: sbenza, aaron.ballman

Subscribers: klimek, etienneb, alexfh, aaron.ballman, Prazek, Eugene.Zelenko, mgehre, cfe-commits

Projects: #clang-tools-extra

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

llvm-svn: 280077
2016-08-30 12:11:12 +00:00
Miklos Vajna 5a99207d11 clang-rename: fix formatting in USRFinder
As detected by clang-format.

llvm-svn: 280063
2016-08-30 07:24:57 +00:00
Miklos Vajna 2e5fca77a6 clang-rename: improve error message when -old-name is used and could not find symbol
Old output was:

clang-rename: could not find symbol at tools/clang/tools/extra/test/clang-rename/ClassFindByName.cpp:1:1 (offset 0).

Reviewers: omtcyfz

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

llvm-svn: 280062
2016-08-30 07:23:24 +00:00
Sylvestre Ledru 24b481370a Fix some typos in the doc
llvm-svn: 279944
2016-08-28 20:33:42 +00:00
Eugene Zelenko 8e8fa78821 [Clang-tidy] Fix some checks documentation style.
Differential revision: https://reviews.llvm.org/D23894

llvm-svn: 279846
2016-08-26 17:46:51 +00:00
Haojian Wu 0a1986790c [clang-tidy] Some tweaks on header guard checks.
* Implement missing storeOption interfaces.
* Remove unnecessary parameter copy in isHeaderFileExtension.
* Fix doc style.

llvm-svn: 279814
2016-08-26 11:15:38 +00:00
Mads Ravn 041b804a9f [clang-tidy] Added hh, hxx and hpp to header guard checks.
Changed the extension check to include the option of ",h,hh,hpp,hxx" instead of just returning whether the file ended with ".h".

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

llvm-svn: 279803
2016-08-26 05:59:53 +00:00
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