| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
leave the "redundant cast to the same type" part).
llvm-svn: 218225
|
|
|
|
|
|
|
|
|
|
|
| |
Preprocessor:addCommentHandler() does not take ownership,
so we'd end up leaking the TodoCommentHandler.
This patch makes it owned by the Check object.
Differential Revision: http://reviews.llvm.org/D5402
llvm-svn: 218068
|
|
|
|
|
|
|
|
|
| |
It also suggests a fix-it, taking the name from $USER. This will be made
configurable eventually.
Differential Revision: http://reviews.llvm.org/D5393
llvm-svn: 218049
|
|
|
|
|
|
| |
NFC
llvm-svn: 217952
|
|
|
|
|
|
|
|
|
|
| |
If we had many header files we would attach the fix-it for all files to all
warnings, oops. This is harmless 99.9% of the time but can confuse the rewriter
in some edge cases. Sadly I failed to create a small test case for this.
While there move fix-its instead of copying.
llvm-svn: 217951
|
|
|
|
|
|
|
|
|
| |
warning.
Before we would emit two warnings if the header guard was wrong and the comment
on a trailing #endif also needed fixing.
llvm-svn: 217890
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As this is very dependent on the code base it has some ways of configuration.
It's possible to pick between 3 modes of operation:
- Line counting: number of lines including whitespace and comments
- Statement counting: number of statements within compoundStmts.
- Branch counter
In addition a threshold can be picked, warnings are only emitted when it is met.
The thresholds can be configured via a .clang-tidy file.
Differential Revision: http://reviews.llvm.org/D4986
llvm-svn: 217768
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Each check can implement readOptions and storeOptions methods to read
and store custom options. Each check's options are stored in a local namespace
to avoid name collisions and provide some sort of context to the user.
Reviewers: bkramer, klimek
Reviewed By: klimek
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D5296
llvm-svn: 217661
|
|
|
|
| |
llvm-svn: 217493
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: djasper
Reviewed By: djasper
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D5289
llvm-svn: 217492
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
addCheckFactory: registerCheck.
Reviewers: djasper
Reviewed By: djasper
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D5288
llvm-svn: 217489
|
|
|
|
|
|
|
|
| |
newlines involved.
Getting that right is just not worth it.
llvm-svn: 217480
|
|
|
|
| |
llvm-svn: 217475
|
|
|
|
|
|
| |
when it's not around.
llvm-svn: 217374
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes over an entire codebase.
Ever wanted to fix all the header guards in clang? Now it's easy.
Make sure clang-tidy is in $PATH and a compilation database is available.
$ ./run-clang-tidy.py -checks=-*,llvm-header-guard -fix
... get coffee (or more CPU cores) ...
$ svn diff
Some may argue that this is just a glorified xargs -P, but it does a bit more ;)
Differential Revision: http://reviews.llvm.org/D5188
llvm-svn: 217368
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was failing with:
C:\bb-win7\ninja-clang-i686-msc17-R\llvm-project\llvm\include\llvm/Support/ErrorOr.h(102) : error C3861: 'make_error_code': identifier not found
C:\bb-win7\ninja-clang-i686-msc17-R\llvm-project\clang-tools-extra\clang-tidy\ClangTidyOptions.cpp(153) : see reference to function template instantiation 'llvm::ErrorOr<T>::ErrorOr<std::errc::errc>(E,void *)' being compiled
with
[
T=clang::tidy::ClangTidyOptions,
E=std::errc::errc
]
llvm-svn: 217201
|
|
|
|
| |
llvm-svn: 217163
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This adds a support for the .clang-tidy file reading using
FileOptionsProvider, -dump-config option, and changes tests to not depend on
default checks set.
Reviewers: klimek, bkramer, djasper
Reviewed By: djasper
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D5186
llvm-svn: 217155
|
|
|
|
|
|
|
|
| |
Allows gathering fixes and applying them with clang-apply-fixes.
Differential Revision: http://reviews.llvm.org/D5176
llvm-svn: 217139
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
parameter packs.
Summary:
This disables this check for std::bind and similar functions that use
parameter packs to forward arguments to a different function. Name of the
parameter pack argument doesn't matter.
Reviewers: klimek
Reviewed By: klimek
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D5168
llvm-svn: 217039
|
|
|
|
| |
llvm-svn: 217036
|
|
|
|
|
|
|
|
| |
of copying it everywhere.
No intended functionality change.
llvm-svn: 217035
|
|
|
|
| |
llvm-svn: 216901
|
|
|
|
|
|
| |
overload.
llvm-svn: 216868
|
|
|
|
| |
llvm-svn: 216727
|
|
|
|
|
|
|
|
| |
fixed-size types.
Differential Revision: http://reviews.llvm.org/D5119
llvm-svn: 216726
|
|
|
|
|
|
| |
functions.
llvm-svn: 216718
|
|
|
|
| |
llvm-svn: 216551
|
|
|
|
|
|
|
|
|
| |
we can also fix the original header guard.
We still allow an _ at the end of a header guard since it's so common, but
remove it now when the #endif comment is changed.
llvm-svn: 216462
|
|
|
|
|
|
| |
Turning block comments into line comments just creates unecessary churn.
llvm-svn: 216072
|
|
|
|
| |
llvm-svn: 215799
|
|
|
|
| |
llvm-svn: 215589
|
|
|
|
|
|
| |
this behavior can still be observed today.
llvm-svn: 215553
|
|
|
|
| |
llvm-svn: 215550
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The implementation is split into a generic part and a LLVM-specific part.
Other codebases can implement it with their own style. The specific features
supported are:
- Verification (and fixing) of header guards against a style based on the file path
- Automatic insertion of header guards for headers that are missing them
- A warning when the header guard doesn't enable our fancy header guard optimization
(e.g. when there's an include preceeding the guard)
- Automatic insertion of a comment with the guard name after #endif.
For the LLVM style we disable #endif comments for now, they're not very common
in the codebase. We also only flag headers in the include directories, there
doesn't seem to be a common style outside.
Differential Revision: http://reviews.llvm.org/D4867
llvm-svn: 215548
|
|
|
|
|
|
| |
It's just too noisy and the warning isn't very helpful in those cases.
llvm-svn: 215439
|
|
|
|
|
|
|
|
| |
After post-commit review and community discussion, this seems like a
reasonable direction to continue, making ownership semantics explicit in
the source using the type system.
llvm-svn: 215324
|
|
|
|
|
|
| |
We actually want the end iterator so just replace it with iterator arithmetic.
llvm-svn: 215195
|
|
|
|
|
|
|
|
|
|
| |
There are still a couple of rough edges in here but it is working fine
on LLVM and generates the same results as sort_includes.py if there are
no blank lines involved.
Differential Revision: http://reviews.llvm.org/D4741
llvm-svn: 215152
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Rename ChecksFilter to GlobList, as there's nothing specific to checks in it.
It's a rather generic way to represent sets of strings (or patterns), so it may
be used for something else in ClangTidy. The new name would not look strange
when used to filter other entities.
Reviewers: klimek
Reviewed By: klimek
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4806
llvm-svn: 214961
|
|
|
|
|
|
| |
Turns out there is a better way to do this. No functionality change.
llvm-svn: 214874
|
|
|
|
|
|
|
|
| |
Haven't thought that I ever needed to do this, but in this case comparing the
index using pointer arithmetic turns out to be really ugly. It also generates
nasty sign-compare warnings on 32 bit targets.
llvm-svn: 214705
|
|
|
|
| |
llvm-svn: 214703
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
definition is visible.
Summary:
This allows us to copy the parameter name from the definition (as a comment)
or insert /*unused*/ in both places.
Reviewers: alexfh, klimek
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4772
llvm-svn: 214701
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
but doesn't delegate.
Summary:
class Foo {
Foo() {
Foo(42); // oops
}
Foo(int);
};
This is valid code but it does nothing and we can't emit a warning in clang
because there might be side effects. The checker emits a warning for this
pattern and also for base class initializers written in this style.
There is some overlap with the unused-rtti checker but they follow different
goals and fire in different places most of the time.
Reviewers: alexfh, djasper
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4667
llvm-svn: 214397
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
function the callback points to.
Reviewers: djasper
Reviewed By: djasper
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4722
llvm-svn: 214307
|
|
|
|
|
|
|
|
| |
It doesn't make sense to suggest 'virtual' as clang-tidy would complain
about that on the next iteration (we are never issuing warnings for the
base function).
llvm-svn: 214063
|
|
|
|
|
|
|
| |
Most of the changes are mechanic std::unique_ptr insertions. All leaks were
detected by LeakSanitizer.
llvm-svn: 213851
|
|
|
|
| |
llvm-svn: 213845
|
|
|
|
| |
llvm-svn: 213740
|