| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
non-const copies that can be safely converted to const references.
Summary:
Move code shared between UnnecessaryCopyInitialization and ForRangeCopyCheck into utilities files.
Add more test cases for UnnecessaryCopyInitialization and disable fixes inside of macros.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D17488
llvm-svn: 262781
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
implicit cast expressions.
Summary:
For some test cases like:
```
int func(int, void*, void*);
(double)func(0, 0, 0);
```
The AST contains several `ImplicitCastExpr`s, so we should not only check on the first sub expression.
```
`-CStyleCastExpr 0x7fe43a088938 <line:6:3, col:24> 'double' <NoOp>
`-ImplicitCastExpr 0x7fe43a088920 <col:11, col:24> 'double' <IntegralToFloating>
`-CallExpr 0x7fe43a0888a0 <col:11, col:24> 'int'
|-ImplicitCastExpr 0x7fe43a088888 <col:11> 'int (*)(int, void *, void *)' <FunctionToPointerDecay>
| `-DeclRefExpr 0x7fe43a0887d8 <col:11> 'int (int, void *, void *)' lvalue Function 0x7fe43a0886f0 'func1' 'int (int, void *, void *)'
|-IntegerLiteral 0x7fe43a088800 <col:17> 'int' 0
|-ImplicitCastExpr 0x7fe43a0888e0 <col:20> 'void *' <NullToPointer>
| `-IntegerLiteral 0x7fe43a088820 <col:20> 'int' 0
`-ImplicitCastExpr 0x7fe43a0888f8 <col:23> 'void *' <NullToPointer>
`-IntegerLiteral 0x7fe43a088840 <col:23> 'int' 0
```
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D17849
llvm-svn: 262698
|
|
|
|
| |
llvm-svn: 262618
|
|
|
|
|
|
| |
compilation fails.
llvm-svn: 262615
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This doesn't really do much at the moment. You can load it via libclang
and set the -checks via an extra command line argument as illustrated in
the test case. Support for other options (including headers check) is
currently missing. Also when using this with libclang some checks may
not work with the precompiled preamble in place.
This can be used to easily show clang-tidy warnings in an editor
integration as all that's needed is adding command line flags that are
passed into libclang. Warnings and FixIts are exposed via the existing
CXDiagnostic machinery.
Differential Revision: http://reviews.llvm.org/D17807
llvm-svn: 262595
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
IncludeInserter handles macro header file.
Summary: Also Fixes PR24749.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D17805
llvm-svn: 262484
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: alexfh
Subscribers: jbcoe, cfe-commits
Differential Revision: http://reviews.llvm.org/D17756
llvm-svn: 262470
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D17640
llvm-svn: 262024
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The clang-tidy will trigger an assertion if it's not in the building directory.
TEST:
cd <llvm-repo>/
./build/bin/clang-tidy --checks=-*,modernize-use-nullptr -p build tools/clang/tools/extra/clang-tidy/ClangTidy.cpp
The crash issue is gone after applying this patch.
Fixes PR24834, PR26241
Reviewers: bkramer, alexfh
Subscribers: rizsotto.mailinglist, cfe-commits
Differential Revision: http://reviews.llvm.org/D17335
llvm-svn: 261991
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
string initializations.
Reviewers: hokein, alexfh
Subscribers: cfe-commits
Patch by Shuai Wang!
Differential Revision: http://reviews.llvm.org/D17586
llvm-svn: 261939
|
|
|
|
|
|
| |
corresponding to r261893.
llvm-svn: 261897
|
|
|
|
| |
llvm-svn: 261893
|
|
|
|
|
|
|
| |
For now, it just detects that host is non-Windows and target is msvc.
FIXME: It should be probable for cross compilations. Detect whether target's headers would be available.
llvm-svn: 261814
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
namespace
Adds a new check "misc-forward-declaration-namespace".
In check, A forward declaration is considerred in a potentially wrong namespace
if there is any definition/declaration with the same name exists in a different
namespace.
Reviewers: akuegel, hokein, alexfh
Patch by Eric Liu!
Differential Revision: http://reviews.llvm.org/D17195
llvm-svn: 261737
|
|
|
|
|
|
| |
_popen() to execute a command processor. This check corresponds to the CERT secure coding rule: https://www.securecoding.cert.org/confluence/pages/viewpage.action?pageId=2130132
llvm-svn: 261530
|
|
|
|
|
|
| |
floating-point type. This check corresponds to the CERT secure coding rule: https://www.securecoding.cert.org/confluence/display/c/FLP30-C.+Do+not+use+floating-point+variables+as+loop+counters
llvm-svn: 261324
|
|
|
|
|
|
|
|
|
| |
instead of a get() method we find in the class.
The duck typed smart pointer class could have overloaded get() methods
and we should only skip the one that matches.
llvm-svn: 261102
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The test code will trigger following an assert failure:
assert.h assertion failed at LoopConvertUtils.cpp:560 in
bool clang::tidy::modernize::ForLoopIndexUseVisitor::TraverseMemberExpr(clang::MemberExpr*): ExprType->isPointerType() && "Operator-> returned non-pointer type"
Reviewers: alexfh
Differential Revision: http://reviews.llvm.org/D17287
llvm-svn: 260953
|
|
|
|
|
|
|
|
|
|
|
|
| |
`readability-braces-around-statements` check.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D17134
llvm-svn: 260952
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch is a continuation of http://reviews.llvm.org/D10553 by Jonathan B Coe.
The main additions are:
1. For C++11 the check suggests in-class field initialization as fix. This
makes the fields future proof towards the addition of new constructors.
2 For older language versions the fields are added in the right position
in the initializer list with more tests.
3. User documentation.
Reviewers: alexfh, jbcoe
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D16517
llvm-svn: 260873
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Fix oversight not checking the value of the Optional<bool> returned by
isExpensiveToCopy().
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D17064
llvm-svn: 260870
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Add check performance-faster-string-find.
It replaces single character string literals to character literals in calls to string::find and friends.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D16152
llvm-svn: 260712
|
|
|
|
|
|
|
|
|
|
|
|
| |
Expand the simplify boolean expression check to handle implicit conversion of integral types to bool and improve the handling of implicit conversion of member pointers to bool.
Implicit conversion of member pointers are replaced with explicit comparisons to nullptr.
Implicit conversions of integral types are replaced with explicit comparisons to 0.
Patch by Richard Thomson.
llvm-svn: 260681
|
|
|
|
|
|
|
|
|
|
|
|
| |
portability problems.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D17140
llvm-svn: 260665
|
|
|
|
| |
llvm-svn: 260535
|
|
|
|
| |
llvm-svn: 260532
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
check.
Summary:
The check will trigger a assert failure("CondEndLoc.isValid") when
checking the IfStmt whose condition expression is not parsed.
In this case, we should ignore that.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D17069
llvm-svn: 260505
|
|
|
|
|
|
|
|
|
|
| |
semantics.
Reviewers: hokein, alexfh
Differential Revision: http://reviews.llvm.org/D16535
llvm-svn: 260503
|
|
|
|
|
|
| |
work on various bots
llvm-svn: 260225
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D16310
llvm-svn: 260223
|
|
|
|
|
|
| |
namespaces. Fix PR25812.
llvm-svn: 260217
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D16926
llvm-svn: 260107
|
|
|
|
|
|
|
| |
http://bb.pgr.jp/builders/cmake-clang-tools-x86_64-linux/builds/23351
http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/492
llvm-svn: 260097
|
|
|
|
|
|
|
|
|
|
|
|
| |
of integral types to bool and improve the handling of implicit conversion of member pointers to bool.
Implicit conversion of member pointers are replaced with explicit comparisons to nullptr.
Implicit conversions of integral types are replaced with explicit comparisons to 0.
Patch by Richard Thomson.
llvm-svn: 260096
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This is originally implemented by Jacques Pienaar.
Reviewers: alexfh
Subscribers: cfe-commits, jpienaar
Differential Revision: http://reviews.llvm.org/D16764
llvm-svn: 260084
|
|
|
|
|
|
|
|
|
|
|
|
| |
meeting an unnamed function parameter.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D16882
llvm-svn: 259787
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The crash is caused by triggering a Assertion failed in DeclCXX.h when the
check detects non-defined class return type in a class method declaration.
Reviewers: congliu, alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D16854
llvm-svn: 259668
|
|
|
|
|
|
|
|
|
|
|
|
| |
`misc-definitions-in-headers` check.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D16578
llvm-svn: 259643
|
|
|
|
| |
llvm-svn: 259531
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This is implemented originally by Alexander Kornienko.
Reviewers: alexfh
Subscribers: cfe-commits
Patch by Haojian Wu!
Differential Revision: http://reviews.llvm.org/D16717
llvm-svn: 259530
|
|
|
|
|
|
|
|
| |
forms of redundant control flow statements. Currently checks for return statements at the end of a function with a void return type and continue statements at the end of looping statements.
Patch by Richard Thomson.
llvm-svn: 259362
|
|
|
|
| |
llvm-svn: 259289
|
|
|
|
|
|
|
|
|
|
| |
loop variables.
Patch by Felix Berger!
Differential revision: http://reviews.llvm.org/D13849
llvm-svn: 259199
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: "checkParamTypes" may fail if the the type of some parameter is not canonical. Fixed it by comparing canonical types. And added "getCanonicalType()" and "getCanonicalDecl()" on more places to prevent potential fail.
Reviewers: alexfh
Subscribers: cfe-commits
Patch by Cong Liu!
Differential Revision: http://reviews.llvm.org/D16587
llvm-svn: 259197
|
|
|
|
| |
llvm-svn: 259196
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This is implemented originally by Alex Pilkiewicz (pilki@google.com).
Reviewers: alexfh
Subscribers: cfe-commits
Patch by Haojian Wu!
Differential Revision: http://reviews.llvm.org/D16721
llvm-svn: 259195
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Fix the assertion failure for the user-defined conversion method. e.g.: operator bool()
Reviewers: alexfh, aaron.ballman
Subscribers: aaron.ballman, cfe-commits
Patch by Cong Liu!
Differential Revision: http://reviews.llvm.org/D16536
llvm-svn: 258801
|
|
|
|
|
|
| |
macros, which use !! instead of an if statement or a conditional operator.
llvm-svn: 258714
|
|
|
|
|
|
|
|
|
|
|
| |
check.
Handle decayed types, ignore qualifiers and accessibility when considering a
method as a possible overload.
Differential Revision: http://reviews.llvm.org/D16179
llvm-svn: 258562
|