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
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
This reverts commit 2aff596257e1c45fa54baae823ecbe61a785174e.
I'm having a bad day apparently. I reverted the wrong CL. This
puts it back.
llvm-svn: 278978
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
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
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
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
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
Use table to avoid tautology. List all existing checks groups. Use alphabetical order.
Differential revision: https://reviews.llvm.org/D23471
llvm-svn: 278686
...
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
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
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
`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
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
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
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
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
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
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
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