aboutsummaryrefslogtreecommitdiff
path: root/clang-tidy/readability
AgeCommit message (Collapse)Author
2019-01-14[clang-tidy] update FunctionSizeCheck for D56444Sam McCall
Reviewers: JonasToth, aaron.ballman Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D56552 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@351048 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-11[clang-tidy] new check 'readability-redundant-preprocessor'Miklos Vajna
Finds potentially redundant preprocessor directives. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D54349 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@350922 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-24[clang-tidy] add IgnoreMacros option to readability-uppercase-literal-suffixMiklos Vajna
And also enable it by default to be consistent with e.g. modernize-use-using. This helps e.g. when running this check on client code where the macro is provided by the system, so there is no easy way to modify it. Reviewed By: JonasToth, lebedev.ri Differential Revision: https://reviews.llvm.org/D56025 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@350056 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-21Fix warning about unused variable [NFC]Bjorn Pettersson
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@349891 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-20[clang-tidy] Use translationUnitDecl() instead of a custom matcher.Alexander Kornienko
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@349758 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-07[clang-tidy] Remove duplicated getText implementation, NFCHaojian Wu
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@348583 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-27[clang-tidy] Ignore bool -> single bit bitfield conversion in ↵Malcolm Parsons
readability-implicit-bool-conversion Summary: There is no ambiguity / information loss in this conversion Reviewers: alexfh, aaron.ballman, hokein Reviewed By: alexfh Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D54941 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@347671 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-27[clang-tidy] Avoid inconsistent notes in readability-container-size-emptyAlexander Kornienko
When a warning is issued in a template instantiation, the check would previously use template arguments in a note, which would result in inconsistent or duplicate warnings (depending on how deduplication was done). This patch removes template arguments from the note. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@347652 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-25A bit of AST matcher cleanup, NFC.Alexander Kornienko
Removed the uses of the allOf() matcher inside node matchers that are implicit allOf(). Replaced uses of allOf() with the explicit node matcher where it makes matchers more readable. Replace anyOf(hasName(), hasName(), ...) with the more efficient and readable hasAnyName(). git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@347520 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-15[clang-tidy] Update checks to play nicely with limited traversal scope added ↵Sam McCall
in r346847 Summary: (See D54204 for original review) Reviewers: hokein Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D54579 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@346961 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-31Implement the readability-const-return-type check.Aaron Ballman
This check flags function top-level const-qualified return types and suggests removing the mostly-superfluous const qualifier where possible. Patch by Yitzhak Mandelbaum. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@345764 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-31[clang-tidy] new check 'readability-isolate-declaration'Jonas Toth
Summary: This patch introduces a new clang-tidy check that matches on all `declStmt` that declare more then one variable and transform them into one statement per declaration if possible. It currently only focusses on variable declarations but should be extended to cover more kinds of declarations in the future. It is related to https://reviews.llvm.org/D27621 and does use it's extensive test-suite. Thank you to firolino for his work! Reviewers: rsmith, aaron.ballman, alexfh, hokein, kbobyrev Reviewed By: aaron.ballman Subscribers: ZaMaZaN4iK, mgehre, nemanjai, kbarton, lebedev.ri, Eugene.Zelenko, mgorny, xazax.hun, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D51949 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@345735 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-26[clang-tidy] Re-commit: Add new 'readability-uppercase-literal-suffix' check ↵Roman Lebedev
(CERT DCL16-C, MISRA C:2012, 7.3, MISRA C++:2008, 2-13-4) Summary: Detects when the integral literal or floating point (decimal or hexadecimal) literal has non-uppercase suffix, and suggests to make the suffix uppercase, with fix-it. All valid combinations of suffixes are supported. ``` auto x = 1; // OK, no suffix. auto x = 1u; // warning: integer literal suffix 'u' is not upper-case auto x = 1U; // OK, suffix is uppercase. ... ``` This is a re-commit, the original was reverted by me in rL345305 due to discovered bugs. (implicit code, template instantiation) Tests were added, and the bugs were fixed. I'm unable to find any further bugs, hopefully there aren't any.. References: * [[ https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87152241 | CERT DCL16-C ]] * MISRA C:2012, 7.3 - The lowercase character "l" shall not be used in a literal suffix * MISRA C++:2008, 2-13-4 - Literal suffixes shall be upper case Reviewers: JonasToth, aaron.ballman, alexfh, hokein, xazax.hun Reviewed By: aaron.ballman Subscribers: Eugene.Zelenko, mgorny, rnkovacs, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D52670 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@345381 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-25[clang-tidy] Revert my readability-uppercase-literal-suffix check.Roman Lebedev
There are some lurking issues with the handling of the SourceManager. Somehow sometimes we end up extracting completely wrong portions of the source buffer. Reverts r344772, r44760, r344758, r344755. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@345305 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-21[clang-tidy] add IgnoreMacros option to readability-redundant-smartptr-getMiklos Vajna
And also enable it by default to be consistent with e.g. modernize-use-using. This helps e.g. when running this check on client code where the macro is provided by the system, so there is no easy way to modify it. Reviewed By: JonasToth Differential Revision: https://reviews.llvm.org/D53454 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@344871 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-19[clang-tidy] Resolve readability-else-after-return false positive for ↵Marek Kurdej
constexpr if. Summary: It fixes the false positive when using constexpr if and where else cannot be removed: Example: ``` if constexpr (sizeof(int) > 4) // ... return /* ... */; else // This else cannot be removed. // ... return /* ... */; ``` Reviewers: alexfh, aaron.ballman Reviewed By: aaron.ballman Subscribers: lebedev.ri, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D53372 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@344785 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-18[clang-tidy] Add new 'readability-uppercase-literal-suffix' check (CERT ↵Roman Lebedev
DCL16-C, MISRA C:2012, 7.3, MISRA C++:2008, 2-13-4) Summary: Detects when the integral literal or floating point (decimal or hexadecimal) literal has non-uppercase suffix, and suggests to make the suffix uppercase, with fix-it. All valid combinations of suffixes are supported. ``` auto x = 1; // OK, no suffix. auto x = 1u; // warning: integer literal suffix 'u' is not upper-case auto x = 1U; // OK, suffix is uppercase. ... ``` References: * [[ https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87152241 | CERT DCL16-C ]] * MISRA C:2012, 7.3 - The lowercase character "l" shall not be used in a literal suffix * MISRA C++:2008, 2-13-4 - Literal suffixes shall be upper case Reviewers: JonasToth, aaron.ballman, alexfh, hokein, xazax.hun Reviewed By: aaron.ballman Subscribers: Eugene.Zelenko, mgorny, rnkovacs, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D52670 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@344755 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-04[clang-tidy] Added pointer types to clang-tidy readability-identifier-naming ↵Jonas Toth
check. Summary: Option to check for different naming conventions on the following types: - GlobalConstantPointer - GlobalPointer - LocalConstantPointer - LocalPointer - PointerParameter - ConstantPointerParameter When not specified, the conventions for the non pointer types will be applied (GlobalConstant, GlobalVariable, LocalConstant, ...). Patch by ffigueras! Reviewers: alexfh, kbobyrev Reviewed By: alexfh Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D52882 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@343788 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-02[clang-tidy] Ignore singe bit bitfield -> bool conversion in ↵Alexander Kornienko
readability-implicit-bool-conversion git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@343578 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-27llvm::sort(C.begin(), C.end()) -> llvm::sort(C)Fangrui Song
The convenience wrapper in STLExtras is available since rL342102. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@343166 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-20[Clang-tidy] Alphabetical sort of files/checks. Add space after clang-tidy ↵Eugene Zelenko
in source code headers. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@342601 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-18[clang-tidy] Replace redundant checks with an assert().Artem Belevich
findStyleKind is only called if D is an explicit identifier with a name, so the checks for operators will never return true. The explicit assert() enforces this invariant. Differential Revision: https://reviews.llvm.org/D52179 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@342514 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-12Add a new check to the readability module that flags uses of "magic numbers" ↵Aaron Ballman
(both floating-point and integral). Patch by Florin Iucha <florin@signbit.net> git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@339516 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-09Port getLocEnd -> getEndLocStephen Kelly
Subscribers: nemanjai, ioeric, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D50355 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@339401 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-09Port getLocStart -> getBeginLocStephen Kelly
Reviewers: javed.absar Subscribers: nemanjai, kbarton, ilya-biryukov, ioeric, jkorous, arphaman, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D50354 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@339400 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-13[clang-tidy] readability-inconsistent-declaration-parameter-name: accept ↵Sam McCall
approximate name matches. Summary: The goal is to reduce false positives when the difference is intentional, like: foo(StringRef name); foo(StringRef name_ref) { string name = cleanup(name_ref); ... } Or semantically unimportant, like: foo(StringRef full_name); foo(StringRef name) { ... } There are other matching names we won't recognise (e.g. syns vs synonyms) but this catches many that we see in practice, and gives people a systematic workaround. The old behavior is available as a 'Strict' option. Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D49285 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336992 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-22[clang-tidy] SimplifyBoolenExpr doesn't add parens if unary negotiation is ↵Zinovy Nis
of ExprWithCleanups type bool foo(A &S) { if (S != (A)S) return false; return true; } is fixed into (w/o this patch) ... return !S != (A)S; // negotiation affects first operand only } instead of (with this patch) ... return S == (A)S; // note == instead of != } Differential Revision: https://reviews.llvm.org/D47122 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@333003 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-16Add a new check, readability-simplify-subscript-expr, that diagnoses array ↵Aaron Ballman
subscript expressions that can be simplified. Currently, diagnoses code that calls container.data()[some_index] when the container exposes a suitable operator[]() method that can be used directly. Patch by Shuai Wang. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@332519 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-15[clang-tools-extra] Update uses of DEBUG macro to LLVM_DEBUG.Nicola Zaghen
The DEBUG() macro is very generic so it might clash with other projects. The renaming was done as follows: - git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g' - git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM Differential Revision: https://reviews.llvm.org/D44976 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@332371 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-23update test to use ivar in implementation instead of class extensionYan Zhang
Summary: using ivar in class extension is not supported in 32-bit architecture of MacOS. Reviewers: alexfh, hokein Reviewed By: alexfh Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D45912 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@330559 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-21Revert r330492: [clang-tidy] add new check to find out objc ivars which do ↵Chandler Carruth
not have prefix '_' This commit has been breaking most bots for a day now. There is a fix proposed in https://reviews.llvm.org/D45912 but when I applied that I just got different errors. Reverting to get our bots back to green. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@330528 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-20[clang-tidy] add new check to find out objc ivars which do not have prefix '_'Yan Zhang
Summary: For code of ivar declaration: int barWithoutPrefix; The fix will be: int _barWithoutPrefix; Reviewers: benhamilton, hokein, alexfh, aaron.ballman, ilya-biryukov Reviewed By: alexfh Subscribers: Eugene.Zelenko, xazax.hun, klimek, mgorny, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D45392 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@330492 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-12[clang-tidy] readability-function-size: add VariableThreshold param.Roman Lebedev
Summary: Pretty straight-forward, just count all the variable declarations in the function's body, and if more than the configured threshold - do complain. Note that this continues perverse practice of disabling the new option by default. I'm not certain where is the balance point between not being too noisy, and actually enforcing the good practice. If we really want to not disable this by default, but also to not cause too many new warnings, we could default to 50 or so. But that is a lot of variables too... I was able to find one coding style referencing variable count: - https://www.kernel.org/doc/html/v4.15/process/coding-style.html#functions > Another measure of the function is the number of local variables. They shouldn’t exceed 5-10, or you’re doing something wrong. Reviewers: hokein, xazax.hun, JonasToth, aaron.ballman, alexfh Reviewed By: aaron.ballman Subscribers: kimgr, Eugene.Zelenko, rnkovacs, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D44602 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@329902 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-07[clang-tidy] Add "portability" module and rename readability-simd-intrinsics ↵Fangrui Song
to portability-simd-intrinsics Reviewers: alexfh Subscribers: klimek, nemanjai, mgorny, xazax.hun, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D44173 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@326909 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-15[clang-tidy] Add `readability-simd-intrinsics` check.Fangrui Song
Summary: Many architectures provide SIMD operations (e.g. x86 SSE/AVX, Power AltiVec/VSX, ARM NEON). It is common that SIMD code implementing the same algorithm, is written in multiple target-dispatching pieces to optimize for different architectures or micro-architectures. The C++ standard proposal P0214 and its extensions cover many common SIMD operations. By migrating from target-dependent intrinsics to P0214 operations, the SIMD code can be simplified and pieces for different targets can be unified. Refer to http://wg21.link/p0214 for introduction and motivation for the data-parallel standard library. Subscribers: klimek, aemerson, mgorny, xazax.hun, kristof.beyls, hintonda, cfe-commits Differential Revision: https://reviews.llvm.org/D42983 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@325272 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-30clang-tidy/rename_check.py misc-string-compare readability-string-compareAlexander Kornienko
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@323766 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-15[clang-tidy] Expand readability-redundant-smartptr-get to understand ↵Samuel Benzaquen
implicit converions to bool in more contexts. Summary: Expand readability-redundant-smartptr-get to understand implicit converions to bool in more contexts. Reviewers: hokein Subscribers: klimek, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D41998 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@322497 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-11[clang-tidy] Fix google-readability-namespace-comments handling of C++17 ↵Alexander Kornienko
nested namespaces Summary: Fixes bug 34701 When we encounter a namespace find the location of the left bracket. Then if the text between the name and the left bracket contains a ':' then it's a C++17 nested namespace. Reviewers: #clang-tools-extra, alexfh, aaron.ballman Reviewed By: aaron.ballman Subscribers: curdeius, cfe-commits, krasimir, JonasToth, JDevlieghere, xazax.hun Tags: #clang-tools-extra Patch by Alexandru Octavian Buțiu! Differential Revision: https://reviews.llvm.org/D38284 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@322274 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05clang-tidy: add IgnoreMacros option to ↵Miklos Vajna
readability-inconsistent-declaration-parameter-name And also enable it by default to be consistent with e.g. modernize-use-using. This helps e.g. when running this check on client code where the macro is provided by the system, so there is no easy way to modify it. Reviewers: alexfh, piotrdz, hokein, ilya-biryukov Reviewed By: alexfh Differential Revision: https://reviews.llvm.org/D41716 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321913 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11[clang-tidy] Correctly classify constant arrays and constant strings as ↵Alexander Kornienko
constants when checking identifiers naming Summary: They are not locally const qualified so they weren't classified as constants by the readability-identifier-naming check. Reviewers: alexfh Reviewed By: alexfh Subscribers: klimek, cfe-commits, xazax.hun Patch by Beren Minor! Differential Revision: https://reviews.llvm.org/D39363 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@320406 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29[clang-tidy] make readability-simplify-bool-expr completely ignore macrosAlexander Kornienko
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@319325 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-28[clang-tidy] Ignore ExprWithCleanups when looking for else-after-throwMalcolm Parsons
Summary: The readability-else-after-return check was not warning about an else after a throw of an exception that had arguments that needed to be cleaned up. Reviewers: aaron.ballman, alexfh, djasper Reviewed By: aaron.ballman Subscribers: lebedev.ri, klimek, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D40505 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@319174 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-27[clang-tidy] readability-non-const-parameter fixes should update all ↵Alexander Kornienko
declarations Fixes http://llvm.org/PR34410. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@319021 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-12Revert "Fix nested namespaces in google-readability-nested-namespace-comments."Alexander Kornienko
This reverts r315057. The revision introduces assertion failures: assertion failed at llvm/tools/clang/include/clang/Basic/SourceManager.h:428 in const clang::SrcMgr::ExpansionInfo &clang::SrcMgr::SLocEntry::getExpansion() const: isExpansion() && "Not a macro expansion SLocEntry!" Stack trace: __assert_fail clang::SrcMgr::SLocEntry::getExpansion() clang::SourceManager::getExpansionLocSlowCase() clang::SourceManager::getExpansionLoc() clang::Lexer::getRawToken() clang::tidy::readability::NamespaceCommentCheck::check() clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::MatchVisitor::visitMatch() clang::ast_matchers::internal::BoundNodesTreeBuilder::visitMatches() clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::matchWithFilter() clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::matchDispatch() clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl() clang::RecursiveASTVisitor<>::TraverseDeclContextHelper() clang::RecursiveASTVisitor<>::TraverseDecl() clang::RecursiveASTVisitor<>::TraverseDeclContextHelper() clang::RecursiveASTVisitor<>::TraverseDecl() clang::RecursiveASTVisitor<>::TraverseDeclContextHelper() clang::RecursiveASTVisitor<>::TraverseDecl() clang::ast_matchers::MatchFinder::matchAST() clang::MultiplexConsumer::HandleTranslationUnit() clang::ParseAST() clang::FrontendAction::Execute() clang::CompilerInstance::ExecuteAction() clang::tooling::FrontendActionFactory::runInvocation() clang::tooling::ToolInvocation::runInvocation() clang::tooling::ToolInvocation::run() Still working on an isolated test case. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@315580 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-06Fix nested namespaces in google-readability-nested-namespace-comments.Aaron Ballman
Fixes PR34701. Patch by Alexandru Octavian Buțiu. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@315057 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11[clang-tidy] FunctionSizeCheck: wrap FunctionASTVisitor into anon namespace, NFCRoman Lebedev
This check is relatively simple, and is often being used as an example. I'm aware of at least two cases, when simply copying the FunctionASTVisitor class to a new check resulted in a rather unobvious segfault. Having it in anonymous namespace prevents such a problem. No functionality change, so i opted to avoid phabricator, especially since clang-tidy reviews are seriously jammed. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@312912 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08[clang-tidy] Add new readability non-idiomatic static access checkGabor Horvath
Patch by: Lilla Barancsuk Differential Revision: https://reviews.llvm.org/D35937 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@310371 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08[clang-tidy] 'implicit cast' -> 'implicit conversion'Alexander Kornienko
Summary: This patch renames checks, check options and changes messages to use correct term "implicit conversion" instead of "implicit cast" (which has been in use in Clang AST since ~10 years, but it's still technically incorrect w.r.t. C++ standard). * performance-implicit-cast-in-loop -> performance-implicit-conversion-in-loop * readability-implicit-bool-cast -> readability-implicit-bool-conversion - readability-implicit-bool-cast.AllowConditionalIntegerCasts -> readability-implicit-bool-conversion.AllowIntegerConditions - readability-implicit-bool-cast.AllowConditionalPointerCasts -> readability-implicit-bool-conversion.AllowPointerConditions Reviewers: hokein, jdennett Reviewed By: hokein Subscribers: mgorny, JDevlieghere, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D36456 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@310366 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02Adapt clang-tidy checks to changing semantics of hasDeclaration.Manuel Klimek
Differential Revision: https://reviews.llvm.org/D36154 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@309810 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-01[clang-tidy] Handle anonymous structs/unions in member init checks.Malcolm Parsons
Use getAnyMember() instead of getMember() to avoid crash on anonymous structs/unions. Don't warn about initializing members of an anonymous union. Fixes PR32966. Reviewed by alexfh. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@309668 91177308-0d34-0410-b5e6-96231b3b80d8