summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/docs
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix docsAlexander Kornienko2016-05-201-3/+3
| | | | llvm-svn: 270288
* [clang-tidy] Add more descriptive comments and examples in ↵Haojian Wu2016-05-201-8/+41
| | | | | | | | | | | | misc-definitions-in-headers check. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20463 llvm-svn: 270197
* [clang-tidy] Fix/add style guide links.Alexander Kornienko2016-05-193-1/+14
| | | | | | Thanks to Tim Halloran for the initial patch (http://reviews.llvm.org/D15089)! llvm-svn: 270033
* [clang-tidy] Fix doc titles.Alexander Kornienko2016-05-195-1/+12
| | | | llvm-svn: 270032
* [clang-include-fixer] Added Vim integration for clang-include-fixer.Eric Liu2016-05-181-0/+14
| | | | | | | | | | | | Summary: [clang-include-fixer] Added Vim integration for clang-include-fixer. Reviewers: hokein, bkramer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20329 llvm-svn: 269927
* [Release notes] Mention Clang-tidy modernize-avoid-bind check.Eugene Zelenko2016-05-132-2/+7
| | | | | | Fix some problems in its documentation. llvm-svn: 269517
* [include-fixer] Rename XrefsDB to SymbolIndex.Benjamin Kramer2016-05-131-2/+2
| | | | | | It's not really containing xrefs so the name didn't fit. No functional change. llvm-svn: 269403
* [clang-tidy] Adds modernize-avoid-bind checkJonathan Coe2016-05-122-0/+39
| | | | | | | | | | | | | | | Summary: This patch adds a check that replaces std::bind with a lambda. Not yet working for member functions. Reviewers: aaron.ballman, alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D16962 llvm-svn: 269341
* [clang-tidy] Improve misc-redundant-expression and decrease false-positiveEtienne Bergeron2016-05-121-0/+1
| | | | | | | | | | | | | | | | | | Summary: This patch is adding support for conditional expression and overloaded operators. To decrease false-positive, this patch is adding a list of banned macro names that has multiple variant with same integer value. Also fixed support for template instantiation and added an unittest. Reviewers: alexfh Subscribers: klimek, Sarcasm, cfe-commits Differential Revision: http://reviews.llvm.org/D19703 llvm-svn: 269275
* [Clang-tidy] modernize-use-bool-literals: documentation style.Eugene Zelenko2016-05-112-2/+2
| | | | | | Fix readability-redundant-control-flow warnings in regression test. llvm-svn: 269229
* [clang-tidy] Adds modernize-use-bool-literals check.Jakub Staron2016-05-113-0/+24
| | | | | | Review link: http://reviews.llvm.org/D18745 llvm-svn: 269171
* [include-fixer] Add basic documentation.Benjamin Kramer2016-05-112-0/+72
| | | | | | Differential Revision: http://reviews.llvm.org/D20094 llvm-svn: 269167
* [clang-tidy] new google-default-arguments checkHaojian Wu2016-05-093-0/+14
| | | | | | | | | | | | | | | | Summary: To check the google style guide rule here: https://google.github.io/styleguide/cppguide.html#Default_Arguments Patch by Clement Courbet! Reviewers: hokein Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19534 llvm-svn: 268919
* Trying to fix docs.Alexander Kornienko2016-05-091-1/+2
| | | | llvm-svn: 268905
* Fix docs.Alexander Kornienko2016-05-091-1/+1
| | | | llvm-svn: 268899
* [Documentation] List Clang-tidy checks alphabetically.Eugene Zelenko2016-05-051-1/+1
| | | | llvm-svn: 268659
* [clang-tidy] New: checker misc-unconventional-assign-operator replacing ↵Gabor Horvath2016-05-044-13/+20
| | | | | | | | | | | | | | misc-assign-operator-signature Summary: Finds return statements in assign operator bodies where the return value is different from '*this'. Only assignment operators with correct return value Class& are checked. Reviewers: aaron.ballman, alexfh, sbenza Subscribers: o.gyorgy, baloghadamsoftware, LegalizeAdulthood, aaron.ballman, Eugene.Zelenko, xazax.hun, cfe-commits Differential Revision: http://reviews.llvm.org/D18265 llvm-svn: 268492
* [clang-tidy] Add modernize-make-shared checkPiotr Padlewski2016-05-023-0/+22
| | | | | | | | | Because modernize-make-shared do almost the same job as modernize-make-unique, I refactored common code to MakeSmartPtrCheck. http://reviews.llvm.org/D19183 llvm-svn: 268253
* [Release Notes] Mention Clang-tidy cert-err34-c check.Eugene Zelenko2016-04-301-7/+14
| | | | | | Fix order and style of Boost related notes. llvm-svn: 268140
* Add a clang-tidy check that flags string-to-number conversion functions that ↵Aaron Ballman2016-04-292-0/+29
| | | | | | | | have insufficient error checking, suggesting a better alternative. This check corresponds to: https://www.securecoding.cert.org/confluence/display/c/ERR34-C.+Detect+errors+when+converting+a+string+to+a+number llvm-svn: 268100
* Add boost-use-to-stringPiotr Padlewski2016-04-294-1/+34
| | | | | | http://reviews.llvm.org/D18136 llvm-svn: 268079
* [clang-tidy] cppcoreguidelines-pro-type-member-init should not complain ↵Alexander Kornienko2016-04-281-4/+4
| | | | | | | | | | | | | | | | about static variables Summary: Variables with static storage duration are zero-initialized per [stmt.dcl]p4 and [basic.start.init]p2. Reviewers: sbenza, aaron.ballman Subscribers: michael_miller, flx, cfe-commits Differential Revision: http://reviews.llvm.org/D19672 llvm-svn: 267933
* [clang-tidy] Now adding correct misc-move-const-arg documentation ;]Alexander Kornienko2016-04-261-7/+7
| | | | | | + brushed the code a bit and renamed the test file to match the check name llvm-svn: 267592
* [clang-tidy] Added misc-move-const-arg docs.Alexander Kornienko2016-04-262-1/+17
| | | | llvm-svn: 267587
* [Release notes] Mention Clang-tidy misc-fold-init-type check.Eugene Zelenko2016-04-262-4/+10
| | | | | | Highlighting consistency in Clang-tidy misc-fold-init-type check documentation. llvm-svn: 267576
* [clang-tidy] New checker for redundant expressions.Etienne Bergeron2016-04-263-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This checker finds redundant expression on both side of a binary operator. The current implementation provide a function to check whether expressions are equivalent. This implementation is able to recognize the common subset encounter in C++ program. Side-effects like "x++" are not considered to be equivalent. There are many False Positives related to macros and to floating point computations (detecting NaN). The checker is ignoring these cases. Example: ``` if( !dst || dst->depth != desired_depth || dst->nChannels != desired_num_channels || dst_size.width != src_size.width || dst_size.height != dst_size.height ) <<--- bug { ``` Reviewers: alexfh Subscribers: danielmarjamaki, fahlgren, jordan_rose, zaks.anna, Eugene.Zelenko, cfe-commits Differential Revision: http://reviews.llvm.org/D19451 llvm-svn: 267574
* A clang-tidy check for std:accumulate.Alexander Kornienko2016-04-262-0/+28
| | | | | | | | | | | | | | | | | Summary: For folds (e.g. std::accumulate), check matches between the provided init value and the range's value_type. A typical error is "std::accumulate(begin, end, 0);", where begin and end have float value_type. See the documentation for more examples. For now we check std::accumulate, std::reduce and std::inner_product. Reviewers: hokein, alexfh Subscribers: Prazek, aaron.ballman, cfe-commits, courbet Patch by Clément Courbet! Differential Revision: http://reviews.llvm.org/D18442 llvm-svn: 267542
* [clang-tidy] fix link in Release NotesHaojian Wu2016-04-221-1/+1
| | | | | | | | | | | | | | Summary: This is intended to fix https://llvm.org/bugs/show_bug.cgi?id=27426 Patch by Kirill Bobyrev! Reviewers: alexfh, LegalizeAdulthood, hokein Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19406 llvm-svn: 267155
* [Release Notes] Mention Clang-tidy misc-string-constructor and ↵Eugene Zelenko2016-04-212-1/+10
| | | | | | | | misc-suspicious-string-compare checks. Fix excessive line in misc-string-constructor documentation. llvm-svn: 267026
* [clang-tidy] New checker to detect suspicious string constructor.Etienne Bergeron2016-04-212-0/+37
| | | | | | | | | | | | | | | | | | | Summary: Checker to validate string constructor parameters. A common mistake is to swap parameter for the fill-constructor. ``` std::string str('x', 4); std::string str('4', x); ``` Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19146 llvm-svn: 267011
* [clang-tidy] Add new checker for comparison with runtime string functions.Etienne Bergeron2016-04-212-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This checker is validating suspicious usage of string compare functions. Example: ``` if (strcmp(...)) // Implicitly compare to zero if (!strcmp(...)) // Won't warn if (strcmp(...) != 0) // Won't warn ``` This patch was checked over large amount of code. There is three checks: [*] Implicit comparator to zero (coding-style, many warnings found), [*] Suspicious implicit cast to non-integral (bugs!?, almost none found), [*] Comparison to suspicious constant (bugs!?, found two cases), Example: [[https://github.com/kylepjohnson/sigma/blob/master/sigma/native-installers/debian/dependencies/files/opt/sigma/E/HEURISTICS/che_to_precgen.c | https://github.com/kylepjohnson/sigma/blob/master/sigma/native-installers/debian/dependencies/files/opt/sigma/E/HEURISTICS/che_to_precgen.c]] ``` else if(strcmp(id, "select") == 0) { array->array[i].key1 = 25; } else if(strcmp(id, "sk") == 28) // BUG!? { array->array[i].key1 = 20; } ``` Reviewers: alexfh Subscribers: Eugene.Zelenko, cfe-commits Differential Revision: http://reviews.llvm.org/D18703 llvm-svn: 267009
* [Release Notes] Mention Clang-tidy misc-unused-using-decls check.Eugene Zelenko2016-04-191-0/+5
| | | | llvm-svn: 266770
* Initial version of misc-unused-using-decl check.Daniel Jasper2016-04-192-0/+15
| | | | llvm-svn: 266735
* [Release Notes] mention Clang-tidy misc-multiple-statement-macro check.Eugene Zelenko2016-04-151-1/+6
| | | | llvm-svn: 266455
* [clang-tidy] Add new checker for suspicious sizeof expressionsEtienne Bergeron2016-04-153-1/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This check is finding suspicious cases of sizeof expression. Sizeof expression is returning the size (in bytes) of a type or an expression. Programmers often abuse or misuse this expression. This checker is adding common set of patterns to detect some of these bad constructs. Some examples found by this checker: R/packages/ifultools/ifultools/src/fra_neig.c ``` /* free buffer memory */ (void) mutil_free( dist_buff, sizeof( ctr * sizeof( double ) ) ); (void) mutil_free( nidx_buff, sizeof( ctr * sizeof( sint32 ) ) ); ``` graphviz/v2_20_2/lib/common/utils.c ``` static Dtdisc_t mapDisc = { offsetof(item, p), sizeof(2 * sizeof(void *)), offsetof(item, link), (Dtmake_f) newItem, (Dtfree_f) freeItem, (Dtcompar_f) cmpItem, NIL(Dthash_f), NIL(Dtmemory_f), NIL(Dtevent_f) }; ``` mDNSResponder/mDNSShared/dnsextd.c ``` context = ( TCPContext* ) malloc( sizeof( TCPContext ) ); require_action( context, exit, err = mStatus_NoMemoryErr; LogErr( "AcceptTCPConnection", "malloc" ) ); mDNSPlatformMemZero( context, sizeof( sizeof( TCPContext ) ) ); context->d = self; ``` Reviewers: alexfh Subscribers: malcolm.parsons, Eugene.Zelenko, cfe-commits Differential Revision: http://reviews.llvm.org/D19014 llvm-svn: 266451
* [clang-tidy] Add checker for operations between integrals and pointersEtienne Bergeron2016-04-153-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This check is finding suspicious operations involving pointers and integral types; which are most likely bugs. Examples: subversion/v1_6/subversion/libsvn_subr/utf.c ``` static const char * fuzzy_escape(const char *src, apr_size_t len, apr_pool_t *pool) { [...] while (src_orig < src_end) { if (! svn_ctype_isascii(*src_orig) || src_orig == '\0') // Should be *src_orig { ``` apache2/v2_2_23/modules/metadata/mod_headers.c ``` static char *parse_format_tag(apr_pool_t *p, format_tag *tag, const char **sa) { [...] tag->arg = '\0'; // ERROR: tag->arg has type char* /* grab the argument if there is one */ if (*s == '{') { ++s; tag->arg = ap_getword(p,&s,'}'); } ``` Reviewers: alexfh Subscribers: Eugene.Zelenko, cfe-commits Differential Revision: http://reviews.llvm.org/D19118 llvm-svn: 266450
* [clang-tidy] Add check misc-multiple-statement-macroSamuel Benzaquen2016-04-142-0/+17
| | | | | | | | | | | | | | | Summary: The check detects multi-statement macros that are used in unbraced conditionals. Only the first statement will be part of the conditionals and the rest will fall outside of it and executed unconditionally. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18766 llvm-svn: 266369
* [clang-tidy] Fix documentation generation.Etienne Bergeron2016-04-142-0/+2
| | | | | | | | | | | | Summary: The patch is fixing the generation of clang-tidy documentation. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19121 llvm-svn: 266333
* Complete support for C++ Core Guidelines Type.6: Always initialize a member ↵Alexander Kornienko2016-04-132-9/+44
| | | | | | | | | | | | | | | | variable. Summary: Added the remaining features needed to satisfy C++ Core Guideline Type.6: Always initialize a member variable to cppcoreguidelines-pro-type-member-init. The check now flags all default-constructed uses of record types without user-provided default constructors that would leave their memory in an undefined state. The check suggests value initializing them instead. Reviewers: flx, alexfh, aaron.ballman Subscribers: klimek, aaron.ballman, LegalizeAdulthood, cfe-commits Patch by Michael Miller! Differential Revision: http://reviews.llvm.org/D18584 llvm-svn: 266191
* [clang-tidy] Add a readability-deleted-default clang-tidy check.Alexander Kornienko2016-04-133-0/+28
| | | | | | | | | | | Checks if constructors and assignment operators that are marked '= default' are actually deleted by the compiler. Patch by Alex Pilkiewicz! Differential Revision: http://reviews.llvm.org/D18961 llvm-svn: 266190
* [Release Notes] Sort checks alphabetically.Eugene Zelenko2016-04-081-7/+6
| | | | llvm-svn: 265813
* [clang-tidy] cppcoreguidelines-interfaces-global-initAlexander Kornienko2016-04-083-0/+22
| | | | | | | | | | | | | | | | Summary: This check flags initializers of globals that access extern objects, and therefore can lead to order-of-initialization problems (this recommandation is part of CPP core guidelines). Note that this only checks half of the guideline for now (it does not enforce using constexpr functions). Reviewers: aaron.ballman, alexfh Subscribers: aaron.ballman, etienneb, Eugene.Zelenko, cfe-commits Patch by Clement Courbet! Differential Revision: http://reviews.llvm.org/D18649 llvm-svn: 265774
* Mention readability-static-definition-in-anonymous-namespace in release notes.Eugene Zelenko2016-04-071-1/+6
| | | | | | | | Consistency in using ` and ``. Differential revision: http://reviews.llvm.org/D18797 llvm-svn: 265698
* [clang-tidy] add new checker for string literal with NUL character.Etienne Bergeron2016-04-073-0/+45
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds the support for detecting suspicious string literals and their //incorrect// usage. The following example shows a incorrect character escaping leading to an embedded NUL character. ``` std::string str = "\0x42"; // Should be "\x42". ``` The patch also add detection of truncated literal when a literal is passed to a string constructor. Reviewers: hokein, alexfh Subscribers: LegalizeAdulthood, bcraig, Eugene.Zelenko, bkramer, cfe-commits Differential Revision: http://reviews.llvm.org/D18783 llvm-svn: 265691
* [docs] Update version (http://llvm.org/PR27253)Alexander Kornienko2016-04-071-2/+2
| | | | llvm-svn: 265655
* [clang-tidy] fix building clang-tidy documentation.Etienne Bergeron2016-04-062-2/+3
| | | | | | | | | | | | | | | | | | Summary: The clang-tidy documentation can't be generated because of broken links. ``` Warning, treated as error: /home/etienneb/llvm/llvm/tools/clang/tools/extra/docs/clang-tidy/checks/google-readability-function-size.rst:: WARNING: document isn't included in any toctree ``` Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18803 llvm-svn: 265539
* [clang-tidy] Extension of checker misc-misplaced-widening-castGabor Horvath2016-04-061-4/+15
| | | | | | | | | | | | | | | | | | Summary: Existing checker misc-misplaced-widening-cast was extended: - New use cases: casted expression as lhs or rhs of a logical comparison or function argument - New types: beside int, long and long long various char types, short and int128 added - New option to check implicit casts: forgetting a cast is at least as common and as dangerous as misplacing it. This option can be disabled. This patch depends on AST Matcher patches D17986 and D18243 and also contains fix for checker misc-bool-pointer-implicit-conversion needed because of the fix in the AST Matcher patch. Reviewers: hokein, alexfh Subscribers: o.gyorgy, xazax.hun, cfe-commits Differential Revision: http://reviews.llvm.org/D17987 llvm-svn: 265532
* [clang-tidy] Add a check to detect static definitions in anonymous namespace.Haojian Wu2016-04-052-0/+18
| | | | | | | | | | | | Summary: Fixes PR26595 Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18180 llvm-svn: 265384
* [clang-tidy] Fix documentation of misc-suspicious-missing-commaEtienne Bergeron2016-04-051-3/+12
| | | | | | | | | | | | | | | Summary: The clang-tidy documentation generation was broken since commit : http://reviews.llvm.org/D18457 I ran locally the documentation generation and I fixed errors related to that specific check. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18764 llvm-svn: 265375
* [clang-tidy] fix a couple of modernize-use-override bugsAlexander Kornienko2016-04-041-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix for __declspec attributes and const=0 without space This patch is to address 2 problems I found with Clang-tidy:modernize-use-override. 1: missing spaces on pure function decls. Orig: void pure() const=0 Problem: void pure() constoverride =0 Fixed: void pure() const override =0 2: This is ms-extension specific, but possibly applies to other attribute types. The override is placed before the attribute which doesn’t work well with declspec as this attribute can be inherited or placed before the method identifier. Orig: class __declspec(dllexport) X : public Y { void p(); }; Problem: class override __declspec(dllexport) class X : public Y { void p(); }; Fixed: class __declspec(dllexport) class X : public Y { void p() override; }; Patch by Robert Bolter! Differential Revision: http://reviews.llvm.org/D18396 llvm-svn: 265298
OpenPOWER on IntegriCloud