| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Add the modernize-use-trailing-return check to rewrite function signatures to use trailing return types.
Patch by Bernhard Manfred Gruber.
llvm-svn: 360438
|
|
|
|
|
|
| |
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/48063/steps/test/logs/stdio
llvm-svn: 360348
|
|
|
|
|
|
|
|
| |
to use trailing return types.
Patch by Bernhard Manfred Gruber.
llvm-svn: 360345
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to reflect the new license.
We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.
Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.
llvm-svn: 351636
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Adds a checker to clang-tidy to warn when a non void const member function, taking only parameters passed by value or const reference could be marked as '[[nodiscard]]'
Patch by MyDeveloperDay.
Reviewers: alexfh, stephenkelly, curdeius, aaron.ballman, hokein, JonasToth
Reviewed By: curdeius, JonasToth
Subscribers: Eugene.Zelenko, lefticus, lebedev.ri, mgorny, xazax.hun, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D55433
llvm-svn: 350760
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
[[ https://bugs.llvm.org/show_bug.cgi?id=39224 | PR39224 ]]
As discussed, we can't always do the transform automatically due to that array-to-pointer decay of C array.
In order to detect whether we can do said transform, we'd need to be able to see all usages of said array,
which is, i would say, rather impossible if e.g. it is in the header.
Thus right now no fixit exists.
Exceptions: `extern "C"` code.
References:
* [[ https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es27-use-stdarray-or-stack_array-for-arrays-on-the-stack | CPPCG ES.27: Use std::array or stack_array for arrays on the stack ]]
* [[ https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#slcon1-prefer-using-stl-array-or-vector-instead-of-a-c-array | CPPCG SL.con.1: Prefer using STL array or vector instead of a C array ]]
* HICPP `4.1.1 Ensure that a function argument does not undergo an array-to-pointer conversion`
* MISRA `5-2-12 An identifier with array type passed as a function argument shall not decay to a pointer`
Reviewers: aaron.ballman, JonasToth, alexfh, hokein, xazax.hun
Reviewed By: JonasToth
Subscribers: Eugene.Zelenko, mgorny, rnkovacs, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D53771
llvm-svn: 346835
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This check warns the uses of the deprecated member types of std::ios_base
and replaces those that have a non-deprecated equivalent.
Patch by andobence!
Reviewd by: alexfh
Revision ID: https://reviews.llvm.org/D51332
llvm-svn: 343848
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Finds instances of namespaces concatenated using explicit syntax, such as `namespace a { namespace b { [...] }}` and offers fix to glue it to `namespace a::b { [...] }`.
Properly handles `inline` and unnamed namespaces. ~~Also, detects empty blocks in nested namespaces and offers to remove them.~~
Test with common use cases included.
I ran the check against entire llvm repository. Except for expected `nested namespace definitions only available with -std=c++17 or -std=gnu++17` warnings I noticed no issues when the check was performed.
Example:
```
namespace a { namespace b {
void test();
}}
```
can become
```
namespace a::b {
void test();
}
```
Patch by wgml!
Reviewers: alexfh, aaron.ballman, hokein
Reviewed By: aaron.ballman
Subscribers: JonasToth, Eugene.Zelenko, lebedev.ri, mgorny, xazax.hun, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D52136
llvm-svn: 343000
|
|
|
|
|
|
|
|
|
|
| |
std::uncaught_exceptions
Patch by: Daniel Kolozsvari!
Differential Revision: https://reviews.llvm.org/D40787
llvm-svn: 325572
|
|
|
|
|
|
|
|
| |
Patch by: Lilla Barancsuk
Differential Revision: https://reviews.llvm.org/D35257
llvm-svn: 307791
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
New checker to replace dynamic exception
specifications
This is an alternative to D18575 which relied on reparsing the decl to
find the location of dynamic exception specifications, but couldn't
deal with preprocessor conditionals correctly without reparsing the
entire file.
This approach uses D20428 to find dynamic exception specification
locations and handles all cases correctly.
Reviewers: aaron.ballman, alexfh
Reviewed By: aaron.ballman, alexfh
Subscribers: xazax.hun, mgehre, malcolm.parsons, mgorny, JDevlieghere, cfe-commits, Eugene.Zelenko, etienneb
Patch by Don Hinton!
Differential Revision: https://reviews.llvm.org/D20693
llvm-svn: 304977
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This check will find occurrences of ``std::random_shuffle`` and replace it with ``std::shuffle``. In C++17 ``std::random_shuffle`` will no longer be available and thus we need to replace it.
Example of case that it fixes
```
std::vector<int> v;
// First example
std::random_shuffle(vec.begin(), vec.end());
```
Reviewers: hokein, aaron.ballman, alexfh, malcolm.parsons, mclow.lists
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D30158
llvm-svn: 301167
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Replaces explicit calls to the constructor in a return with a braced
initializer list. This way the return type is not needlessly duplicated in the
return type and the return statement.
```
Foo bar() {
Baz baz;
return Foo(baz);
}
// transforms to:
Foo bar() {
Baz baz;
return {baz};
}
```
Reviewers: hokein, Prazek, aaron.ballman, alexfh
Reviewed By: Prazek, aaron.ballman, alexfh
Subscribers: malcolm.parsons, mgorny, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D28768
llvm-svn: 295199
|
|
|
|
|
|
|
|
|
| |
exception specifications with noexcept exception specifications."
This reverts commit r293217, its follow-up 293218 and part of 293234 because it
broke all bots that build clang-tools-extra.
llvm-svn: 293267
|
|
|
|
|
|
|
|
| |
exception specifications with noexcept exception specifications.
Patch by Don Hinton.
llvm-svn: 293217
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Fixes PR18858
Reviewers: alexfh, hokein, aaron.ballman
Subscribers: JDevlieghere, Eugene.Zelenko, Prazek, mgorny, cfe-commits, modocache
Differential Revision: https://reviews.llvm.org/D26750
llvm-svn: 290202
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: angelgarcia, aaron.ballman, alexfh
Subscribers: JDevlieghere, Prazek, mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D26511
llvm-svn: 288375
|
|
|
|
| |
llvm-svn: 287107
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Fixes PR27872
Reviewers: klimek, hokein, alexfh, aaron.ballman
Subscribers: Prazek, Eugene.Zelenko, danielmarjamaki, cfe-commits, mgorny
Differential Revision: https://reviews.llvm.org/D26138
llvm-svn: 286472
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Ran clang-format on all .c/.cpp/.h files in clang-tools-extra.
Excluded the test, unittests, clang-reorder-fields, include-fixer, modularize and pptrace directories.
Reviewers: klimek, alexfh
Subscribers: nemanjai
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D26329
llvm-svn: 286221
|
|
|
|
|
|
| |
http://reviews.llvm.org/D18919
llvm-svn: 273786
|
|
|
|
|
|
|
|
|
|
| |
Summary: Add check that replaces call of push_back to emplace_back
Reviewers: hokein
Differential Revision: http://reviews.llvm.org/D20964
llvm-svn: 273275
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Review link: http://reviews.llvm.org/D18745
llvm-svn: 269171
|
|
|
|
|
|
|
|
|
| |
Because modernize-make-shared do almost the same job as
modernize-make-unique, I refactored common code to MakeSmartPtrCheck.
http://reviews.llvm.org/D19183
llvm-svn: 268253
|
|
|
|
| |
llvm-svn: 264539
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch introduces the modernize-deprecated-headers check, which is supposed to replace deprecated C library headers with the C++ STL-ones.
For information see documentation; for exmaples see the test cases.
Reviewers: Eugene.Zelenko, LegalizeAdulthood, alexfh
Subscribers: cfe-commits
Patch by Kirill Bobyrev!
Differential Revision: http://reviews.llvm.org/D17484
llvm-svn: 261738
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: If the size of the type is above a certain bound, we'll take a const reference. This bound can be set as an option. For now, the default value is 16 bytes.
Reviewers: klimek
Subscribers: alexfh, cfe-commits
Differential Revision: http://reviews.llvm.org/D14176
llvm-svn: 251694
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This check for clang-tidy looks for function with zero arguments declared as (void) and removes the unnecessary void token.
int foo(void);
becomes
int foo();
The check performs no formatting of the surrounding context but uses the lexer to look for the token sequence "(", "void", ")" in the prototype text. If this sequence of tokens is found, a removal is issued for the void token only.
Patch by Richard Thomson!
(+fixed tests, moved the check to the modernize module)
Differential revision: http://reviews.llvm.org/D7639
llvm-svn: 251475
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Add a check that replaces empty bodies of special member functions with '= default;'.
For now, it is only implemented for the default constructor and the destructor, which are the easier cases.
The copy-constructor and the copy-assignment operator cases will be implemented later.
I applied this check to the llvm code base and found 627 warnings (385 in llvm, 9 in compiler-rt, 220 in clang and 13 in clang-tools-extra).
Applying the fixes didn't break any build or test, it only caused a -Wpedantic warning in lib/Target/Mips/MipsOptionRecord.h:33 becaused it replaced
virtual ~MipsOptionRecord(){}; to virtual ~MipsOptionRecord()= default;;
Reviewers: klimek
Subscribers: george.burgess.iv, Eugene.Zelenko, alexfh, cfe-commits
Differential Revision: http://reviews.llvm.org/D13871
llvm-svn: 250897
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: create a check that replaces 'std::unique_ptr<type>(new type(args...))' with 'std::make_unique<type>(args...)'. It was on the list of "Ideas for new Tools". It needs to be tested more carefully, but first I wanted to know if you think it is worth the effort.
Reviewers: klimek
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D13166
llvm-svn: 248785
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Add an option to specify wich style must be followed when choosing the new index name.
Reviewers: alexfh
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D13052
llvm-svn: 248517
|
|
|
|
|
|
|
|
|
| |
"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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
This is the first step for migrating cppmodernize to clang-tidy.
http://reviews.llvm.org/D11946
Patch by Angel Garcia!
llvm-svn: 245045
|