Commit Graph

1437 Commits

Author SHA1 Message Date
Eugene Zelenko 05f7e6ae0d Fix Clang-tidy modernize-deprecated-headers warnings; other minor fixes.
Differential revision: http://reviews.llvm.org/D18231

llvm-svn: 263726
2016-03-17 17:02:25 +00:00
Haojian Wu e641cb4807 [clang-tidy] Fix "Name is not a simple identifier" assertion in `modernize-loop-convert` check.
Summary:
Fix assertion failure: "Name is not a simple identifier".

`Decl::GetName` assumes the name should be an identifier. When the check
processes the function calling statement with speciail key name like
'it.operator->()', it will trigger the assert in `GetName`.

Rather than using `Decl::GetName`, we use `getNameAsString` which works
with special key names in C++.

Reviewers: bkramer

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D18141

llvm-svn: 263426
2016-03-14 12:41:24 +00:00
Haojian Wu 0519744343 [clang-tidy] Make 'modernize-use-nullptr' check ignores NULL marcos used in other macros.
Reviewers: bkramer, alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D17958

llvm-svn: 263221
2016-03-11 11:40:08 +00:00
Alexander Kornienko 32effa1974 [docs] Clean up doxygen comments a bit.
llvm-svn: 262787
2016-03-06 04:05:59 +00:00
Felix Berger adfdc14832 [clang-tidy] Extend UnnecessaryCopyInitialization check to trigger on 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
2016-03-05 21:17:58 +00:00
Haojian Wu 678f65a9b4 [clang-tidy] Make 'modernize-use-nullptr' check work on multiple nested 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
2016-03-04 08:55:54 +00:00
Sylvestre Ledru 0b027eab7a fix some minor typos in the doc
llvm-svn: 262655
2016-03-03 20:57:16 +00:00
Sylvestre Ledru 4098de4062 Fix two minor syntax issues in the documentation
llvm-svn: 262654
2016-03-03 20:54:26 +00:00
Gabor Horvath 65c02ec837 [clang-tidy] Improve the robustness of a test.
llvm-svn: 262618
2016-03-03 13:43:23 +00:00
Gabor Horvath f4336ac9eb [clang-tidy] Do not emit warnings from misc-suspicious-semicolon when the compilation fails.
llvm-svn: 262615
2016-03-03 13:08:11 +00:00
Alexander Kornienko c1f7f1a31f [docs] Fix docs to work with doxygen 1.8.11
llvm-svn: 262605
2016-03-03 10:45:59 +00:00
Gabor Horvath 577ad5f8b8 [clang-tidy] Documentation fixes.
llvm-svn: 262601
2016-03-03 10:27:32 +00:00
Benjamin Kramer 8f5eb56df3 [clang-tidy] Add "clang-tidy as a clang plugin" skeleton.
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
2016-03-03 08:58:12 +00:00
Haojian Wu 7d08ba2749 [clang-tidy] Fix an assertion failure of "SLocEntry::getExpansion()" when IncludeInserter handles macro header file.
Summary: Also Fixes PR24749.

Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D17805

llvm-svn: 262484
2016-03-02 14:12:17 +00:00
Haojian Wu 1b5b0fd174 [clang-tidy] Make 'modernize-pass-by-value' fix work on header files.
Reviewers: alexfh

Subscribers: jbcoe, cfe-commits

Differential Revision: http://reviews.llvm.org/D17756

llvm-svn: 262470
2016-03-02 09:01:25 +00:00
Hans Wennborg 53bd9f3d7a IdentifierNamingCheck.cpp: try to fix MSVC build
It was failing to build with:

clang-tidy\readability\IdentifierNamingCheck.cpp(640):
error C2882: 'format' : illegal use of namespace identifier in expression

llvm-svn: 262257
2016-02-29 21:17:39 +00:00
Haojian Wu 0d5e9d3135 [clang-tidy] Fix an assertion failure in `modernize-use-nullptr` check.
Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D17640

llvm-svn: 262024
2016-02-26 15:34:35 +00:00
Alexander Kornienko 5d84978251 [clang-tidy] Minor change in the doc
llvm-svn: 261998
2016-02-26 10:24:29 +00:00
Haojian Wu f7692a2792 [clang-tidy] Fix a crash issue when clang-tidy runs with compilation database.
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
2016-02-26 09:19:33 +00:00
Alexander Kornienko 274220cda2 Remove a blank line at EOF. NFC
llvm-svn: 261940
2016-02-25 23:57:30 +00:00
Alexander Kornienko 1612fa07d3 Add a new check, readability-redundant-string-init, that checks unnecessary string initializations.
Reviewers: hokein, alexfh

Subscribers: cfe-commits

Patch by Shuai Wang!

Differential Revision: http://reviews.llvm.org/D17586

llvm-svn: 261939
2016-02-25 23:57:23 +00:00
NAKAMURA Takumi be16bbc925 Revert r261814, "check-clang-tools: Introduce the feature target-headers", corresponding to r261893.
llvm-svn: 261897
2016-02-25 16:59:59 +00:00
Alexander Kornienko f9c1e2c812 [clang-tidy] Adding headers needed in modernize-deprecated-headers tests
llvm-svn: 261893
2016-02-25 16:46:54 +00:00
Haojian Wu bd63972cff [clang-tidy] update links to Google Code Style in docs
Summary: Because of the recent Google Code shutdown links to the Google Code Style up there are no longer relevant.

Reviewers: alexfh, hokein

Subscribers: cfe-commits

Patch by Kirill Bobyrev!

Differential Revision: http://reviews.llvm.org/D17602

llvm-svn: 261868
2016-02-25 14:31:10 +00:00
NAKAMURA Takumi 8ef4887b15 check-clang-tools: Introduce the feature "target-headers".
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
2016-02-25 01:12:57 +00:00
Alexander Kornienko 4f933376cf [clang-tidy] Another attempt to fix MSVC build
llvm-svn: 261811
2016-02-25 00:39:11 +00:00
Alexander Kornienko 4432e12918 Trying to fix MSVC build
llvm-svn: 261806
2016-02-24 23:48:24 +00:00
Alexander Kornienko e4a75fd896 [clang-tidy] introduce modernize-deprecated-headers check
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
2016-02-24 13:36:34 +00:00
Alexander Kornienko ea9fd99215 [clang-tidy] Added a check for forward declaration in the potentially wrong 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
2016-02-24 13:35:32 +00:00
Alexander Kornienko 6bb4b88216 [clang-tidy] Updated docs on testing clang-tidy checks.
llvm-svn: 261622
2016-02-23 09:30:20 +00:00
Aaron Ballman 527a420550 Add a new check, cert-env33-c, that diagnoses uses of system(), popen(), and _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
2016-02-22 16:01:06 +00:00
Alexander Kornienko 10f3cf54cb [clang-tidy] Describe modules, link to LLVM development docs, other minor updates
llvm-svn: 261431
2016-02-20 11:42:13 +00:00
Aaron Ballman 611d2e4ee6 Add a new check, cert-flp30-c, that diagnoses loop induction expressions of 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
2016-02-19 14:03:20 +00:00
Samuel Benzaquen 1fb8bc7a30 [clang-tidy] Match the type against the get() method we are calling,
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
2016-02-17 16:13:14 +00:00
Haojian Wu 6b4c0b5b66 [clang-tidy] Fix an assert failure in `modernize-loop-convert`.
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
2016-02-16 10:36:51 +00:00
Haojian Wu 67f880641c [clang-tidy] Fix an assert failure of ForStmt in `readability-braces-around-statements` check.
Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D17134

llvm-svn: 260952
2016-02-16 10:31:33 +00:00
Alexander Kornienko f8bb8c5891 [clang-tidy] Enhance modernize-redundant-void-arg check to apply fixes to header files
Fixes http://llvm.org/PR25894

Patch by Richard Thomson!

Differential revision: http://reviews.llvm.org/D16953

llvm-svn: 260948
2016-02-16 09:49:05 +00:00
NAKAMURA Takumi 2c2c461e2a clang-tools-extra/test/Unit/lit.site.cfg.in: Prune on_clone. I guess it has been unused since r188006.
llvm-svn: 260944
2016-02-16 08:13:36 +00:00
Sylvestre Ledru 4e89611168 fix an indent issue in the doc which causes sphinx to fail with some versions
llvm-svn: 260912
2016-02-15 20:38:54 +00:00
Felix Berger ffae543b39 [clang-tidy] ClangTidy check to flag uninitialized builtin and pointer fields.
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
2016-02-15 04:27:56 +00:00
Felix Berger f4fdc8aba0 [clang-tidy] Only invoke ForRangeCopyCheck on expensive-to-copy types.
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
2016-02-15 03:36:23 +00:00
Felix Berger 1429412fe3 Improve documentation
llvm-svn: 260869
2016-02-15 03:27:54 +00:00
Samuel Benzaquen 51e1523d70 [clang-tidy] Add check performance-faster-string-find
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
2016-02-12 19:28:14 +00:00
Aaron Ballman f034a8c7d7 Reapply r260096.
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
2016-02-12 15:09:05 +00:00
Daniel Marjamaki 1fba76a3b9 [clang-tidy] Fix failure in 'misc-misplaced-widening-cast' test.
I added portability warnings when int results are casted to long. I forgot to handle uint, ulong and ulonglong.

Tested on x86 and powerpc targets, hope it works now on all buildbots.

llvm-svn: 260667
2016-02-12 09:38:38 +00:00
Daniel Marjamaki 79355776e3 [clang-tidy] improve misc-misplaced-widening-cast so it also detects portability problems.
Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D17140

llvm-svn: 260665
2016-02-12 07:51:10 +00:00
Alexander Kornienko cf0f0069e7 [clang-tidy] google-runtime-int: fix a false positive in implicit code.
llvm-svn: 260535
2016-02-11 16:22:58 +00:00
Cong Liu fbd0176d6c Merge branch 'arcpatch-D16922'
llvm-svn: 260532
2016-02-11 16:03:27 +00:00
Haojian Wu 60c9316d62 [clang-tidy] Fix an assert failure in 'readability-braces-around-statements' 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
2016-02-11 09:57:55 +00:00
Gabor Horvath 8b6434e56e [clang-tidy] Add a check to find unintended semicolons that changes the semantics.
Reviewers: hokein, alexfh

Differential Revision: http://reviews.llvm.org/D16535

llvm-svn: 260503
2016-02-11 09:23:33 +00:00
Daniel Marjamaki 4d228679df [clang-tidy] Add -target in misc-misplaced-widening-cast test so it will work on various bots
llvm-svn: 260225
2016-02-09 15:43:05 +00:00
Daniel Marjamaki ad3293744a [clang-tidy] Add 'misc-misplaced-widening-cast' check.
Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D16310

llvm-svn: 260223
2016-02-09 14:08:49 +00:00
Gabor Horvath f7c39d56b6 [clang-tidy] Make readability-container-size-empty work with inline namespaces. Fix PR25812.
llvm-svn: 260217
2016-02-09 10:20:48 +00:00
Gabor Horvath a4fd3beaa2 [clang-tidy] Replace a custom ASTMatcher with a built-in one.
llvm-svn: 260212
2016-02-09 09:26:11 +00:00
Haojian Wu 3d1d076f79 [clang-tidy] Some improvements in 'misc-definitions-in-headers' check.
Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D16979

llvm-svn: 260108
2016-02-08 16:05:39 +00:00
Haojian Wu 1e3c32b38a [clang-tidy] Fix assertion failure on `at` function in modernize-loop-convert.
Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D16926

llvm-svn: 260107
2016-02-08 15:59:42 +00:00
Haojian Wu 7a7614757c [clang-tidy] Correct IncorrectRoundings namespace.
Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D16987

llvm-svn: 260105
2016-02-08 15:54:30 +00:00
Alexander Kornienko c1587dcf4d [clang-tidy] Reshuffled paragraphs a bit, added contents.
llvm-svn: 260100
2016-02-08 15:09:39 +00:00
Alexander Kornienko 7193d9fa95 [clang-tidy] Fix an error in .rst
llvm-svn: 260099
2016-02-08 15:09:34 +00:00
Alexander Kornienko a7faa5b92a [clang-tidy] Update documentation
Summary: We have 2 scripts add_new_check.py and rename_check.py to bootstrap a new check creation. There is also clang-query to aid with the matcher creation. These were not mentioned in the current document, add them so it's available to the masses.

Reviewers: alexfh

Patch by Deniz Türkoglu!

Differential Revision: http://reviews.llvm.org/D16944

llvm-svn: 260098
2016-02-08 15:09:28 +00:00
Aaron Ballman 54391c8ca6 Reverting r260096; it causes build bot failures:
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
2016-02-08 14:37:56 +00:00
Aaron Ballman f4490cab0d 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: 260096
2016-02-08 14:25:25 +00:00
Haojian Wu 25779e404b [clang-tidy] Move incorrect-roundings to upstream.
Summary: This is originally implemented by Jacques Pienaar.

Reviewers: alexfh

Subscribers: cfe-commits, jpienaar

Differential Revision: http://reviews.llvm.org/D16764

llvm-svn: 260084
2016-02-08 10:16:13 +00:00
Alexander Kornienko f1d54eb222 [clang-tidy] Reformatted docs + minor updates
llvm-svn: 260065
2016-02-08 00:19:29 +00:00
Paul Robinson f868d0b238 Add qualifiers that are about to be necessary. NFC
llvm-svn: 259949
2016-02-05 23:20:02 +00:00
Benjamin Kramer 38b54b82e4 Unbreak the cmake shared build.
llvm-svn: 259880
2016-02-05 11:38:50 +00:00
Haojian Wu c2d7577cc5 [clang-tdiy] Add header file extension configuration support.
Summary: * Add a `HeaderFileExtensions` check option in misc-definitions-in-headers, google-build-namespaces and google-global-names-in-headers.

Reviewers: aaron.ballman, alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D16113

llvm-svn: 259879
2016-02-05 11:23:59 +00:00
Haojian Wu 4d67ec3f8c [clang-tidy] More friendly warning in "google-runtime-references" when meeting an unnamed function parameter.
Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D16882

llvm-svn: 259787
2016-02-04 14:06:49 +00:00
Haojian Wu bbff538e9d [clang-tidy] Fix a crash issue on misc-virtual-near-miss check.
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
2016-02-03 17:21:44 +00:00
Haojian Wu 29634fe676 [clang-tidy] bug fix: Don't warn on partial template specialization in `misc-definitions-in-headers` check.
Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D16578

llvm-svn: 259643
2016-02-03 12:10:27 +00:00
Daniel Jasper 3a6e81c2c1 clang-tidy: [misc-unused-parameters] Ignore template instantiations.
No functional changes intended as we should already do the
corresponding fixes when visiting the primary template. There are
existing tests that verify that we do change unused parameters of
templated functions.

llvm-svn: 259640
2016-02-03 11:33:18 +00:00
Alexander Kornienko abf22eb544 [clang-tidy] Removed unnecessary parameters in the test
llvm-svn: 259531
2016-02-02 17:27:08 +00:00
Alexander Kornienko 26e46d8fae [clang-tidy] Add non-constant references in function parameters check.
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
2016-02-02 17:27:01 +00:00
Matthias Braun 48c8426fa2 Fix build problem by lower SmallSet<N> to a reasonable value
llvm-svn: 259424
2016-02-01 22:18:58 +00:00
Eugene Zelenko dde3cd0347 Sort checks alphabetically in ReadabilityTidyModule.cpp.
llvm-svn: 259393
2016-02-01 19:47:24 +00:00
Aaron Ballman c3975b7d6a Add a new check, readability-redundant-control-flow, that check for some 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
2016-02-01 15:31:15 +00:00
NAKAMURA Takumi 622f3dcd1d test/clang-tidy/performance-for-range-copy.cpp: Appease for targeting ms mode.
llvm-svn: 259289
2016-01-30 02:15:19 +00:00
Alexander Kornienko d0d8878fb6 [clang-tidy] Don't use delegating constructors, since they are not supported by MSVC 2013
llvm-svn: 259214
2016-01-29 17:35:53 +00:00
Alexander Kornienko 5aebfe2e4a [clang-tidy] ForRangeCopyCheck that warns on and fixes unnecessary copies of loop variables.
Patch by Felix Berger!

Differential revision: http://reviews.llvm.org/D13849

llvm-svn: 259199
2016-01-29 15:54:26 +00:00
Alexander Kornienko bfee5f7352 [clang-tidy] Fix minor style issues. NFC
llvm-svn: 259198
2016-01-29 15:22:20 +00:00
Alexander Kornienko 8ac20a8439 Fixed function params comparison. Updated docs and tests.
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
2016-01-29 15:22:10 +00:00
Alexander Kornienko 42e8cf4a70 [clang-tidy] Fix style issues. NFC
llvm-svn: 259196
2016-01-29 15:21:43 +00:00
Alexander Kornienko 40d307d120 [clang-tidy] Move implicit-cast-in-loop check to upstream.
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
2016-01-29 15:21:32 +00:00
Hans Wennborg 14bf877e6b docs/conf.py: update copyright year
llvm-svn: 258960
2016-01-27 18:29:16 +00:00
Alexander Kornienko 1b290adc43 [clang-tidy] Fix documentation.
Fixed broken links to cppcoreguidelines (anchors specified in the .md file
should be used, not automatic anchors generated by github).

Fixed formatting, array_view -> span, fixed sphinx errors in
misc-definitions-in-headers.rst.

llvm-svn: 258926
2016-01-27 11:37:19 +00:00
Alexander Kornienko e267dafc13 [clang-tidy] Use relative URL for redirection.
llvm-svn: 258925
2016-01-27 11:37:12 +00:00
Alexander Kornienko ad166f5dcc Add clang-tools-extra documentation to the CMake build.
llvm-svn: 258924
2016-01-27 11:37:08 +00:00
Eugene Zelenko 7da47b8ef5 Fix Clang-tidy modernize-use-override warning in unittests/clang-tidy/IncludeInserterTest.cpp; other minor fixes.
Differential revision: http://reviews.llvm.org/D16566

llvm-svn: 258870
2016-01-26 22:32:24 +00:00
Chris Bieneman 2cc7fec76a Remove autoconf support
Summary:
This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html

"Now I am become Death, the destroyer of worlds."
-J. Robert Oppenheimer

Reviewers: chandlerc, grosbach, bob.wilson, echristo

Subscribers: cfe-commits, klimek

Differential Revision: http://reviews.llvm.org/D16475

llvm-svn: 258864
2016-01-26 21:31:36 +00:00
Jonathan Coe 2c8592a80f Test commit. Fix typo in comment.
llvm-svn: 258835
2016-01-26 18:55:55 +00:00
Alexander Kornienko dc84150e4f Fix crashing on user-defined conversion.
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
2016-01-26 10:56:27 +00:00
Aaron Ballman a5d55a4617 Add support to the misc-assert-side-effect check for MSVC-style assert macros, which use !! instead of an if statement or a conditional operator.
llvm-svn: 258714
2016-01-25 20:00:53 +00:00
Gabor Horvath 93bc576ec9 [clang-tidy] Handle decayed types and other improvements in VirtualNearMiss 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
2016-01-22 21:45:51 +00:00
Aaron Ballman b61829887d Make modernize-use-default tolerant of delayed template parsing; this code was previously causing failed assertions because dyn_cast was being passed a null pointer due to the delay-parsed body.
llvm-svn: 258356
2016-01-20 22:14:10 +00:00
Dimitry Andric d325ab8cb8 Ensure the lit.site.cfg and Unit/lit.site.cfg make targets do not use
the same temporary file, otherwise there is a race condition when using
parallel make jobs.

llvm-svn: 258327
2016-01-20 18:53:44 +00:00
Alexander Kornienko e04dd2525c [clang-tidy] Python scripts shebang fixes
Summary:
This patch fixes shebang lines in Python script files.

Most Python scripts in LLVM & Clang are using this shebang line.

[[ https://mail.python.org/pipermail/tutor/2007-June/054816.html | Here]] is an explanaiton of why such line should be used instead of what is currently in these few files.

Reviewers: klimek, alexfh

Subscribers: cfe-commits

Patch by Kirill Bobyrev!

Differential Revision: http://reviews.llvm.org/D16270

llvm-svn: 258133
2016-01-19 16:10:39 +00:00
Alexander Kornienko 3c95377eb1 [clang-tidy] Fixed wording ("clang-tidy check", not "clang-tidy checker")
llvm-svn: 258098
2016-01-18 22:51:09 +00:00
Alexander Kornienko 33c2494b69 [clang-tidy] Fix a copy-paste error.
llvm-svn: 257900
2016-01-15 16:16:47 +00:00
Jonathan Roelofs d60388a985 Teach clang-tidy how to upgrade warnings into errors.
Similar in format to the `-checks=` argument, this new `-warnings-as-errors=`
argument upgrades any warnings emitted by the former to errors.

http://reviews.llvm.org/D15528

llvm-svn: 257642
2016-01-13 17:36:41 +00:00
Alexander Kornienko 3f36fbbeb5 [clang-tidy] Slightly clarified comments.
llvm-svn: 257600
2016-01-13 14:16:43 +00:00