summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/google
Commit message (Collapse)AuthorAgeFilesLines
...
* [clang-tidy] Clarify a comment.Alexander Kornienko2014-10-011-1/+2
| | | | | | No functional changes. llvm-svn: 218772
* [clang-tidy] Handle c-style casts from/to enums.Alexander Kornienko2014-10-011-2/+13
| | | | | | | | | | | | | | Summary: Convert c-style casts between integral end enum types to static_cast<>. Reviewers: klimek Reviewed By: klimek Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D5558 llvm-svn: 218760
* Clang-tidy google-readability-function check: don't warn on gmockAlexander Kornienko2014-09-251-0/+5
| | | | | | | | | | | | | | testing::Unused parameters. Reviewers: bkramer, klimek Reviewed By: klimek Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D5479 llvm-svn: 218443
* Provide user name in ClangTidyOptions.Alexander Kornienko2014-09-242-12/+6
| | | | | | | | | | | | | | | | | | | Summary: This adds the ClangTidyOptions::User field and fills it from the USER or the USERNAME environment variable, if possible. The FileOptionsProvider now takes "default" options instead of "fallback" options, as it now uses these when an option is not set in the configuration file (one exception is the checks list). Reviewers: bkramer, klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5440 llvm-svn: 218402
* Try to pacify dash-using linux distros with a very old-school shell variable ↵Benjamin Kramer2014-09-221-0/+1
| | | | | | | | compare. While there fix the cmake shared build. llvm-svn: 218274
* Add NamespaceCommentCheck to the Google module.Alexander Kornienko2014-09-221-0/+3
| | | | | | | | | | | | | | | | | Summary: This uses a bit hacky way to set the defaults for the spaces before comments, but it's also one of the simplest ways. Fixed a bug with how the SpacesBeforeComments option was used. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5410 llvm-svn: 218240
* Disable most of the google-readability-casting check for non-C++ files (onlyAlexander Kornienko2014-09-211-0/+4
| | | | | | leave the "redundant cast to the same type" part). llvm-svn: 218225
* [clang-tidy] Don't leak the TodoCommentHandler objectHans Wennborg2014-09-182-6/+14
| | | | | | | | | | | Preprocessor:addCommentHandler() does not take ownership, so we'd end up leaking the TodoCommentHandler. This patch makes it owned by the Check object. Differential Revision: http://reviews.llvm.org/D5402 llvm-svn: 218068
* [clang-tidy] Add a checker that warns on TODO comments without username.Benjamin Kramer2014-09-184-0/+102
| | | | | | | | | It also suggests a fix-it, taking the name from $USER. This will be made configurable eventually. Differential Revision: http://reviews.llvm.org/D5393 llvm-svn: 218049
* Implemented clang-tidy-check-specific options.Alexander Kornienko2014-09-1210-3/+21
| | | | | | | | | | | | | | | | | 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
* Unique-ptrify ClangTidyCheckFactories. Add a more convenient alternative toAlexander Kornienko2014-09-101-30/+20
| | | | | | | | | | | | | | addCheckFactory: registerCheck. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5288 llvm-svn: 217489
* [clang-tidy] Eliminate inline copies of InTemplateInstantiation matcher.Benjamin Kramer2014-09-033-14/+3
| | | | llvm-svn: 217036
* [clang-tidy] Use new ASTMatchers to identify template instantiations instead ↵Benjamin Kramer2014-09-032-9/+2
| | | | | | | | of copying it everywhere. No intended functionality change. llvm-svn: 217035
* Remove unused AST matcher.Benjamin Kramer2014-09-021-5/+0
| | | | llvm-svn: 216901
* [clang-tidy] Don't suggest naming the dummy argument of a post-inc operator ↵Benjamin Kramer2014-09-011-0/+6
| | | | | | overload. llvm-svn: 216868
* Try to fix test on msvc and 32 bit hosts.Benjamin Kramer2014-08-291-1/+1
| | | | llvm-svn: 216727
* [clang-tidy] Add a checker that suggests replacing short/long/long long with ↵Benjamin Kramer2014-08-294-0/+148
| | | | | | | | 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-291-1/+2
| | | | | | functions. llvm-svn: 216718
* AvoidCStyleCastsCheck: don't warn on casts in macrosAlexander Kornienko2014-08-161-4/+6
| | | | llvm-svn: 215799
* [clang-tidy] Simplify ast matcher.Benjamin Kramer2014-08-051-11/+2
| | | | | | Turns out there is a better way to do this. No functionality change. llvm-svn: 214874
* [clang-tidy] Fix unnamed parameter comment insertion with multiple parameters.Benjamin Kramer2014-08-041-3/+3
| | | | llvm-svn: 214703
* [clang-tidy] Make the named parameter check only warn on declarations if a ↵Benjamin Kramer2014-08-041-11/+28
| | | | | | | | | | | | | | | | definition is visible. Summary: This allows us to copy the parameter name from the definition (as a comment) or insert /*unused*/ in both places. Reviewers: alexfh, klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4772 llvm-svn: 214701
* [clang-tidy] Fix a false positive in the make_pair checker if an argument ↵Benjamin Kramer2014-07-211-2/+13
| | | | | | | | | has a explicit template argument. This required a rather ugly workaround for a problem in ASTMatchers where callee() is only overloaded for Stmt and Decl but not for Expr. llvm-svn: 213509
* [clang-tidy] MemsetZeroLenghtChecker: Don't crash trying to evaluate ↵Benjamin Kramer2014-07-171-2/+4
| | | | | | dependent values. llvm-svn: 213238
* [clang-tidy] Provide links to the google style guide for checks derived from it.Benjamin Kramer2014-07-174-0/+4
| | | | llvm-svn: 213233
* [clang-tidy] As a simple heuristic don't emit a swap fixit that would createBenjamin Kramer2014-07-161-1/+2
| | | | | | | | | negative-sized memsets. memset(x, -1, 0) is still useless but swapping makes no sense here. Just emit a warning. llvm-svn: 213157
* [clang-tidy] Also emit a warning for memset(x, 0, 0)Benjamin Kramer2014-07-161-4/+8
| | | | | | | It doesn't make sense to suggest swapping the arguments here but it's still useless code llvm-svn: 213156
* [clang-tidy] Add a checker for zero-length memset.Benjamin Kramer2014-07-164-0/+125
| | | | | | | | | | | | If there's memset(x, y, 0) in the code it's most likely a mistake. The checker suggests a fix-it to swap 'y' and '0'. I think this has the potential to be promoted into a general clang warning after some testing in clang-tidy. Differential Revision: http://reviews.llvm.org/D4535 llvm-svn: 213155
* [clang-tidy] Add namespaces checkers.Benjamin Kramer2014-07-166-0/+166
| | | | | | | | | | This change contains of two checkers that warn about 1. anonymous namespaces in header files. 2. 'using namespace' directives everywhere. Differential Revision: http://reviews.llvm.org/D4523 llvm-svn: 213153
* Avoid adding redundant parens.Alexander Kornienko2014-07-161-9/+13
| | | | | | | | | | | | Reviewers: bkramer Reviewed By: bkramer Subscribers: cfe-commits, sbenza Differential Revision: http://reviews.llvm.org/D4534 llvm-svn: 213149
* [clang-tidy] Add a checker that warns on const string & members.Benjamin Kramer2014-07-164-0/+103
| | | | | | | | | | | | | | Summary: Those are considered unsafe and should be replaced with simple pointers or full copies. It recognizes both std::string and ::string. Reviewers: alexfh, djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4522 llvm-svn: 213133
* [clang-tidy] Add a checker that flags unnamed parameters.Benjamin Kramer2014-07-154-0/+135
| | | | | | | | | | | | | | | | Summary: We still allow the escape hatch foo(int /*x*/) and also suggest this in a fixit. This is more powerful than the corresponding cpplint.py check it also flags functions with multiple arguments as naming all arguments is recommended by the google style guide. Reviewers: alexfh, djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4518 llvm-svn: 213075
* [clang-tidy] Add a checker that flags all instances of overloaded unary ↵Benjamin Kramer2014-07-154-0/+82
| | | | | | | | | | operator& This handles both methods and freestanding overloads. Differential Revision: http://reviews.llvm.org/D4498 llvm-svn: 213067
* [clang-tidy] Add a checker that removes deducible arguments from std::make_pairBenjamin Kramer2014-07-154-0/+111
| | | | | | | | | | | Those may be incompatible with C++11 and are unnecessary. We suggest removing the template arguments when they match the types of the make_pair arguments or replace it with std::pair and explicit template arguments when not. Differential Revision: http://reviews.llvm.org/D4497 llvm-svn: 213058
* Suggest automated replacements of C-style casts with C++ casts.Alexander Kornienko2014-07-141-10/+92
| | | | | | | | | | | | | | | | | | Summary: This patch implements a subset of possible replacements of C-style casts with const_cast/static_cast/reinterpret_cast. This should cover a large portion of cases in real code. Handling of a few more cases may be implemented eventually. Reviewers: sbenza, djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4478 llvm-svn: 212924
* [CMake] Update libdeps.NAKAMURA Takumi2014-07-141-0/+1
| | | | llvm-svn: 212920
* Added a comment to document relation of this check to -Wold-style-cast.Alexander Kornienko2014-06-301-0/+4
| | | | llvm-svn: 212033
* Another attempt to add a clang-tidy check for flagging C-style casts.Alexander Kornienko2014-06-294-0/+90
| | | | | | | | | | | | | | | | | | | Summary: The first version failed the SubstNonTypeTempateParmExpr-related test on some buildbots. This one uses the new substNonTypeTempateParmExpr matcher to filter out implicit C-style casts. This patch depends on D4327. Reviewers: djasper Reviewed By: djasper Subscribers: aemerson, cfe-commits Differential Revision: http://reviews.llvm.org/D4328 llvm-svn: 212002
* Rolling back, as the test fails on one of the buildbots:Alexander Kornienko2014-06-254-90/+0
| | | | | | http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/13505/steps/check-all/logs/Clang%20Tools%3A%3Ac-style-casts.cpp llvm-svn: 211708
* Add a check to flag the usage of C-style casts (Google Style).Alexander Kornienko2014-06-254-0/+90
| | | | | | | | | | | | | | | | | Summary: Add a check to flag the usage of C-style casts, as per Google Style Guide: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Casting#Casting Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4189 llvm-svn: 211702
* Move google-explicit-constructor check to a separate source file.Alexander Kornienko2014-06-184-76/+91
| | | | | | | | | | | | | | Summary: No functional changes. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4188 llvm-svn: 211154
* Track clang changes from r209061Alp Toker2014-05-171-2/+1
| | | | llvm-svn: 209062
* Fix assertion in google-explicit-constructor check when the constructor isAlexander Kornienko2014-05-051-3/+5
| | | | | | | | | | | | | | | | | | defined in a macro. Summary: We shouldn't suggest replacements in macros anyway, as we can't see all usages of the macro and ensure the replacement is safe for all of them. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3611 llvm-svn: 207987
* Fix the message for "Move constructor declared explicit".Alexander Kornienko2014-04-291-1/+2
| | | | | | Make the tests for removal of 'explicit' more diverse. llvm-svn: 207534
* Warn on explicit copy constructors.Alexander Kornienko2014-04-291-3/+46
| | | | | | | | | | | | | | | | | Summary: The Google C++ Style Guide doesn't require copy constructors to be declared explicit, but some people do this by mistake. Make this check detect and fix such cases. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3541 llvm-svn: 207531
* clang-tidy explicit constructor check: don't warn on copy or move constructors.Alexander Kornienko2014-03-201-1/+1
| | | | | | | | | | | | | | | | | Summary: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Explicit_Constructors "The exception is copy constructors, which, in the rare cases when we allow them, should probably not be explicit." Reviewers: klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3122 llvm-svn: 204322
* clang-tidy explicit constructors check: don't warn on deleted constructors.Alexander Kornienko2014-03-191-1/+2
| | | | | | | | | | | | Reviewers: klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3116 llvm-svn: 204226
* Fixed formatting.Alexander Kornienko2014-03-052-4/+2
| | | | llvm-svn: 202969
* [C++11] Replace LLVM_OVERRIDE with 'override'Craig Topper2014-03-022-3/+3
| | | | llvm-svn: 202632
* Normalized "virtual" and "LLVM_OVERRIDE" usage in clang-tidy.Alexander Kornienko2014-02-272-3/+5
| | | | | | | | | | | | Reviewers: klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2894 llvm-svn: 202392
OpenPOWER on IntegriCloud