| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Added support for macro definitions.
--
1. Added a pre-processor callback to catch macro definitions
2. Changed the type of the failure map so that macros and declarations can share the same map
3. Added extra tests to ensure fix-ups work using the new map
4. Added fix-ups for type aliases in variable and function declarations as part of adding the new tests
Reviewers: alexfh
Subscribers: Eugene.Zelenko, cfe-commits
Patch by James Reynolds!
Differential Revision: http://reviews.llvm.org/D21020
llvm-svn: 272993
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: alexfh
Subscribers: cfe-commits
Patch by Martin Boehme!
Differential Revision: http://reviews.llvm.org/D21366
llvm-svn: 272897
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
passed as a const ref argument
Summary:
Conceptually, this is very close to the existing functionality of misc-move-const-arg, which is why I'm adding it here and not creating a new check. For example, for a type A that is both movable and copyable, this
const A a1;
A a2(std::move(a1));
is not only a case where a const argument is being passed to std::move(), but the result of std::move() is also being passed as a const reference (due to overload resolution).
The new check typically triggers (exclusively) in cases where people think they're dealing with a movable type, but in fact the type is not movable.
Reviewers: hokein, aaron.ballman, alexfh
Subscribers: aaron.ballman, cfe-commits
Patch by Martin Boehme!
Differential Revision: http://reviews.llvm.org/D21223
llvm-svn: 272896
|
|
|
|
| |
llvm-svn: 272803
|
|
|
|
|
|
| |
With minor manual tweaks. No functionality change intended.
llvm-svn: 272795
|
|
|
|
|
|
|
|
| |
macro expansion (e.g. NULL).
Add CHECK-FIX tests.
llvm-svn: 272155
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Looks like the original code was copied from clang-format-diff.py.
Update help message to make it clang-tidy specific.
Reviewers: klimek, alexfh
Subscribers: Eugene.Zelenko, cfe-commits
Patch by Igor Sugak!
Differential Revision: http://reviews.llvm.org/D21050
llvm-svn: 272144
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
declarations
Fixes bugzilla issues 26273 and 27399
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20853
llvm-svn: 272128
|
|
|
|
|
|
| |
const-qualifier is applied to a typedef of pointer type rather than to the pointee type.
llvm-svn: 272025
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Added support for Type Alias declarations.
Reviewers: alexfh
Subscribers: cfe-commits
Patch by James Reynolds!
Differential Revision: http://reviews.llvm.org/D20856
llvm-svn: 271992
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D21059
llvm-svn: 271991
|
|
|
|
|
|
|
|
|
| |
macro.
It is not easy to tell where to do the suggestion and whether the
suggestion will be correct.
llvm-svn: 271896
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
By default, modernize-use-auto check will retain stars when replacing an explicit type with `auto`: `MyType *t = new MyType;` will be changed to `auto *t = new MyType;`, thus resulting in more consistency with the recommendations to use `auto *` for iterating over pointers in range-based for loops: http://llvm.org/docs/CodingStandards.html#beware-unnecessary-copies-with-auto
The new `RemoveStars` option allows to revert to the old behavior: with the new option turned on the check will change `MyType *t = new MyType;` to `auto t = new MyType;`.
Reviewers: aaron.ballman, sbenza
Subscribers: Eugene.Zelenko, cfe-commits
Differential Revision: http://reviews.llvm.org/D20917
llvm-svn: 271739
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Make the check's behavior more correct when handling using-decls in multiple scopes.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20909
llvm-svn: 271632
|
|
|
|
|
|
|
|
|
| |
the program.
If the token is not there, we still warn but we don't try to give a
fixit hint.
llvm-svn: 271426
|
|
|
|
|
|
|
|
|
| |
has matcher changed behaviour, and now it matches "as is" and
doesn't skip implicit and paren casts
http://reviews.llvm.org/D20801
llvm-svn: 271289
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"this" object argument if it is not modified.
Summary:
Also trigger the check in the following case:
void foo() {
ExpensiveToCopy Obj;
const auto UnnecessaryCopy = Obj.constReference();
Obj.onlyUsedAsConst();
}
i.e. when the object the method is called on is not const but is never
modified.
Reviewers: alexfh, fowles
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20010
llvm-svn: 271239
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Remove redundant quote.
These quotes were added here: http://reviews.llvm.org/D20766
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20792
llvm-svn: 271210
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The `getName()` call is useless. It's better to show a better example
as tutorial.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20766
llvm-svn: 271207
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
We should check whether a UsingDecl is defined in macros or in class
definition, not TargetDecls of the UsingDecl.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20666
llvm-svn: 271199
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Use a recursive visitor instead of forEachDescendant() matcher.
The latter requires several layers of virtual function calls for each node and
it is more expensive than the visitor.
Benchmark results show improvement of ~6% walltime in clang-tidy.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20597
llvm-svn: 270714
|
|
|
|
|
|
|
|
|
|
|
|
| |
Modified the clang-tidy PassByValue check. It now stops adding std::move to type which is trivially copyable because that caused the clang-tidy MoveConstArg to complain and revert, thus creating a cycle.
I have also added a lit-style test to verify the bugfix.
This is the bug on bugzilla: https://llvm.org/bugs/show_bug.cgi?id=27731
This is the code review on phabricator: http://reviews.llvm.org/D20365
llvm-svn: 270565
|
|
|
|
| |
llvm-svn: 270473
|
|
|
|
| |
llvm-svn: 270472
|
|
|
|
| |
llvm-svn: 270470
|
|
|
|
|
|
|
| |
This should have been done this way from the start, however I somehow missed
r257177.
llvm-svn: 270215
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: alexfh
Subscribers: cfe-commits, djasper
Differential Revision: http://reviews.llvm.org/D20429
llvm-svn: 270191
|
|
|
|
|
|
| |
Thanks to Tim Halloran for the initial patch (http://reviews.llvm.org/D15089)!
llvm-svn: 270033
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: alexfh, aaron.ballman
Subscribers: aaron.ballman, cfe-commits
Differential Revision: http://reviews.llvm.org/D20367
llvm-svn: 269928
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
misc-unused-using-decls check.
Summary: Ignore warning uninstantiated template function usages.
Reviewers: djasper, alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20326
llvm-svn: 269906
|
|
|
|
|
|
|
|
| |
Instead of forming char ranges that patch made us form token ranges,
which behave subtly different. Sadly I'm only seeing this as part of a
larger test case that I haven't fully reduced yet.
llvm-svn: 269896
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch is lifting matchers used by more than one checkers
to the common namespace.
Reviewers: aaron.ballman, alexfh
Subscribers: aaron.ballman, cfe-commits
Differential Revision: http://reviews.llvm.org/D19841
llvm-svn: 269804
|
|
|
|
|
|
|
|
|
| |
If a use of a macro argument is preceded by the `namespace` keyword, do
not warn that the use should be wrapped in parentheses.
Patch by Mads Ravn!
llvm-svn: 269786
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Cleanup some code by using appropriate APIs.
Some coding style cleanups.
There is no behavior changes.
- Function `IncludeSorter::CreateFixIt` can be replaced by `FixItHint::CreateReplacement`.
- Function `cleanPath` is a wrapper for `llvm::sys::path::remove_dots`.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20279
llvm-svn: 269656
|
|
|
|
|
|
|
|
|
|
|
|
| |
deleted copy constructor.
Reviewers: alexfh, sbenza
Subscribers: etienneb, aaron.ballman, cfe-commits
Differential Revision: http://reviews.llvm.org/D20170
llvm-svn: 269581
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
decl stmts with single VarDecl.
Summary: This fixes bug: https://llvm.org/bugs/show_bug.cgi?id=27325
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19865
llvm-svn: 269389
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch adds a check that replaces std::bind with a lambda.
Not yet working for member functions.
Reviewers: aaron.ballman, alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D16962
llvm-svn: 269341
|
|
|
|
|
|
|
|
|
|
|
|
| |
misc-unused-using-decls checks.
Reviewers: djasper
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20197
llvm-svn: 269278
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch is adding support for conditional expression and overloaded operators.
To decrease false-positive, this patch is adding a list of banned macro names that
has multiple variant with same integer value.
Also fixed support for template instantiation and added an unittest.
Reviewers: alexfh
Subscribers: klimek, Sarcasm, cfe-commits
Differential Revision: http://reviews.llvm.org/D19703
llvm-svn: 269275
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The new API for fixit is in libtooling and the library misc in clang-tidy
didn't had the appropriate dependency.
This commit was breaking some build bots:
http://reviews.llvm.org/D19547
This commit tried (but failed) to fix it:
http://reviews.llvm.org/D20180
To repro, you can make a build with these flags:
```
cmake -DBUILD_SHARED_LIBS=ON
```
Thanks rnk@ for helping figuring out.
Reviewers: alexfh, rnk
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20182
llvm-svn: 269240
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Refactor some checkers to use the tooling re-writing API.
see: http://reviews.llvm.org/D19941
Reviewers: klimek, alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19807
llvm-svn: 269210
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Arguments can be swapped using fixit when they are not in macros.
This is the same implementation than SwappedArguments. Some code
got lifted to be reused.
Others checks are not safe to be fixed as they tend to be bugs or errors.
It is better to let the user manually review them.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19547
llvm-svn: 269208
|
|
|
|
|
|
| |
Review link: http://reviews.llvm.org/D18745
llvm-svn: 269171
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Lift some common code used by multiple checkers.
This function is also used by checkers that are coming.
It is quite common for a checker to parse a list of names.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19846
llvm-svn: 269065
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
indirect fields
Summary:
Fixed a crash in cppcoreguidelines-pro-type-member-init when checking record types with indirect fields pre-C++11.
Fixed handling of indirect fields so they are properly checked and suggested fixes are proposed.
Patch by Michael Miller!
Reviewers: aaron.ballman, alexfh, hokein
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19993
llvm-svn: 269024
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
To check the google style guide rule here:
https://google.github.io/styleguide/cppguide.html#Default_Arguments
Patch by Clement Courbet!
Reviewers: hokein
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19534
llvm-svn: 268919
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Fix PR27429.
Reviewers: djasper
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20018
llvm-svn: 268917
|
|
|
|
| |
llvm-svn: 268905
|
|
|
|
| |
llvm-svn: 268555
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
misc-assign-operator-signature
Summary: Finds return statements in assign operator bodies where the return value is different from '*this'. Only assignment operators with correct return value Class& are checked.
Reviewers: aaron.ballman, alexfh, sbenza
Subscribers: o.gyorgy, baloghadamsoftware, LegalizeAdulthood, aaron.ballman, Eugene.Zelenko, xazax.hun, cfe-commits
Differential Revision: http://reviews.llvm.org/D18265
llvm-svn: 268492
|