summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra
Commit message (Collapse)AuthorAgeFilesLines
* Implemented clang-tidy-check-specific options.Alexander Kornienko2014-09-1235-58/+263
| | | | | | | | | | | | | | | | | Summary: Each check can implement readOptions and storeOptions methods to read and store custom options. Each check's options are stored in a local namespace to avoid name collisions and provide some sort of context to the user. Reviewers: bkramer, klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5296 llvm-svn: 217661
* Moved main() to the clang::tidy namespace, no functional changes.Alexander Kornienko2014-09-101-22/+24
| | | | llvm-svn: 217493
* std::function-ize ClangTidyCheckFactories.Alexander Kornienko2014-09-102-63/+46
| | | | | | | | | | | | Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5289 llvm-svn: 217492
* Unique-ptrify ClangTidyCheckFactories. Add a more convenient alternative toAlexander Kornienko2014-09-105-76/+50
| | | | | | | | | | | | | | addCheckFactory: registerCheck. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5288 llvm-svn: 217489
* [clang-tidy] Don't try to fix header guard #endif comments if there are escapedBenjamin Kramer2014-09-102-0/+21
| | | | | | | | newlines involved. Getting that right is just not worth it. llvm-svn: 217480
* Unique_ptrify PPCallbacks ownership. Goes with clang r217474.Craig Topper2014-09-106-7/+12
| | | | llvm-svn: 217475
* clang-apply-replacements: For-rangify.Benjamin Kramer2014-09-092-29/+20
| | | | | | No functionality change. llvm-svn: 217442
* clang-apply-replacements: Deduplicate paths with FileManager.Benjamin Kramer2014-09-094-46/+45
| | | | | | | | Bucket replacements by FileEntry instead of path. The same file with different paths is very common, relative #include paths and symlinks can easily create them. When that occurs we would apply the fix twice. llvm-svn: 217440
* Fixed a typo.Alexander Kornienko2014-09-081-1/+2
| | | | llvm-svn: 217377
* run-clang-tidy: Make clang-tidy path configurable and don't fail as horriblyBenjamin Kramer2014-09-081-9/+23
| | | | | | when it's not around. llvm-svn: 217374
* [clang-tidy] Add a couple of paragraphs on run-clang-tidy.py to the docs.Benjamin Kramer2014-09-081-0/+30
| | | | | | Happy tidying. llvm-svn: 217373
* Move clang-tools-extra docs 1.5 years into the future.Benjamin Kramer2014-09-081-2/+2
| | | | llvm-svn: 217369
* [clang-tidy] Add a little python script that can run clang-tidy and apply ↵Benjamin Kramer2014-09-081-0/+175
| | | | | | | | | | | | | | | | fixes over an entire codebase. Ever wanted to fix all the header guards in clang? Now it's easy. Make sure clang-tidy is in $PATH and a compilation database is available. $ ./run-clang-tidy.py -checks=-*,llvm-header-guard -fix ... get coffee (or more CPU cores) ... $ svn diff Some may argue that this is just a glorified xargs -P, but it does a bit more ;) Differential Revision: http://reviews.llvm.org/D5188 llvm-svn: 217368
* Try to make VS 2012 happy after r217155Hans Wennborg2014-09-041-3/+4
| | | | | | | | | | | | | | | | It was failing with: C:\bb-win7\ninja-clang-i686-msc17-R\llvm-project\llvm\include\llvm/Support/ErrorOr.h(102) : error C3861: 'make_error_code': identifier not found C:\bb-win7\ninja-clang-i686-msc17-R\llvm-project\clang-tools-extra\clang-tidy\ClangTidyOptions.cpp(153) : see reference to function template instantiation 'llvm::ErrorOr<T>::ErrorOr<std::errc::errc>(E,void *)' being compiled with [ T=clang::tidy::ClangTidyOptions, E=std::errc::errc ] llvm-svn: 217201
* Don't write files with no fixes.Alexander Kornienko2014-09-041-1/+1
| | | | llvm-svn: 217163
* Plug a unit test memory leak.Benjamin Kramer2014-09-041-1/+2
| | | | | | MatchFinder.addMatcher doesn't take ownership. llvm-svn: 217162
* Implemented clang-tidy configurability via .clang-tidy files.Alexander Kornienko2014-09-0414-50/+280
| | | | | | | | | | | | | | | | | Summary: This adds a support for the .clang-tidy file reading using FileOptionsProvider, -dump-config option, and changes tests to not depend on default checks set. Reviewers: klimek, bkramer, djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5186 llvm-svn: 217155
* [clang-tidy] Add an option to export suggested fixes into a file.Benjamin Kramer2014-09-044-1/+38
| | | | | | | | Allows gathering fixes and applying them with clang-apply-fixes. Differential Revision: http://reviews.llvm.org/D5176 llvm-svn: 217139
* ClangTidy misc-argument-comment check: don't check arguments to templateAlexander Kornienko2014-09-032-3/+23
| | | | | | | | | | | | | | | | | | | parameter packs. Summary: This disables this check for std::bind and similar functions that use parameter packs to forward arguments to a different function. Name of the parameter pack argument doesn't matter. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5168 llvm-svn: 217039
* [clang-tidy] Eliminate inline copies of InTemplateInstantiation matcher.Benjamin Kramer2014-09-035-25/+9
| | | | llvm-svn: 217036
* [clang-tidy] Use new ASTMatchers to identify template instantiations instead ↵Benjamin Kramer2014-09-033-13/+3
| | | | | | | | of copying it everywhere. No intended functionality change. llvm-svn: 217035
* Remove unused AST matcher.Benjamin Kramer2014-09-022-5/+5
| | | | llvm-svn: 216901
* [clang-tidy] Don't suggest naming the dummy argument of a post-inc operator ↵Benjamin Kramer2014-09-012-3/+25
| | | | | | overload. llvm-svn: 216868
* Try to fix test on msvc and 32 bit hosts.Benjamin Kramer2014-08-292-5/+5
| | | | llvm-svn: 216727
* [clang-tidy] Add a checker that suggests replacing short/long/long long with ↵Benjamin Kramer2014-08-295-0/+202
| | | | | | | | fixed-size types. Differential Revision: http://reviews.llvm.org/D5119 llvm-svn: 216726
* [clang-tidy] Don't suggest naming unnamed parameters on deleted/defaulted ↵Benjamin Kramer2014-08-292-1/+5
| | | | | | functions. llvm-svn: 216718
* Remove call to llvm::makeArrayRef. Implicit conversion is sufficient.Craig Topper2014-08-291-1/+1
| | | | llvm-svn: 216711
* Update for Clang API change.David Blaikie2014-08-272-4/+3
| | | | llvm-svn: 216615
* Update for LLVM api change.Rafael Espindola2014-08-272-4/+6
| | | | llvm-svn: 216584
* Adjust call 'CreateAnalysisConsumer' due to API tweak.Ted Kremenek2014-08-271-3/+1
| | | | llvm-svn: 216551
* Simplify creation of a couple ArrayRefs by using None and makeArrayRef.Craig Topper2014-08-271-2/+2
| | | | llvm-svn: 216529
* [clang-tidy] If we're going to change the header guard in the #endif commentBenjamin Kramer2014-08-262-13/+44
| | | | | | | | | we can also fix the original header guard. We still allow an _ at the end of a header guard since it's so common, but remove it now when the #endif comment is changed. llvm-svn: 216462
* Update for LLVM api changeRafael Espindola2014-08-256-27/+22
| | | | llvm-svn: 216396
* [clang-tidy] Allow /**/ comments on #endifs when checking header guards.Benjamin Kramer2014-08-202-1/+32
| | | | | | Turning block comments into line comments just creates unecessary churn. llvm-svn: 216072
* Revert rL215947: "[clang-rename] revert r215839"Manuel Klimek2014-08-2019-2/+1007
| | | | | | Make tests not depend on grep supporting -bo. llvm-svn: 216041
* [clang-rename] revert r215839Gerolf Hoflehner2014-08-1819-1005/+2
| | | | | | | | | | | | | | | | | | | | The commit broke public build bots for more than 24 hours. (view as text) ******************** TEST 'Clang Tools :: clang-rename/VarTest.cpp' FAILED ******************** Script: -- cat /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang.src/tools/extra/test/clang-rename/VarTest.cpp > /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp clang-rename -offset=$(grep -FUbo 'foo;' /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp | head -1 | cut -d: -f1) -new-name=hector /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp -i -- sed 's,//.*,,' /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp | FileCheck /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang.src/tools/extra/test/clang-rename/VarTest.cpp -- Exit Code: 1 Command Output (stderr): -- clang-rename: could not find symbol at /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp:2:1 (offset 14). llvm-svn: 215947
* [CMake] clang-rename: Optimize libdeps.NAKAMURA Takumi2014-08-181-9/+0
| | | | llvm-svn: 215935
* Add trailing linefeed.NAKAMURA Takumi2014-08-181-1/+1
| | | | llvm-svn: 215934
* Revert r215854 corresponding to r215857, "Suppress ↵NAKAMURA Takumi2014-08-171-2/+1
| | | | | | ClangRenameTests/USRLocFinding.FindsVarUSR on msc17 for now. Will fix later." llvm-svn: 215859
* Remove initializer list.Manuel Klimek2014-08-171-5/+12
| | | | llvm-svn: 215857
* Suppress ClangRenameTests/USRLocFinding.FindsVarUSR on msc17 for now. Will ↵NAKAMURA Takumi2014-08-171-1/+2
| | | | | | fix later. llvm-svn: 215854
* Fix link libraries for clang-rename.Manuel Klimek2014-08-171-0/+7
| | | | llvm-svn: 215843
* Remove mention of non-existent 'test' directory.Manuel Klimek2014-08-171-3/+0
| | | | llvm-svn: 215840
* First version of a clang-rename tool.Manuel Klimek2014-08-1719-2/+1003
| | | | | | | | | | | | | | | | Summary: Note that this code is still grossly under-tested - the next steps will be to add significantly better test coverage. Patch by Matthew Plant. Test Plan: Reviewers: Subscribers: llvm-svn: 215839
* AvoidCStyleCastsCheck: don't warn on casts in macrosAlexander Kornienko2014-08-162-7/+6
| | | | llvm-svn: 215799
* ClangTidyTests: Suppress FixHeaderGuards on win32 for now.NAKAMURA Takumi2014-08-131-0/+3
| | | | | FIXME: It seems this might be incompatible to dos path. Investigating. llvm-svn: 215590
* [CMake] Update libdeps in clangTidyLLVMModule.NAKAMURA Takumi2014-08-131-0/+1
| | | | llvm-svn: 215589
* In ancient times build targets had to be sorted topologically. Sometimes ↵Benjamin Kramer2014-08-132-2/+2
| | | | | | this behavior can still be observed today. llvm-svn: 215553
* Fix linking in the Makefile build.Benjamin Kramer2014-08-131-1/+1
| | | | llvm-svn: 215550
* [clang-tidy] Add a generic header guard checker + LLVM implementation.Benjamin Kramer2014-08-1311-1/+452
| | | | | | | | | | | | | | | | | | | | The implementation is split into a generic part and a LLVM-specific part. Other codebases can implement it with their own style. The specific features supported are: - Verification (and fixing) of header guards against a style based on the file path - Automatic insertion of header guards for headers that are missing them - A warning when the header guard doesn't enable our fancy header guard optimization (e.g. when there's an include preceeding the guard) - Automatic insertion of a comment with the guard name after #endif. For the LLVM style we disable #endif comments for now, they're not very common in the codebase. We also only flag headers in the include directories, there doesn't seem to be a common style outside. Differential Revision: http://reviews.llvm.org/D4867 llvm-svn: 215548
OpenPOWER on IntegriCloud