summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] Handle decayed types and other improvements in VirtualNearMiss ↵Gabor Horvath2016-01-223-38/+43
| | | | | | | | | | | 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
* Make modernize-use-default tolerant of delayed template parsing; this code ↵Aaron Ballman2016-01-202-0/+9
| | | | | | was previously causing failed assertions because dyn_cast was being passed a null pointer due to the delay-parsed body. llvm-svn: 258356
* Ensure the lit.site.cfg and Unit/lit.site.cfg make targets do not useDimitry Andric2016-01-201-6/+6
| | | | | | | the same temporary file, otherwise there is a race condition when using parallel make jobs. llvm-svn: 258327
* [clang-tidy] Python scripts shebang fixesAlexander Kornienko2016-01-193-3/+3
| | | | | | | | | | | | | | | | | | | 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
* [clang-tidy] Fixed wording ("clang-tidy check", not "clang-tidy checker")Alexander Kornienko2016-01-1812-12/+12
| | | | llvm-svn: 258098
* [clang-tidy] Fix a copy-paste error.Alexander Kornienko2016-01-151-1/+1
| | | | llvm-svn: 257900
* Teach clang-tidy how to upgrade warnings into errors.Jonathan Roelofs2016-01-1310-19/+106
| | | | | | | | | 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
* [clang-tidy] Slightly clarified comments.Alexander Kornienko2016-01-131-2/+2
| | | | llvm-svn: 257600
* Support virtual-near-miss check.Alexander Kornienko2016-01-137-0/+418
| | | | | | | | | | | | | | Summary: Virtual function override near miss detection. Function complete. Test complete. Do not conduct Fix for now. Reviewers: alexfh Subscribers: cfe-commits Patch by Cong Liu! Differential Revision: http://reviews.llvm.org/D15823 llvm-svn: 257599
* Add extra tests for handling throw() and noexcept() specifiers.Aaron Ballman2016-01-121-0/+11
| | | | | | Patch by Adrian Zgorzałek llvm-svn: 257522
* Add documentation redirects for clang-tidy checkers that are exposed under ↵Aaron Ballman2016-01-1114-7/+90
| | | | | | multiple checker names. Updates the Python script for adding checks to properly handle these aliases. llvm-svn: 257347
* [clang-tidy] Fix a false positive in google-runtime-memsetAlexander Kornienko2016-01-112-11/+17
| | | | | | | | | | | | | | | | | google-runtime-memset no longer issues a warning if the fill char value is known to be an invalid fill char count. Namely, it no longer warns for these: memset(p, 0, 0); memset(p, -1, 0); In both cases, swapping the last two args would either be useless (there is no actual bug) or wrong (it would introduce a bug). Patch by Matt Armstrong! llvm-svn: 257320
* [clang-tidy] Add non-inline function definition and variable definition ↵Alexander Kornienko2016-01-089-1/+350
| | | | | | | | | | | | | | | | check in header files. Summary: The new check will find all functionand variable definitions which may violate cpp one definition rule in header file. Reviewers: aaron.ballman, alexfh Subscribers: aaron.ballman, cfe-commits Patch by Haojian Wu! Differential Revision: http://reviews.llvm.org/D15710 llvm-svn: 257178
* Disable part of the misc-move-constructor-init checker when the check is ↵Aaron Ballman2016-01-085-16/+51
| | | | | | enabled through cert-oop11-cpp. The CERT guideline does not cover moveable parameters as part of the OOP11-CPP recommendation, just copy construction from move constructors. llvm-svn: 257177
* [clang-tidy] Use proper capitalization and punctuation for diagnostic messages.Alexander Kornienko2016-01-0810-43/+43
| | | | | | Use diagnostic parameters where possible instead of string concatenation. llvm-svn: 257176
* Fix typo.Eugene Zelenko2016-01-041-1/+1
| | | | llvm-svn: 256780
* Rename the CERT namespace to cert, and update some checkers to use this ↵Aaron Ballman2016-01-049-10/+20
| | | | | | | | namespace consistently. Patch thanks to Haojian Wu! llvm-svn: 256756
* [clang-tidy] Don't use delegating constructorsAlexander Kornienko2015-12-301-1/+2
| | | | llvm-svn: 256637
* [clang-tidy] Use hasLocalStorage() to identify unnecessary copy ↵Alexander Kornienko2015-12-302-2/+5
| | | | | | | | | | | | | | initializations to exclude static local variables. Summary: Since local static variables can outlive other local variables exclude them from the unnecessary copy initialization check. Reviewers: alexfh Patch by Felix Berger! Differential Revision: http://reviews.llvm.org/D15822 llvm-svn: 256636
* [clang-tidy] Add the missing MakefileAlexander Kornienko2015-12-301-0/+12
| | | | llvm-svn: 256634
* [clang-tidy] Fix configure buildAlexander Kornienko2015-12-301-1/+2
| | | | llvm-svn: 256633
* [clang-tidy] Add UnnecessaryCopyInitialization check to new "performance" ↵Alexander Kornienko2015-12-3012-1/+393
| | | | | | | | | | | | | | | | | | | 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 llvm-svn: 256632
* [clang-tidy] Fix a use-after-free bug found by asanAlexander Kornienko2015-12-291-2/+3
| | | | llvm-svn: 256562
* [clang-tidy] Fix capitalization of the message in the exampleAlexander Kornienko2015-12-291-1/+1
| | | | llvm-svn: 256559
* [clang-tidy] Don't generate duplicated blank line in add_new_check.py script.Alexander Kornienko2015-12-291-2/+0
| | | | | | | | | | | | Reviewers: alexfh Subscribers: cfe-commits Patch by Haojian Wu! Differential Revision: http://reviews.llvm.org/D15803 llvm-svn: 256554
* Orphaning these RST files; each one is retained only for link backwards ↵Aaron Ballman2015-12-283-0/+6
| | | | | | compatibility. llvm-svn: 256517
* [clang-tidy] Fix a false positive case in ContainerSizeEmpty check.Gabor Horvath2015-12-282-6/+15
| | | | llvm-svn: 256504
* [clang-tidy] Preserve comments and preprocessor directives when simplifying ↵Alexander Kornienko2015-12-283-39/+96
| | | | | | | | | | | | | | | | | | boolean expressions This changeset still emits the diagnostic that the expression could be simplified, but it doesn't generate any fix-its that would lose comments or preprocessor directives within the text that would be replaced. Fixes PR25842 Reviewers: alexfh Subscribers: xazax.hun, cfe-commits Patch by Richard Thomson! (+a naming style fix) Differential Revision: http://reviews.llvm.org/D15737 llvm-svn: 256492
* Renaming CERT documentation files to use the CERT rule identifiers. This is ↵Aaron Ballman2015-12-279-8/+8
| | | | | | for consistency with other checkers, where the documentation file name matches the checker name. NFC of the checkers. llvm-svn: 256474
* [clang-tidy] Added documentation for modernize-redundant-void-argAlexander Kornienko2015-12-222-0/+19
| | | | llvm-svn: 256261
* [clang-tidy] Updates to documentation: formatting, titles, etc.Alexander Kornienko2015-12-2278-11/+170
| | | | llvm-svn: 256259
* Updated year (2014-2015).Alexander Kornienko2015-12-222-2/+2
| | | | llvm-svn: 256254
* [clang-tools-extra] Text formattingAlexander Kornienko2015-12-221-7/+8
| | | | llvm-svn: 256253
* Fix a false positive case in ContainerSizeEmpty check (PR25893).Gabor Horvath2015-12-212-0/+9
| | | | llvm-svn: 256142
* check-clang-tools requires clang-headers due to test/clang-tidy.NAKAMURA Takumi2015-12-211-0/+3
| | | | | | clang-modernize provided clang-headers but it was removed. llvm-svn: 256133
* Remove clang-modernize.Alexander Kornienko2015-12-17148-14152/+6
| | | | | | | | | | | | | | Summary: clang-modernize transforms have moved to clang-tidy. Removing the old tool now. Reviewers: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15606 llvm-svn: 255886
* [clang-tidy] google-readability-namespace-comments: ignore stray semicolonsAlexander Kornienko2015-12-162-1/+14
| | | | llvm-svn: 255772
* [clang-tidy] Add namespace support to add_new_check.pyAlexander Kornienko2015-12-161-4/+10
| | | | | | | | | | | | | | Summary: Without namespace you can not create checks with same name in different modules Reviewers: alexfh Subscribers: cfe-commits Patch by Cong Liu! Differential Revision: http://reviews.llvm.org/D15571 llvm-svn: 255770
* [clang-tidy] Don't use diag() for debug outputAlexander Kornienko2015-12-161-11/+3
| | | | llvm-svn: 255765
* [clang-tidy] Fix a crash in misc-new-delete-overloadsAlexander Kornienko2015-12-162-42/+43
| | | | llvm-svn: 255758
* [clang-tidy] Check for suspicious string assignments.Gabor Horvath2015-12-157-0/+208
| | | | | | | | | | | It is possible to assign arbitrary integer types to strings. Sometimes it is the result of missing to_string call or apostrophes. Reviewers: alexfh Differential Revision: http://reviews.llvm.org/D15411 llvm-svn: 255630
* clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-constant-arra ↵NAKAMURA Takumi2015-12-132-2/+2
| | | | | | y-index*.cpp: Don't assume size_t were unsigned int. llvm-svn: 255475
* [clang-tidy] add check cppcoreguidelines-pro-bounds-constant-array-indexMatthias Gehre2015-12-138-0/+346
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is http://reviews.llvm.org/D13746 but instead of including <array>, a stub is provided. This check flags all array subscriptions on static arrays and std::arrays that either have a non-compile-time-constant index or are out of bounds. Dynamic accesses into arrays are difficult for both tools and humans to validate as safe. array_view is a bounds-checked, safe type for accessing arrays of data. at() is another alternative that ensures single accesses are bounds-checked. If iterators are needed to access an array, use the iterators from an array_view constructed over the array. This rule is part of the "Bounds safety" profile of the C++ Core Guidelines, see https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#-bounds2-only-index-into-arrays-using-constant-expressions Reviewers: alexfh, sbenza, bkramer, aaron.ballman Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15030 llvm-svn: 255470
* [clang-tidy] Fix PR25812.Gabor Horvath2015-12-122-26/+27
| | | | llvm-svn: 255431
* Add a license clarification for use of links and titles of CERT secure ↵Aaron Ballman2015-12-102-2/+23
| | | | | | coding guidelines. llvm-svn: 255248
* [clang-tidy] Sort includes case-sensitively.Alexander Kornienko2015-12-101-4/+1
| | | | | | | | | The motivation is: 1. consistency with clang-format, vim :sort etc. 2. we don't want the tools to depend on the current locale to do the include sorting llvm-svn: 255243
* There were problems if a relative path is used for an include path, the path ↵John Thompson2015-12-101-2/+2
| | | | | | will be normalized to ./xxx. I don't know how to test this in a way that will work in a separated source/output environment, but it seems reasonable to assume that -I options won't be for provate directories. llvm-svn: 255199
* Added coverage check for extensionless headers, and exclude hidden dot ↵John Thompson2015-12-045-2/+13
| | | | | | directoryies. llvm-svn: 254785
* clang-tidy readability identifiers: better diagnostic locationMike Aizatsky2015-12-042-50/+50
| | | | | | | | | | | | Summary: With this change the error reported is on the identifier location itself. It was declaration location before. Reviewers: alexfh Differential Revision: http://reviews.llvm.org/D15203 llvm-svn: 254766
* Backing out 254635 until I have a good workaround and test case.John Thompson2015-12-041-1/+1
| | | | llvm-svn: 254756
OpenPOWER on IntegriCloud