Commit Graph

1337 Commits

Author SHA1 Message Date
Daniel Marjamaki 4d228679df [clang-tidy] Add -target in misc-misplaced-widening-cast test so it will work on various bots
llvm-svn: 260225
2016-02-09 15:43:05 +00:00
Daniel Marjamaki ad3293744a [clang-tidy] Add 'misc-misplaced-widening-cast' check.
Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 260223
2016-02-09 14:08:49 +00:00
Gabor Horvath f7c39d56b6 [clang-tidy] Make readability-container-size-empty work with inline namespaces. Fix PR25812.
llvm-svn: 260217
2016-02-09 10:20:48 +00:00
Gabor Horvath a4fd3beaa2 [clang-tidy] Replace a custom ASTMatcher with a built-in one.
llvm-svn: 260212
2016-02-09 09:26:11 +00:00
Haojian Wu 3d1d076f79 [clang-tidy] Some improvements in 'misc-definitions-in-headers' check.
Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 260108
2016-02-08 16:05:39 +00:00
Haojian Wu 1e3c32b38a [clang-tidy] Fix assertion failure on `at` function in modernize-loop-convert.
Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 260107
2016-02-08 15:59:42 +00:00
Haojian Wu 7a7614757c [clang-tidy] Correct IncorrectRoundings namespace.
Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 260105
2016-02-08 15:54:30 +00:00
Alexander Kornienko c1587dcf4d [clang-tidy] Reshuffled paragraphs a bit, added contents.
llvm-svn: 260100
2016-02-08 15:09:39 +00:00
Alexander Kornienko 7193d9fa95 [clang-tidy] Fix an error in .rst
llvm-svn: 260099
2016-02-08 15:09:34 +00:00
Alexander Kornienko a7faa5b92a [clang-tidy] Update documentation
Summary: We have 2 scripts add_new_check.py and rename_check.py to bootstrap a new check creation. There is also clang-query to aid with the matcher creation. These were not mentioned in the current document, add them so it's available to the masses.

Reviewers: alexfh

Patch by Deniz Türkoglu!

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

llvm-svn: 260098
2016-02-08 15:09:28 +00:00
Aaron Ballman 54391c8ca6 Reverting r260096; it causes build bot failures:
http://bb.pgr.jp/builders/cmake-clang-tools-x86_64-linux/builds/23351
http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/492

llvm-svn: 260097
2016-02-08 14:37:56 +00:00
Aaron Ballman f4490cab0d Expand the simplify boolean expression check to handle implicit conversion of integral types to bool and improve the handling of implicit conversion of member pointers to bool.
Implicit conversion of member pointers are replaced with explicit comparisons to nullptr.

Implicit conversions of integral types are replaced with explicit comparisons to 0.

Patch by Richard Thomson.

llvm-svn: 260096
2016-02-08 14:25:25 +00:00
Haojian Wu 25779e404b [clang-tidy] Move incorrect-roundings to upstream.
Summary: This is originally implemented by Jacques Pienaar.

Reviewers: alexfh

Subscribers: cfe-commits, jpienaar

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

llvm-svn: 260084
2016-02-08 10:16:13 +00:00
Alexander Kornienko f1d54eb222 [clang-tidy] Reformatted docs + minor updates
llvm-svn: 260065
2016-02-08 00:19:29 +00:00
Paul Robinson f868d0b238 Add qualifiers that are about to be necessary. NFC
llvm-svn: 259949
2016-02-05 23:20:02 +00:00
Benjamin Kramer 38b54b82e4 Unbreak the cmake shared build.
llvm-svn: 259880
2016-02-05 11:38:50 +00:00
Haojian Wu c2d7577cc5 [clang-tdiy] Add header file extension configuration support.
Summary: * Add a `HeaderFileExtensions` check option in misc-definitions-in-headers, google-build-namespaces and google-global-names-in-headers.

Reviewers: aaron.ballman, alexfh

Subscribers: cfe-commits

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

llvm-svn: 259879
2016-02-05 11:23:59 +00:00
Haojian Wu 4d67ec3f8c [clang-tidy] More friendly warning in "google-runtime-references" when meeting an unnamed function parameter.
Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 259787
2016-02-04 14:06:49 +00:00
Haojian Wu bbff538e9d [clang-tidy] Fix a crash issue on misc-virtual-near-miss check.
Summary:
The crash is caused by triggering a Assertion failed in DeclCXX.h when the
check detects non-defined class return type in a class method declaration.

Reviewers: congliu, alexfh

Subscribers: cfe-commits

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

llvm-svn: 259668
2016-02-03 17:21:44 +00:00
Haojian Wu 29634fe676 [clang-tidy] bug fix: Don't warn on partial template specialization in `misc-definitions-in-headers` check.
Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 259643
2016-02-03 12:10:27 +00:00
Daniel Jasper 3a6e81c2c1 clang-tidy: [misc-unused-parameters] Ignore template instantiations.
No functional changes intended as we should already do the
corresponding fixes when visiting the primary template. There are
existing tests that verify that we do change unused parameters of
templated functions.

llvm-svn: 259640
2016-02-03 11:33:18 +00:00
Alexander Kornienko abf22eb544 [clang-tidy] Removed unnecessary parameters in the test
llvm-svn: 259531
2016-02-02 17:27:08 +00:00
Alexander Kornienko 26e46d8fae [clang-tidy] Add non-constant references in function parameters check.
Summary: This is implemented originally by Alexander Kornienko.

Reviewers: alexfh

Subscribers: cfe-commits


Patch by Haojian Wu!

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

llvm-svn: 259530
2016-02-02 17:27:01 +00:00
Matthias Braun 48c8426fa2 Fix build problem by lower SmallSet<N> to a reasonable value
llvm-svn: 259424
2016-02-01 22:18:58 +00:00
Eugene Zelenko dde3cd0347 Sort checks alphabetically in ReadabilityTidyModule.cpp.
llvm-svn: 259393
2016-02-01 19:47:24 +00:00
Aaron Ballman c3975b7d6a Add a new check, readability-redundant-control-flow, that check for some forms of redundant control flow statements. Currently checks for return statements at the end of a function with a void return type and continue statements at the end of looping statements.
Patch by Richard Thomson.

llvm-svn: 259362
2016-02-01 15:31:15 +00:00
NAKAMURA Takumi 622f3dcd1d test/clang-tidy/performance-for-range-copy.cpp: Appease for targeting ms mode.
llvm-svn: 259289
2016-01-30 02:15:19 +00:00
Alexander Kornienko d0d8878fb6 [clang-tidy] Don't use delegating constructors, since they are not supported by MSVC 2013
llvm-svn: 259214
2016-01-29 17:35:53 +00:00
Alexander Kornienko 5aebfe2e4a [clang-tidy] ForRangeCopyCheck that warns on and fixes unnecessary copies of loop variables.
Patch by Felix Berger!

Differential revision: http://reviews.llvm.org/D13849

llvm-svn: 259199
2016-01-29 15:54:26 +00:00
Alexander Kornienko bfee5f7352 [clang-tidy] Fix minor style issues. NFC
llvm-svn: 259198
2016-01-29 15:22:20 +00:00
Alexander Kornienko 8ac20a8439 Fixed function params comparison. Updated docs and tests.
Summary: "checkParamTypes" may fail if the the type of some parameter is not canonical. Fixed it by comparing canonical types. And added "getCanonicalType()" and "getCanonicalDecl()" on more places to prevent potential fail.

Reviewers: alexfh

Subscribers: cfe-commits

Patch by Cong Liu!

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

llvm-svn: 259197
2016-01-29 15:22:10 +00:00
Alexander Kornienko 42e8cf4a70 [clang-tidy] Fix style issues. NFC
llvm-svn: 259196
2016-01-29 15:21:43 +00:00
Alexander Kornienko 40d307d120 [clang-tidy] Move implicit-cast-in-loop check to upstream.
Summary: This is implemented originally by Alex Pilkiewicz (pilki@google.com).

Reviewers: alexfh

Subscribers: cfe-commits

Patch by Haojian Wu!

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

llvm-svn: 259195
2016-01-29 15:21:32 +00:00
Hans Wennborg 14bf877e6b docs/conf.py: update copyright year
llvm-svn: 258960
2016-01-27 18:29:16 +00:00
Alexander Kornienko 1b290adc43 [clang-tidy] Fix documentation.
Fixed broken links to cppcoreguidelines (anchors specified in the .md file
should be used, not automatic anchors generated by github).

Fixed formatting, array_view -> span, fixed sphinx errors in
misc-definitions-in-headers.rst.

llvm-svn: 258926
2016-01-27 11:37:19 +00:00
Alexander Kornienko e267dafc13 [clang-tidy] Use relative URL for redirection.
llvm-svn: 258925
2016-01-27 11:37:12 +00:00
Alexander Kornienko ad166f5dcc Add clang-tools-extra documentation to the CMake build.
llvm-svn: 258924
2016-01-27 11:37:08 +00:00
Eugene Zelenko 7da47b8ef5 Fix Clang-tidy modernize-use-override warning in unittests/clang-tidy/IncludeInserterTest.cpp; other minor fixes.
Differential revision: http://reviews.llvm.org/D16566

llvm-svn: 258870
2016-01-26 22:32:24 +00:00
Chris Bieneman 2cc7fec76a Remove autoconf support
Summary:
This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html

"Now I am become Death, the destroyer of worlds."
-J. Robert Oppenheimer

Reviewers: chandlerc, grosbach, bob.wilson, echristo

Subscribers: cfe-commits, klimek

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

llvm-svn: 258864
2016-01-26 21:31:36 +00:00
Jonathan Coe 2c8592a80f Test commit. Fix typo in comment.
llvm-svn: 258835
2016-01-26 18:55:55 +00:00
Alexander Kornienko dc84150e4f Fix crashing on user-defined conversion.
Summary: Fix the assertion failure for the user-defined conversion method. e.g.: operator bool()

Reviewers: alexfh, aaron.ballman

Subscribers: aaron.ballman, cfe-commits

Patch by Cong Liu!

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

llvm-svn: 258801
2016-01-26 10:56:27 +00:00
Aaron Ballman a5d55a4617 Add support to the misc-assert-side-effect check for MSVC-style assert macros, which use !! instead of an if statement or a conditional operator.
llvm-svn: 258714
2016-01-25 20:00:53 +00:00
Gabor Horvath 93bc576ec9 [clang-tidy] Handle decayed types and other improvements in VirtualNearMiss check.
Handle decayed types, ignore qualifiers and accessibility when considering a
method as a possible overload.

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

llvm-svn: 258562
2016-01-22 21:45:51 +00:00
Aaron Ballman b61829887d Make modernize-use-default tolerant of delayed template parsing; this code was previously causing failed assertions because dyn_cast was being passed a null pointer due to the delay-parsed body.
llvm-svn: 258356
2016-01-20 22:14:10 +00:00
Dimitry Andric d325ab8cb8 Ensure the lit.site.cfg and Unit/lit.site.cfg make targets do not use
the same temporary file, otherwise there is a race condition when using
parallel make jobs.

llvm-svn: 258327
2016-01-20 18:53:44 +00:00
Alexander Kornienko e04dd2525c [clang-tidy] Python scripts shebang fixes
Summary:
This patch fixes shebang lines in Python script files.

Most Python scripts in LLVM & Clang are using this shebang line.

[[ https://mail.python.org/pipermail/tutor/2007-June/054816.html | Here]] is an explanaiton of why such line should be used instead of what is currently in these few files.

Reviewers: klimek, alexfh

Subscribers: cfe-commits

Patch by Kirill Bobyrev!

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

llvm-svn: 258133
2016-01-19 16:10:39 +00:00
Alexander Kornienko 3c95377eb1 [clang-tidy] Fixed wording ("clang-tidy check", not "clang-tidy checker")
llvm-svn: 258098
2016-01-18 22:51:09 +00:00
Alexander Kornienko 33c2494b69 [clang-tidy] Fix a copy-paste error.
llvm-svn: 257900
2016-01-15 16:16:47 +00:00
Jonathan Roelofs d60388a985 Teach clang-tidy how to upgrade warnings into errors.
Similar in format to the `-checks=` argument, this new `-warnings-as-errors=`
argument upgrades any warnings emitted by the former to errors.

http://reviews.llvm.org/D15528

llvm-svn: 257642
2016-01-13 17:36:41 +00:00
Alexander Kornienko 3f36fbbeb5 [clang-tidy] Slightly clarified comments.
llvm-svn: 257600
2016-01-13 14:16:43 +00:00