summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests
Commit message (Collapse)AuthorAgeFilesLines
* [include-fixer] Fix Clang-tidy modernize-use-override and some Include What ↵Eugene Zelenko2016-05-021-2/+13
| | | | | | | | You Use warnings. Differential revision: http://reviews.llvm.org/D19755 llvm-svn: 268262
* [include-fixer] Add an option to minimize include paths.Benjamin Kramer2016-04-281-11/+38
| | | | | | | This will always pick the shortest possible path based on -I options. Based on the #include suggestion code for modules. llvm-svn: 267868
* FindAllSymbolsTest.CTypedefTest: Tweak for LLP64 like x86_64-win32.NAKAMURA Takumi2016-04-281-2/+2
| | | | | | | | | | In file included from symbol.cc:1: symbols.h:2:24: error: typedef redefinition with different types ('unsigned int' vs 'unsigned long long') typedef unsigned size_t; ^ llvm-svn: 267841
* Fix a bunch of sign-compare warningsDavid Blaikie2016-04-271-4/+4
| | | | llvm-svn: 267754
* [find-all-symbols] Also update unittest dependencies.Benjamin Kramer2016-04-271-0/+2
| | | | llvm-svn: 267739
* [include-fixer] Add a find-all-symbols tool for include-fixer.Haojian Wu2016-04-273-0/+387
| | | | | | | | | | | | | | | | Summary: The find-all-symbols tool generates a yaml symbol database for include-fixer. The symbol matcher is originally written by Xiaoyi Liu. Reviewers: bkramer, djasper Subscribers: cfe-commits, klimek, ioeric Differential Revision: http://reviews.llvm.org/D19482 llvm-svn: 267719
* IncludeFixerTest.cpp: Tweak not to assume clang-tools-extra were onto ↵NAKAMURA Takumi2016-04-202-1/+4
| | | | | | clang/tools/extra. llvm-svn: 266874
* [include-fixer] Add a prototype for a new include fixing tool.Benjamin Kramer2016-04-203-0/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The goal of this tool is fairly simple, look up unknown identifiers in a global database and add the corresponding #include line. It accomplishes this by hooking into Sema as an ExternalSemaSource and responding to typo correction callbacks. This means we can see the unknown identifier before it's being munged by error recovery. This doesn't work perfectly yet as some typo corrections don't emit callbacks (delayed typos), but I think this is fixable. We also handle only one include at a time as this is meant to be run directly from the editing environment eventually. Adding multiple includes at the same time is tricky because of error recovery. This version only has a a dummy database, so all you can do is fixing missing includes of <string>, but the indexer to build a database will follow soon. Reviewers: djasper Subscribers: ioeric, hokein, cfe-commits Differential Revision: http://reviews.llvm.org/D19314 llvm-svn: 266870
* Fix Clang-tidy modernize-deprecated-headers warnings; other minor fixes.Eugene Zelenko2016-03-171-4/+3
| | | | | | Differential revision: http://reviews.llvm.org/D18231 llvm-svn: 263726
* Fix Clang-tidy modernize-use-override warning in ↵Eugene Zelenko2016-01-261-2/+1
| | | | | | | | unittests/clang-tidy/IncludeInserterTest.cpp; other minor fixes. Differential revision: http://reviews.llvm.org/D16566 llvm-svn: 258870
* Remove autoconf supportChris Bieneman2016-01-265-119/+0
| | | | | | | | | | | | | | | | 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
* Remove clang-modernize.Alexander Kornienko2015-12-1710-1103/+1
| | | | | | | | | | | | | | Summary: clang-modernize transforms have moved to clang-tidy. Removing the old tool now. Reviewers: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15606 llvm-svn: 255886
* Revert "Apply modernize-use-default to clang-tools-extra."David Blaikie2015-10-201-1/+1
| | | | | | | | | Breaks the build in GCC 4.7.2 (see http://lab.llvm.org:8011/builders/perf-x86_64-penryn-O3 for example) This reverts commit r250824. llvm-svn: 250862
* Apply modernize-use-default to clang-tools-extra.Angel Garcia Gomez2015-10-201-1/+1
| | | | | | | | | | | | Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: klimek Subscribers: alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13889 llvm-svn: 250824
* Fix overlapping replacements in clang-tidy.Angel Garcia Gomez2015-10-161-43/+73
| | | | | | | | | | | | Summary: Prevent clang-tidy from applying fixes to errors that overlap with other errors' fixes, with one exception: if one fix is completely contained inside another one, then we can apply the big one. Reviewers: bkramer, klimek Subscribers: djasper, cfe-commits, alexfh Differential Revision: http://reviews.llvm.org/D13516 llvm-svn: 250509
* [VFS] Switch clang-tidy tests to use an in-memory fs.Benjamin Kramer2015-10-071-4/+8
| | | | | | | Again, this is both cleaner and completely removes any depedency on the host file system. llvm-svn: 249526
* Create interfaces and tests for the overlapping replacements fix in clang-tidy.Angel Garcia Gomez2015-10-064-9/+413
| | | | | | | | | | | | Summary: No changes in clang-tidy yet. Reviewers: klimek Subscribers: alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13469 llvm-svn: 249402
* [clang-tidy] Fix PR22785.Alexander Kornienko2015-09-091-0/+21
| | | | | | | | | | | Fix http://llvm.org/PR22785. Bug 22785 - readability-braces-around-statements doesn't work well with macros. http://reviews.llvm.org/D12729 Patch by Marek Kurdej! llvm-svn: 247163
* Move some more functionality into the AST consumer creation factory ↵Aaron Ballman2015-09-021-3/+6
| | | | | | function, before registering matchers with the MatchFinder object. This allows us to set the language options for the ClangTidyContext object appropriately so that they can be used from registerMatchers(), and more closely models the way the clang-tidy tool works. llvm-svn: 246660
* Remove empty destructors added in r245500. I got confused by myDaniel Jasper2015-08-191-4/+0
| | | | | | | YouCompleteMe setup which apparently doesn't find the base classes and thus doesn't understand that there is an implicit virtual destructor. llvm-svn: 245510
* Fix IncludeInserter to allow for more than one added header per file.Daniel Jasper2015-08-191-46/+83
| | | | | | | | Also adapt tests a bit to make it possible to test this. Removed checking the number of errors reported per test. It was never actually checked and doesn't seem particularly relevant to the test itself. llvm-svn: 245500
* [clang-tidy] Move IncludeSorter.* and IncludeInserter.* to clang-tidy/utils/Alexander Kornienko2015-08-141-1/+1
| | | | | | | This is better structurally and it also fixes a linker error in the configure build. llvm-svn: 245052
* [clang-tidy] Don't use delegating constructors.Alexander Kornienko2015-08-141-2/+3
| | | | llvm-svn: 245046
* [clang-tidy] Fix IncludeInserter/IncludeSorter bug.Alexander Kornienko2015-08-141-0/+73
| | | | | | | | | | | If there weren't any includes in the file, or all of them had 'IncludeKind' greater than the desired one, then 'CreateIncludeInsertion' didn't work. http://reviews.llvm.org/D12017 Patch by Angel Garcia! llvm-svn: 245042
* Fix formatting.Manuel Klimek2015-08-131-1/+1
| | | | llvm-svn: 244876
* Reinstantiate better diagnostic, this time with a fatal error so we don't ↵Manuel Klimek2015-08-121-2/+7
| | | | | | add a dependency onto gtest from the header. llvm-svn: 244722
* Revert the diagnostic improvements in r244602 as they introduced a ↵David Blaikie2015-08-111-9/+1
| | | | | | | | | | problematic dependency Seems we had some internal uses that include ClangTidyTest.h and weren't ready for a gtest dependency. Reverting to give Manuel some time to look into it. llvm-svn: 244658
* 1. Disable tests that currently cannot work on windows due to missing path ↵Manuel Klimek2015-08-112-34/+54
| | | | | | | | canonicalization in the file manager. 2. Add better output when a clang-tidy unit test fails so it's clear what the error is. llvm-svn: 244602
* Also ClangTidyTests requires clangLex.NAKAMURA Takumi2015-08-111-0/+1
| | | | llvm-svn: 244599
* Do not use inheriting constructors.Manuel Klimek2015-08-111-3/+6
| | | | llvm-svn: 244597
* Default initialize from explicitly constructed object.Manuel Klimek2015-08-111-2/+3
| | | | llvm-svn: 244596
* Add an IncludeInserter to clang-tidy.Manuel Klimek2015-08-113-1/+416
| | | | | | Will be used to allow checks to insert includes at the right position. llvm-svn: 244586
* Correcting and adding tests for r244206.Aaron Ballman2015-08-061-1/+3
| | | | llvm-svn: 244208
* [clang-tidy] Set current main file name in tests.Alexander Kornienko2015-07-271-0/+1
| | | | llvm-svn: 243272
* Add missing dependency clangFrontend to unit test.Adrian Prantl2015-06-201-0/+1
| | | | llvm-svn: 240226
* [clang-tidy] Force braces around leaf 'else if' for consistency.Samuel Benzaquen2015-06-041-0/+13
| | | | | | | | | | | | | | Summary: Force braces around leaf 'else if' for consistency. This complements r233697. Reviewers: alexfh Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D10245 llvm-svn: 239054
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-113-16/+16
| | | | | | | | | | | | | | | | | | | | | | Summary: The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix svn diff | clang-format-diff -i Reviewers: dblaikie Reviewed By: dblaikie Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8927 llvm-svn: 234681
* Force braces on the else branch if they are being added to the if branch.Samuel Benzaquen2015-03-312-5/+27
| | | | | | | | | | | | | | Summary: Force braces on the else branch if they are being added to the if branch. This ensures consistency in the transformed code. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8708 llvm-svn: 233697
* Fix false positive on anonymous namespaces in headers.Samuel Benzaquen2015-03-241-0/+4
| | | | | | | | | | | | | | | | Summary: Anynoumous namespaces inject a using directive into the AST to import the names into the containing namespace. We should not have them in headers, but there is another warning for that. Reviewers: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8443 llvm-svn: 233087
* Add clangBasic to libdeps according to r232051 since the interface of ↵NAKAMURA Takumi2015-03-131-0/+1
| | | | | | ASTMatchers was changed. llvm-svn: 232138
* [clang-tidy] Fixed header guards using clang-tidy llvm-header-guard check. NFC.Alexander Kornienko2015-03-091-3/+3
| | | | | | | | | | The patch was generated using this command: $ clang-tidy/tool/run-clang-tidy.py -header-filter=.*clang-tidy.* -fix \ -checks=-*,llvm-header-guard clang-tidy.* $ svn revert --recursive clangt-tidy/llvm/ (to revert a few buggy fixes) llvm-svn: 231669
* [clang-tidy] Slighly clarified a comment.Alexander Kornienko2015-03-051-1/+2
| | | | llvm-svn: 231370
* [clang-tidy] Replace unrecognized namespace ending comments.Alexander Kornienko2015-03-051-5/+5
| | | | | | | | | | | | | | | | | | | | | | Summary: Replace unrecognized namespace ending comments. This will help in particular when a namespace ending comment is mistyped or doesn't fit the regexp for other reason, e.g.: namespace a { namespace b { namespace { } // anoynmous namespace } // b } // namesapce a Reviewers: djasper Reviewed By: djasper Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D8078 llvm-svn: 231369
* [clang-tidy] Refactor: Move google clang-tidy checks to namespace ↵Alexander Kornienko2015-03-051-0/+2
| | | | | | | | | | clang::tidy::google http://reviews.llvm.org/D7994 Patch by Richard Thomson! llvm-svn: 231364
* clang-tidy: Update test as underlying problem apparently was fixed.Daniel Jasper2015-03-021-2/+1
| | | | llvm-svn: 230982
* [clang-tidy] Refactor: Move llvm clang-tidy checks to namespace ↵Alexander Kornienko2015-03-021-0/+2
| | | | | | | | | | | | | clang::tidy::llvm clang-tidy checks are organized into modules. This refactoring moves the llvm module checks to clang::tidy::llvm http://reviews.llvm.org/D7995 Patch by Richard Thomson! llvm-svn: 230952
* [clang-tidy] Refactor: Move misc clang-tidy checks to namespace ↵Alexander Kornienko2015-03-021-0/+2
| | | | | | | | | | | | | clang::tidy::misc clang-tidy checks are organized into modules. This refactoring moves the misc module checks into the namespace clang::tidy::misc http://reviews.llvm.org/D7996 Patch by Richard Thomson! llvm-svn: 230950
* [clang-tidy] Organized clang-tidy unit tests. NFC.Alexander Kornienko2015-03-024-338/+333
| | | | | | | | | * Moved unit tests for BracesAroundStatementsCheck to ReadabilityModuleTest.cpp. * Moved EXPECT_NO_CHANGES macro to ClangTidyTest.h to avoid defining it three times. llvm-svn: 230947
* Revert "Adapt clang-tools-extra to clang module format changes."Adrian Prantl2015-02-255-15/+10
| | | | | | This reverts commit 230424. llvm-svn: 230456
* Adapt clang-tools-extra to clang module format changes.Adrian Prantl2015-02-255-10/+15
| | | | | | | - add clangCodeGen.a to the tools that need it - tweak pp-trace command line handling to not conflict with clang's. llvm-svn: 230424
OpenPOWER on IntegriCloud