| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we would use a non-const loop variable in the range-based
loop for:
void f(const std::vector<int> &v) {
for (size_t i = 0; i < v.size(); ++i) {
Now we use const auto&.
Note that we'll also want to use a copy at least for simple types.
llvm-svn: 248418
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Reorder the code in a more logical and understandable way.
Reviewers: klimek
Subscribers: cfe-commits, alexfh
Differential Revision: http://reviews.llvm.org/D12797
llvm-svn: 248144
|
|
|
|
|
|
| |
correlates to r247885 which performs the AST matcher rename in Clang.
llvm-svn: 247886
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
1. Avoid converting loops that iterate over the size of a container and don't use its elements, as this would result in an unused-result warning.
2. Never capture the elements by value on lambdas, thus avoiding doing unnecessary copies and errors with non-copyable types.
3. The 'const auto &' instead of 'auto &' substitution on const containers now works on arrays and pseudoarrays as well.
4. The error about multiple replacements in the same macro call is now documented in the tests (not solved though).
5. Due to [1], I had to add a dummy usage of the range element (like "(void) *It;" or similars) on the tests that had empty loops.
6. I removed the braces from the CHECK comments. I think that there is no need for them, and they confuse vim.
Reviewers: klimek
Subscribers: alexfh, cfe-commits
Differential Revision: http://reviews.llvm.org/D12734
llvm-svn: 247399
|
|
|
|
| |
llvm-svn: 246996
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
When the dereference operator returns a value that is trivially
copyable (like a pointer), copy it. After this change, modernize-loop-convert
check can be applied to the whole llvm source code without breaking any build
or test.
Reviewers: alexfh, klimek
Subscribers: alexfh, cfe-commits
Differential Revision: http://reviews.llvm.org/D12675
llvm-svn: 246989
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: The InitListExpr subtree is visited twice, this caused the check to do multiple replacements. Added a set to avoid it.
Reviewers: klimek, alexfh
Subscribers: cfe-commits, alexfh
Differential Revision: http://reviews.llvm.org/D12631
llvm-svn: 246879
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Ensure that the alias has the same type than the loop variable. Now it works with lambda captures.
Reviewers: klimek
Subscribers: alexfh, cfe-commits
Differential Revision: http://reviews.llvm.org/D12597
llvm-svn: 246762
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: loop-convert no longer crashes when calling a member function using a member pointer which is a member of another record.
Reviewers: alexfh, klimek
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D12555
llvm-svn: 246655
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Fix a bug where use-auto check would crash when the definition of a type is in the same statement than its instantiation with new.
Reviewers: alexfh
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D12551
llvm-svn: 246638
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Reduced the amount of wrong conversions of this check.
Reviewers: klimek
Subscribers: alexfh, cfe-commits
Differential Revision: http://reviews.llvm.org/D12530
llvm-svn: 246550
|
|
|
|
|
|
|
|
|
| |
"modernize/"
These checks are focusing on migrating the code from C++98/03 to C++11, so they
belong to the modernize module.
llvm-svn: 246437
|
|
|
|
|
|
| |
mode. Loop conversion would make recommendations for C code, so added a test to ensure that does not happen. The pass by value, use auto and replace auto_ptr checkers would not make recommendations for C code, and are disabled for performance reasons, but do not require an extra test.
llvm-svn: 246310
|
|
|
|
|
|
| |
time disable UseNullptrCheck when not compiling in C++ mode, but still allow in C++11 mode since it's likely the user wishes to modernize their code.
llvm-svn: 246298
|
|
|
|
|
|
| |
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/30516
llvm-svn: 246224
|
|
|
|
|
|
| |
compiling in C++11 mode.
llvm-svn: 246209
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Prevent LoopConvert from taking as alias anything that comes from a random member function call.
Reviewers: alexfh
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D12370
llvm-svn: 246039
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Fix a bug where modernize-loop-convert check would take as alias a reference to other containers. Add the pertinent test.
Reviewers: alexfh
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D12361
llvm-svn: 246034
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Prevent LoopConvertCheck from doing replacements in template instantiations, and add a test.
Reviewers: alexfh
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D12321
llvm-svn: 245942
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Migrate replace-auto_ptr check from clang-modernize to modernize module in clang-tidy.
Reviewers: alexfh
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D12287
llvm-svn: 245933
|
|
|
|
|
|
| |
http://reviews.llvm.org/D12231
llvm-svn: 245703
|
|
|
|
| |
llvm-svn: 245701
|
|
|
|
|
|
|
|
| |
http://reviews.llvm.org/D12186
Patch by Angel Garcia!
llvm-svn: 245561
|
|
|
|
|
|
|
|
| |
While convenient, RecursiveASTVisitor generates a ridiculous amount of dead
template code. Making it not visible from the outside lets the compiler
eliminate some of it, shrinking clang-tidy by ~140k.
llvm-svn: 245548
|
|
|
|
| |
llvm-svn: 245533
|
|
|
|
| |
llvm-svn: 245524
|
|
|
|
| |
llvm-svn: 245517
|
|
|
|
|
|
|
|
|
|
|
| |
This patch re-applies r245434 and r245471 reverted in r245493, and changes the
way custom null macros are configured. The test for custom null macros is
temporarily excluded and will be committed separately to reduce chances of
breakages.
Initial patches by Angel Garcia.
llvm-svn: 245511
|
|
|
|
|
|
|
|
|
|
| |
The new test is failing on darwin:
http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_check/10339/
This reverts r245434 and its follow up r245471.
llvm-svn: 245493
|
|
|
|
|
|
| |
existing tests should provide sufficient coverage.
llvm-svn: 245492
|
|
|
|
|
|
|
|
| |
http://reviews.llvm.org/D12162
Patch by Angel Garcia!
llvm-svn: 245471
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix LoopConvertCheck bug: StringRef to temporaries.
Also add LLVM_ATTRIBUTE_UNUSED to ModernizeModuleAnchorDestination.
http://reviews.llvm.org/D12157
Patch by Angel Garcia!
llvm-svn: 245458
|
|
|
|
|
|
|
|
|
|
| |
Move UseNullptr from clang-modernize to modernize module in clang-tidy.
http://reviews.llvm.org/D12081
Patch by Angel Garcia!
llvm-svn: 245434
|
|
|
|
|
|
|
|
|
|
| |
Move LoopConvert from clang-modernize to modernize module in clang-tidy.
http://reviews.llvm.org/D12076
Patch by Angel Garcia!
llvm-svn: 245427
|
|
|
|
| |
llvm-svn: 245144
|
|
|
|
|
|
|
| |
This is better structurally and it also fixes a linker error in the configure
build.
llvm-svn: 245052
|
|
This is the first step for migrating cppmodernize to clang-tidy.
http://reviews.llvm.org/D11946
Patch by Angel Garcia!
llvm-svn: 245045
|