summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra
Commit message (Collapse)AuthorAgeFilesLines
* Analyze include order on a per-file basis.Zachary Turner2016-08-126-60/+133
| | | | | | | | | | | | | | | | | | | The include order check would get notified of all include directives in a depth-first manner. This created the possibility of an include directive from a header file interfering with the sort order of a set of two distinct blocks from the top level cpp file, if that include directive was on just the right line. With this patch we bucket the include directives by the file in which they appear in and process one bucket at a time, so that directives from different files do not get mixed together into the same list. Reviewed By: alexfh Differential Revision: https://reviews.llvm.org/D23434 llvm-svn: 278546
* [clang-tidy] fix readability-else-after-return testKirill Bobyrev2016-08-111-1/+1
| | | | | | | | | As pointed by Yung Douglas, exceptions in test/clang-tidy/readability-else-after-return.cpp are causing PS4 bots to be red, because exceptions aren't enabled by default on PS4 target. This patch is a fix. llvm-svn: 278324
* [Documentation] Improve consistency.Eugene Zelenko2016-08-103-12/+12
| | | | | | Mention Clang-rename Emacs integration in release notes. llvm-svn: 278295
* [Documentation] Fix style and grammar mistake in Clang-tidy ↵Eugene Zelenko2016-08-101-1/+1
| | | | | | readability-else-after-return description spotted by Alexander Kornienko. llvm-svn: 278279
* [Documentation] Highlighting consistency and spelling mistake fix in ↵Eugene Zelenko2016-08-101-3/+3
| | | | | | Clang-tidy readability-else-after-return description. llvm-svn: 278263
* [Release Notes] Consistency in Clang-tidy entries' style.Eugene Zelenko2016-08-101-3/+2
| | | | llvm-svn: 278262
* [clang-tidy] enhance readability-else-after-returnKirill Bobyrev2016-08-103-16/+107
| | | | | | | | | | | | `readability-else-after-return` only warns about `return` calls, but LLVM Coding Standars stat that `throw`, `continue`, `goto`, etc after `return` calls are bad, too. Reviwers: alexfh, aaron.ballman Differential Revision: https://reviews.llvm.org/D23265 llvm-svn: 278257
* [Documentation] Fix grammar mistakes in docs/clang-tidy/index.rst spotted by ↵Eugene Zelenko2016-08-101-1/+1
| | | | | | Alexander Kornienko. llvm-svn: 278255
* [clang-tidy] minor improvements in modernise-deprecated-headers checkKirill Bobyrev2016-08-104-231/+254
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces a minor list of changes as proposed by Richard Smith in the mailing list. See original comments with an impact on the future check state below: [comments.begin > + {"complex.h", "ccomplex"}, It'd be better to convert this one to <complex>, or leave it alone. <ccomplex> is an unnecessary wart. (The contents of C++11's <complex.h> / <ccomplex> / <complex> (all of which are identical) aren't comparable to C99's <complex.h>, so if this was C++98 code using the C99 header, the code will be broken with or without this transformation.) > + {"iso646.h", "ciso646"}, Just delete #includes of this one. <ciso646> does nothing. > + {"stdalign.h", "cstdalign"}, > + {"stdbool.h", "cstdbool"}, We should just delete these two includes. These headers do nothing in C++. comments.end] Reviewers: alexfh, aaron.ballman Differential Revision: https://reviews.llvm.org/D17990 llvm-svn: 278254
* [clang-rename] fix test introduced in r278221Kirill Bobyrev2016-08-101-7/+7
| | | | llvm-svn: 278225
* [clang-rename] remove bunch of deprecated testsKirill Bobyrev2016-08-1017-295/+0
| | | | llvm-svn: 278223
* [clang-rename] merge tests when possibleKirill Bobyrev2016-08-1021-160/+292
| | | | | | | | | | | The only difference between some tests is -offset passed to clang-rename. It makes sense to merge them into a single file and add multiple tool invocations. Reviewers: alexfh Differential Revision: https://reviews.llvm.org/D23158 llvm-svn: 278221
* clang-rename YAML reader: address post-commit commentsMiklos Vajna2016-08-102-7/+6
| | | | llvm-svn: 278201
* [Documentation] Fix spelling mistakes in docs/clang-tidy/index.rst.Eugene Zelenko2016-08-101-5/+5
| | | | llvm-svn: 278198
* clang-rename rename-all: support reading old/newname pairs from a YAML fileMiklos Vajna2016-08-095-8/+113
| | | | | | | | | | | This is handy in case by the time clang-rename is invoked, an external tool already genereated a list of oldname -> newname pairs to handle. Reviewers: omtcyfz Differential Revision: https://reviews.llvm.org/D23198 llvm-svn: 278145
* [clang-rename] cleanup: use isWrittenKirill Bobyrev2016-08-092-4/+4
| | | | | | | | | | | | | | nit: use isWritten and const auto *Initializer in NamedDeclFindingASTVisitor::VisitCXXConstructorDecl method. Test plan: make -j8 check-clang-tools (passed) Patch by Alexander Shaposhnikov! Reviewers: omtcyfz Differential Revision: https://reviews.llvm.org/D23298 llvm-svn: 278112
* Fix Wdocumentation unknown parameter warningSimon Pilgrim2016-08-091-1/+1
| | | | llvm-svn: 278111
* [include-fixer] Support processing multiple files in one run.Haojian Wu2016-08-099-75/+116
| | | | | | | | | | | | | | | | | | | Summary: Previously, if we pass multiple files or a file pattern (e.g. /path/to/*.cc) to include-fixer, include-fixer will apply all replacements to the first argument, which probably causes crashes. With this patch, include-fixer can process multiple files now. Vim and Emacs integration are tested manually. Reviewers: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23266 llvm-svn: 278102
* Fix clang-tidy crash when a single fix is applied on multiple files.Eric Liu2016-08-096-47/+83
| | | | | | | | | | | | | | | Summary: tooling::Replacements only holds replacements for a single file, so this patch makes Fix a map from file paths to tooling::Replacements so that it can be applied on multiple files. Reviewers: hokein, alexfh Subscribers: Prazek, cfe-commits Differential Revision: https://reviews.llvm.org/D23257 llvm-svn: 278101
* [clang-rename] fix bug with initializer listsKirill Bobyrev2016-08-093-19/+30
| | | | | | | | | | | Clang-rename is currently not able to find a symbol in initializer list. This patch fixes described issue. Reviewers: alexfh Differential Revision: https://reviews.llvm.org/D23193 llvm-svn: 278099
* [clang-tidy] enhance modernize-use-bool-literals to check ternary operatorKirill Bobyrev2016-08-083-16/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | modernize-use-bool-literals doesn't checks operands in ternary operator. For example: ``` c++ static int Value = 1; bool foo() { bool Result = Value == 1 ? 1 : 0; return Result; } bool boo() { return Value == 1 ? 1 : 0; } ``` This issue was reported in bug 28854. The patch fixes it. Reviewers: alexfh, aaron.ballman, Prazek Subscribers: Prazek, Eugene.Zelenko Differential Revision: https://reviews.llvm.org/D23243 llvm-svn: 278022
* [include-fixer] Correct some header mappings.Haojian Wu2016-08-051-8/+8
| | | | | | | | | | Reviewers: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23199 llvm-svn: 277811
* Reapply r276973 "Adjust Registry interface to not require plugins to export ↵John Brawn2016-08-052-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a registry" This differs from the previous version by being more careful about template instantiation/specialization in order to prevent errors when building with clang -Werror. Specifically: * begin is not defined in the template and is instead instantiated when Head is. I think the warning when we don't do that is wrong (PR28815) but for now at least do it this way to avoid the warning. * Instead of performing template specializations in LLVM_INSTANTIATE_REGISTRY instead provide a template definition then do explicit instantiation. No compiler I've tried has problems with doing it the other way, but strictly speaking it's not permitted by the C++ standard so better safe than sorry. Original commit message: Currently the Registry class contains the vestiges of a previous attempt to allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a plugin would have its own copy of a registry and export it to be imported by the tool that's loading the plugin. This only works if the plugin is entirely self-contained with the only interface between the plugin and tool being the registry, and in particular this conflicts with how IR pass plugins work. This patch changes things so that instead the add_node function of the registry is exported by the tool and then imported by the plugin, which solves this problem and also means that instead of every plugin having to export every registry they use instead LLVM only has to export the add_node functions. This allows plugins that use a registry to work on Windows if LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used. llvm-svn: 277806
* [clang-tidy] misc-argument-comment non-strict modeAlexander Kornienko2016-08-047-26/+88
| | | | | | | | | | | | | | | | | Summary: The misc-argument-comment check now ignores leading and trailing underscores and case. The new `StrictMode` local/global option can be used to switch back to strict checking. Add getLocalOrGlobal version for integral types, minor cleanups. Reviewers: hokein, aaron.ballman Subscribers: aaron.ballman, Prazek, cfe-commits Differential Revision: https://reviews.llvm.org/D23135 llvm-svn: 277729
* [clang-rename] add missing clang-format improvementsKirill Bobyrev2016-08-042-3/+3
| | | | | | | | r277702 introduced clang-format changes so that later commits wouldn't introduce non-functional changes while running clang-format before commiting. Though, few changes by clang-format weren't in the patch. llvm-svn: 277709
* Run clang-format on clang-rename codeMiklos Vajna2016-08-043-13/+10
| | | | | | | | | | | So that later commits don't introduce non-functional changes when running clang-format before committing. Reviewers: klimek Differential Revision: https://reviews.llvm.org/D23153 llvm-svn: 277702
* [clang-tidy] Inefficient string operationAlexander Kornienko2016-08-038-0/+232
| | | | | | | | Patch by Bittner Barni! Differential revision: https://reviews.llvm.org/D20196 llvm-svn: 277677
* [clang-rename] improve USRFindingActionKirill Bobyrev2016-08-035-85/+100
| | | | | | | | | | | | | | | | | | | | | | 1. Improve templated class renaming, namely add capabilities of finding partial and full specializations. Every class partial specialization has reference to the specialized class. Thus, storing all partial specializations and comparing specialized class decls to the FoundDecl solves this. All full class specializations can be found by calling ClassTemplateDecl::specializations(). 2. Fix virtual function and its overriding functions renaming. Renaming a virtual function requires renaming every other function in its "overriding graph". 3. Merge TemplateClassInstantiationFindBy{Declaration|TypeUse}.cpp tests into one test by adding multiple invocations of clang-rename to one test, because the only different thing across these tests is -offset passed to clang-rename. Reviewers: alexfh Differential Revision: https://reviews.llvm.org/D23058 llvm-svn: 277663
* [docs] fix typo in clang-rename docsKirill Bobyrev2016-08-031-3/+3
| | | | | | clang-rename is a refactoring tool, not "linter" tool. Fix typo in docs. llvm-svn: 277623
* [extra-tools] Fix extra tools build bot warnings due to incorrect docEtienne Bergeron2016-08-031-2/+2
| | | | | | | /home/llvmbb/llvm-build-dir/clang-x86_64-debian-fast/llvm.src/tools/clang/tools/extra/clang-tidy/mpi/TypeMismatchCheck.cpp:172:12: warning: parameter 'Complex' not found in the function declaration [-Wdocumentation] /home/llvmbb/llvm-build-dir/clang-x86_64-debian-fast/llvm.src/tools/clang/tools/extra/clang-tidy/mpi/TypeMismatchCheck.cpp:206:12: warning: parameter 'Complex' not fo llvm-svn: 277578
* [clang-tidy] address concerns with rL277340Kirill Bobyrev2016-08-031-18/+18
| | | | | | | | | | alexfh raised a concern with https://reviews.llvm.org/rL277340 After retabbing indentation of .. code-block:: was increased to 8, 4 spaces indentation should be enough. Reviewers: alexfh llvm-svn: 277577
* [clang-tidy] Fix missing dependency to static analyzerEtienne Bergeron2016-08-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch is fixing the build bot broken for a missing dependency. The missing dependency is breaking "shared" build. ``` ./mpi/TypeMismatchCheck.cpp: #include "clang/StaticAnalyzer/Checkers/MPIFunctionClassifier.h" ``` I'm not a fan of that fix. It's brining a strange dependency. Reviewers: alexfh Subscribers: llvm-commits, chrisha Differential Revision: https://reviews.llvm.org/D23093 llvm-svn: 277539
* [clang-tidy] Fix segfault in cppcore-guidelines-special-member-functions checkJonathan Coe2016-08-023-21/+33
| | | | | | | | | | | | | | | | | | | | Summary: Use a set rather than a vector of defined special member functions so that multiple declarations of the same function are only counted once. Move some private static member functions into the cpp file. Run clang-format on header. Reviewers: ericLemanissier, Prazek, aaron.ballman Subscribers: Prazek, cfe-commits, nemanjai Projects: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D23008 llvm-svn: 277523
* [docs] Fix links format.Alexander Kornienko2016-08-022-5/+5
| | | | llvm-svn: 277517
* [clang-tidy] MPITypeMismatchCheckAlexander Kornienko2016-08-0212-0/+786
| | | | | | | | | | | | | | | | This check verifies if buffer type and MPI (Message Passing Interface) datatype pairs match. All MPI datatypes defined by the MPI standard (3.1) are verified by this check. User defined typedefs, custom MPI datatypes and null pointer constants are skipped, in the course of verification. Instructions on how to apply the check can be found at: https://github.com/0ax1/MPI-Checker/tree/master/examples Patch by Alexander Droste! Differential revision: https://reviews.llvm.org/D21962 llvm-svn: 277516
* [clang-rename] fix Emacs integration scriptKirill Bobyrev2016-08-021-3/+1
| | | | llvm-svn: 277491
* [clang-rename] fix Emacs script build failureKirill Bobyrev2016-08-021-2/+3
| | | | | | Clang-rename Emacs integration script sometimes doesn't work correctly. llvm-svn: 277469
* clang-tools-extra/test/clang-rename/TemplateTypenameFindBy*.cpp: Appease ↵NAKAMURA Takumi2016-08-022-2/+2
| | | | | | targeting ms mode. llvm-svn: 277452
* clang-tools-extra/test/clang-rename/TemplateTypenameFindBy*.cpp: Move RUN: ↵NAKAMURA Takumi2016-08-022-8/+8
| | | | | | lines below not to be affected by tweaks of parameters. llvm-svn: 277451
* [clang-tidy] Fix an unused-using-decl false positive about template arguments inHaojian Wu2016-08-023-4/+48
| | | | | | | | | | | | | | | | function call expression. Summary: The check doesn't mark the template argument as used when the template argument is a template. Reviewers: djasper, alexfh Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D22803 llvm-svn: 277444
* [include-fixer] Correct nested class search for identifiers with scoped ↵Haojian Wu2016-08-025-12/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | information Summary: include-fixer will firstly try to use scoped namespace context information to search identifier. However, in some cases, it's unsafe to do nested class search, because it might treat the identifier as a nested class of scoped namespace. Given the following code, and the symbol database only has two classes: "foo" and "b::Bar". namespace foo { Bar t; } Before getting fixing, include-fixer will never search "Bar" symbol. Because it firstly tries to search "foo::Bar", there is no "Bar" in foo namespace, then it finds "foo" in database finally. So it treats "Bar" is a nested class of "foo". Reviewers: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23023 llvm-svn: 277442
* clang-rename: split existing options into two new subcommandsMiklos Vajna2016-08-029-89/+234
| | | | | | | | | | | | | | | - rename-at is meant to be integrated with editors and works mainly off of a location in a file, and this is the default - rename-all is optimized for one or more oldname->newname renames, and works with clang-apply-replacements Reviewers: bkramer, klimek Subscribers: omtcyfz Differential Revision: https://reviews.llvm.org/D21814 llvm-svn: 277438
* [clang-rename] add support for template parameter renamingKirill Bobyrev2016-08-024-10/+13
| | | | | | | | | | | Few simple tweaks allow template parameters to be renamed. See TemplateTypenameFindBy{TemplateParam|TypeInside}.cpp Reviewers: alexfh Differential Revision: https://reviews.llvm.org/D22853 llvm-svn: 277437
* [clang-rename] add basic Emacs integrationKirill Bobyrev2016-08-023-7/+73
| | | | | | | | | | This patch aims to add very basic Emacs integration. Reviewers: hokein, alexfh Differential Revision: https://reviews.llvm.org/D23006 llvm-svn: 277433
* [clang-rename] handle overridden functions correctlyKirill Bobyrev2016-08-014-19/+36
| | | | | | | | | | | | | 1. Renaming overridden functions only works for two levels of "overriding hierarchy". clang-rename should recursively add overridden methods. 2. Make use of forEachOverridden AST Matcher. 3. Fix two tests. Reviewers: alexfh Differential Revision: https://reviews.llvm.org/D23009 llvm-svn: 277356
* [clang-rename] revert r276836Kirill Bobyrev2016-08-0127-43/+96
| | | | | | | Revert r276836, which resulted in tests passing regardless of the actual tool replacements. llvm-svn: 277354
* [clang-tidy] remove trailing whitespaces and retabKirill Bobyrev2016-08-0126-54/+54
| | | | llvm-svn: 277340
* [clang-tidy] Prepare modernize-loop-convert for upcoming changes in D22566Martin Bohme2016-08-011-0/+12
| | | | | | | | | | | | | | | Summary: D22566 will change RecursiveASTVisitor so that it descends into the initialization expressions for lambda captures. modernize-loop-convert needs to be prepared for this so that it does not interpret these initialization expressions as invalid uses of the loop variable. The change has no ill effects without D22566 in place, i.e. the change does not depend on D22566. Reviewers: klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D22903 llvm-svn: 277339
* Changes related to new implementation of tooling::Replacements as class.Eric Liu2016-08-0111-36/+152
| | | | | | | | | | | | Summary: See http://reviews.llvm.org/D21748 for details. Reviewers: djasper, klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D21749 llvm-svn: 277336
* [clang-tidy] add check cppcoreguidelines-special-member-functionsJonathan Coe2016-07-309-0/+343
| | | | | | | | | | | | | | | | | | | Summary: Check for classes that violate the rule of five and zero as specified in CppCoreGuidelines: "If a class defines or deletes a default operation then it should define or delete them all." https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c21-if-you-define-or-delete-any-default-operation-define-or-delete-them-all. Reviewers: alexfh, sbenza, aaron.ballman Subscribers: Prazek, Eugene.Zelenko, cfe-commits, ericLemanissier, nemanjai Projects: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D22513 llvm-svn: 277262
OpenPOWER on IntegriCloud