Commit Graph

1304 Commits

Author SHA1 Message Date
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
Alexander Kornienko 98ba0813e6 Support virtual-near-miss check.
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
2016-01-13 14:16:35 +00:00
Aaron Ballman 1b47f38fd5 Add extra tests for handling throw() and noexcept() specifiers.
Patch by Adrian Zgorzałek

llvm-svn: 257522
2016-01-12 21:08:27 +00:00
Aaron Ballman f5f9bf415c Add documentation redirects for clang-tidy checkers that are exposed under multiple checker names. Updates the Python script for adding checks to properly handle these aliases.
llvm-svn: 257347
2016-01-11 16:48:26 +00:00
Alexander Kornienko dcbe5a9d17 [clang-tidy] Fix a false positive in google-runtime-memset
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
2016-01-11 10:26:29 +00:00
Alexander Kornienko b816ba0fb3 [clang-tidy] Add non-inline function definition and variable definition 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
2016-01-08 16:37:11 +00:00
Aaron Ballman c00ad6c5fb Disable part of the misc-move-constructor-init checker when the check is 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
2016-01-08 15:50:51 +00:00
Alexander Kornienko b1b2f87e37 [clang-tidy] Use proper capitalization and punctuation for diagnostic messages.
Use diagnostic parameters where possible instead of string concatenation.

llvm-svn: 257176
2016-01-08 15:21:40 +00:00
Eugene Zelenko 2f5baba613 Fix typo.
llvm-svn: 256780
2016-01-04 21:25:10 +00:00
Aaron Ballman 1284f04aed Rename the CERT namespace to cert, and update some checkers to use this namespace consistently.
Patch thanks to Haojian Wu!

llvm-svn: 256756
2016-01-04 14:31:14 +00:00
Alexander Kornienko 1589071288 [clang-tidy] Don't use delegating constructors
llvm-svn: 256637
2015-12-30 11:39:30 +00:00
Alexander Kornienko 8d228dda41 [clang-tidy] Use hasLocalStorage() to identify unnecessary copy 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
2015-12-30 11:35:50 +00:00
Alexander Kornienko 72a96c66b2 [clang-tidy] Add the missing Makefile
llvm-svn: 256634
2015-12-30 10:56:00 +00:00
Alexander Kornienko 34c2ab8388 [clang-tidy] Fix configure build
llvm-svn: 256633
2015-12-30 10:44:08 +00:00
Alexander Kornienko b959f4c338 [clang-tidy] Add UnnecessaryCopyInitialization check to new "performance" 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
2015-12-30 10:24:40 +00:00
Alexander Kornienko 254825a356 [clang-tidy] Fix a use-after-free bug found by asan
llvm-svn: 256562
2015-12-29 16:14:38 +00:00
Alexander Kornienko 1daf4cbc74 [clang-tidy] Fix capitalization of the message in the example
llvm-svn: 256559
2015-12-29 13:28:10 +00:00
Alexander Kornienko 5de730ef47 [clang-tidy] Don't generate duplicated blank line in add_new_check.py script.
Reviewers: alexfh

Subscribers: cfe-commits

Patch by Haojian Wu!

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

llvm-svn: 256554
2015-12-29 11:05:35 +00:00
Aaron Ballman 5910a00039 Orphaning these RST files; each one is retained only for link backwards compatibility.
llvm-svn: 256517
2015-12-28 19:59:15 +00:00
Gabor Horvath 1f30cf6b40 [clang-tidy] Fix a false positive case in ContainerSizeEmpty check.
llvm-svn: 256504
2015-12-28 17:20:33 +00:00
Alexander Kornienko 4f74ec0dd8 [clang-tidy] Preserve comments and preprocessor directives when simplifying 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
2015-12-28 13:21:22 +00:00
Aaron Ballman a6ab2efed2 Renaming CERT documentation files to use the CERT rule identifiers. This is for consistency with other checkers, where the documentation file name matches the checker name. NFC of the checkers.
llvm-svn: 256474
2015-12-27 19:14:55 +00:00
Alexander Kornienko ef064f8ace [clang-tidy] Added documentation for modernize-redundant-void-arg
llvm-svn: 256261
2015-12-22 18:13:00 +00:00
Alexander Kornienko 785e5223d3 [clang-tidy] Updates to documentation: formatting, titles, etc.
llvm-svn: 256259
2015-12-22 17:36:49 +00:00
Alexander Kornienko 677f3fb215 Updated year (2014-2015).
llvm-svn: 256254
2015-12-22 17:10:34 +00:00
Alexander Kornienko b60d291d79 [clang-tools-extra] Text formatting
llvm-svn: 256253
2015-12-22 17:08:57 +00:00
Gabor Horvath c6ff9c349d Fix a false positive case in ContainerSizeEmpty check (PR25893).
llvm-svn: 256142
2015-12-21 09:43:52 +00:00
NAKAMURA Takumi ecba4c3d0b check-clang-tools requires clang-headers due to test/clang-tidy.
clang-modernize provided clang-headers but it was removed.

llvm-svn: 256133
2015-12-21 01:35:28 +00:00
Alexander Kornienko 23f04fd469 Remove clang-modernize.
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
2015-12-17 11:49:19 +00:00
Alexander Kornienko 2a538309ac [clang-tidy] google-readability-namespace-comments: ignore stray semicolons
llvm-svn: 255772
2015-12-16 15:44:42 +00:00
Alexander Kornienko 821ca470bb [clang-tidy] Add namespace support to add_new_check.py
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
2015-12-16 15:05:27 +00:00
Alexander Kornienko d819364e81 [clang-tidy] Don't use diag() for debug output
llvm-svn: 255765
2015-12-16 13:19:08 +00:00
Alexander Kornienko 32032f5e64 [clang-tidy] Fix a crash in misc-new-delete-overloads
llvm-svn: 255758
2015-12-16 10:58:14 +00:00
Gabor Horvath 454564a2d9 [clang-tidy] Check for suspicious string assignments.
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
2015-12-15 08:47:20 +00:00