[PATCH] D54945: This commit adds a chapter about clang-tidy integrations

2019-01-17 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. I requested merge of updated documentation into 8.0 branch in PR40369. Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54945/new/ https://reviews.llvm.org/D54945 ___ cfe-commits mailing l

[PATCH] D56926: [Documentation] Use HTTPS whenever possible in clang-tools-extra

2019-01-18 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko created this revision. Eugene.Zelenko added reviewers: alexfh, aaron.ballman, JonasToth, MyDeveloperDay, juliehockett, lebedev.ri. Eugene.Zelenko added a project: clang-tools-extra. Herald added subscribers: kadircet, arphaman, kbarton, nemanjai. Repository: rCTE Clang Tools Extr

[PATCH] D56926: [Documentation] Use HTTPS whenever possible in clang-tools-extra

2019-01-18 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko updated this revision to Diff 182590. Eugene.Zelenko added a comment. Don't use HTTPS for www.codingstandard.com Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56926/new/ https://reviews.llvm.org/D56926 Files: llvm-svn.src/tools/cla

[PATCH] D56946: [Documentation] Use HTTPS whenever possible in Clang

2019-01-18 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko created this revision. Eugene.Zelenko added reviewers: sylvestre.ledru, hans. Eugene.Zelenko added a project: clang. Repository: rC Clang https://reviews.llvm.org/D56946 Files: llvm-svn.src/tools/clang/docs/AutomaticReferenceCounting.rst llvm-svn.src/tools/clang/docs/ClangFo

[PATCH] D56945: [clang-tidy] Delete obsolete objc-property-declaration options ✂️

2019-01-18 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/ReleaseNotes.rst:248 +- The `Acronyms` and `IncludeDefaultAcronyms` options for the + :doc:`objc-property-declaration` Please rebase from trunk and use :option: prefix for options.. Comm

[PATCH] D56946: [Documentation] Use HTTPS whenever possible in Clang

2019-01-21 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. Yes, I tested all URLs, but I think independent testing will not be excessive. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56946/new/ https://reviews.llvm.org/D56946 ___ cfe-commits

[PATCH] D57113: [clang-tidy] openmp-use-default-none - a new module and a check

2019-01-23 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. Please mention new module in docs/clang-tidy/index.rst. Comment at: docs/ReleaseNotes.rst:76 +- New OpenMP module. + Please put new module before list of new checks. Comment at: docs/ReleaseNotes.rst:83 + +

[PATCH] D57185: [clang-tidy] Add the abseil-duration-addition check

2019-01-24 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/ReleaseNotes.rst:76 +- New :doc:`abseil-duration-addition + ` check. Please use alphabetical order for new checks. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.o

[PATCH] D57113: [clang-tidy] openmp-use-default-none - a new module and a check

2019-01-26 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. New module is still not mentioned in docs/clang-tidy/index.rst. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57113/new/ https://reviews.llvm.org/D57113 ___ cfe-commits m

[PATCH] D57353: [clang-tidy] Add the abseil-duration-double-conversion check

2019-01-28 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/abseil/DurationDoubleConversionCheck.cpp:48 + + if (!isNotInMacro(Result, OuterCall)) return; + Please run Clang-format. Comment at: docs/ReleaseNotes.rst:85 + + Find and fix cases

[PATCH] D57353: [clang-tidy] Add the abseil-duration-double-conversion check

2019-01-29 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/clang-tidy/checks/abseil-duration-double-conversion.rst:28 + +Note: Converting to an integer and back to an `absl::Duration` might be a +truncating operation if the value is not aligned to the scale of conversion. ---

[PATCH] D57435: [clang-tidy] Add abseil-wrap-unique check

2019-01-30 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/abseil/AbseilTidyModule.cpp:61 +"abseil-wrap-unique"); + + } Unnecessary empty line. Comment at: clang-tidy/abseil/WrapUniqueCheck.cpp:10 + +#include +#include "WrapUniqueCh

[PATCH] D57435: [clang-tidy] Add abseil-wrap-unique check

2019-01-30 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/abseil/WrapUniqueCheck.cpp:80 + if (cons) { +if (cons->isListInitialization()) { + return; Please elide braces. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57435/new/ https://revi

[PATCH] D53882: [clang-tidy] Adding Zircon checker for std namespace

2018-10-31 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:176 + + Warns when the `std` namespace is used, as its use is against Zircon's libc++ + policy for the kernel. JonasToth wrote: > alexfh wrote: > > JonasToth wrote: > > >

[PATCH] D53974: [clang-tidy] new checker: bugprone-too-small-loop-variable

2018-11-01 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/bugprone/TooSmallLoopVariableCheck.cpp:26 + + +/// \brief The matcher for loops with suspicious integer loop variable. Please remove unnecessary empty line. Comment at: clang-tidy/bug

[PATCH] D53974: [clang-tidy] new check: bugprone-too-small-loop-variable

2018-11-02 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/ReleaseNotes.rst:116 + + This check searches for those for loops which has a loop variable with + a "too small" type which means this type can't represent all values Please avoid This check, may be Detects?

[PATCH] D53974: [clang-tidy] new check: bugprone-too-small-loop-variable

2018-11-05 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/clang-tidy/checks/bugprone-too-small-loop-variable.rst:10 + + .. code-block:: c++ + JonasToth wrote: > ztamas wrote: > > JonasToth wrote: > > > the `.. code-block:: c++` is usually not indended, only the cod

[PATCH] D54141: [clang-tidy] add deduplication support for run-clang-tidy.py

2018-11-06 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. Reducing log file size is good idea, but I think will be also good idea to count duplicates. This will allow to concentrate clean-up efforts on place where most of warnings originate. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D54141 _

[PATCH] D54169: [clang-tidy] Zircon ->

2018-11-06 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clang-tidy/zircon/FblLimitsCheck.cpp:111 + // Add in the header, since we know this file uses it. + if (auto IncludeFixit = Inserter->CreateIncludeInsertion( + SM.getFileID(V->getLocation()), "limits"

[PATCH] D54168: [clang-tidy] Zircon fbl::move -> std::move

2018-11-06 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clang-tidy/zircon/FblMoveCheck.cpp:61 +// Add in the header. +if (auto IncludeFixit = +Inserter->CreateIncludeInsertion(SM.getFileID(Start), "utility", Please don't use auto

[PATCH] D54168: [clang-tidy] Zircon fbl::move -> std::move

2018-11-06 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:188 + + Suggests converting uses of ``fbl::move`` to + ``std::move``, and suggests inserting the header. Please try to fill as much as possible to 80 characters. ==

[PATCH] D54222: [clang-tidy/checks] Add a checker to detect returning static locals in public headers

2018-11-07 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. C++ Core Guidelines also mentioned similar patterns, so may be this check belongs to bugprone module? Comment at: docs/clang-tidy/checks/llvm-problematic-statics.rst:7 + +Looks for functions defined in "public" headers that return the address of

[PATCH] D54222: [clang-tidy] Add a check to detect returning static locals in public headers

2018-11-07 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. Please mention new check in Release Notes (in alphabetical order). Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D54222 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cg

[PATCH] D54246: [clang-tidy] Add the abseil-duration-factory-scale check

2018-11-07 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/abseil/DurationFactoryScaleCheck.cpp:36 +GetScaleForFactory(llvm::StringRef FactoryName) { + static const auto *ScaleMap = + new std::unordered_map( This will cause memory leaks, so may be unique_

[PATCH] D54246: [clang-tidy] Add the abseil-duration-factory-scale check

2018-11-08 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/ReleaseNotes.rst:88 + Checks for cases where arguments to ``absl::Duration`` factory functions are + scaled internally and could be changed to a different factory function. This + check also looks for arguements with a ze

[PATCH] D54262: [clang-tidy] Add `delete this` bugprone check (PR38741)

2018-11-08 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. Please mention this check in docs/ReleaseNotes.rst (in alphabetical order). Comment at: docs/clang-tidy/checks/bugprone-delete-this.rst:8 + +Said statement generates multiple problems, such as enforcing allocating the object via ``new``, or not

[PATCH] D54262: [clang-tidy] Add `delete this` bugprone check (PR38741)

2018-11-08 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. Please also add regression test case. Is should also cover standalone function with this variable. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D54262 ___ cfe-commits mailing list cfe-commits@lists.

[PATCH] D54269: Introduce shard storage to auto-index.

2018-11-08 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clangd/index/Background.cpp:29 #include +#include +#include Please run Clang-format. Headers in sections should be in alphabetical order. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D54269

[PATCH] D54349: [clang-tidy] new check 'readability-redundant-pp'

2018-11-09 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/ReleaseNotes.rst:73 + + Finds potentially redundant preprocessor usage. + preprocessor directives? Same in documentation. Comment at: docs/clang-tidy/checks/readability-redundant-pp.rst:8

[PATCH] D54757: [clang-tidy] new check: bugprone-branch-clone

2018-11-20 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/bugprone/BranchCloneCheck.cpp:19 + +namespace { + Please use anonymous namespaces only for type declarations. See LLV coding style guide. Comment at: clang-tidy/bugprone/BranchCloneC

[PATCH] D48866: [clang-tidy] Add incorrect-pointer-cast checker

2018-11-20 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/ReleaseNotes.rst:60 +- New :doc:`misc-incorrect-pointer-cast + ` check hgabii wrote: > Eugene.Zelenko wrote: > > Will be good idea to rebase from trunk and use alphabetical order. > It is rebased. I could

[PATCH] D54737: [clang-tidy] Add the abseil-duration-comparison check

2018-11-20 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/clang-tidy/checks/abseil-duration-comparison.rst:11 +compared against a floating-pointer value, truncation during the ``Duration`` +conversion might yield a different result. In practice this is very rare, and +still indicat

[PATCH] D54757: [clang-tidy] new check: bugprone-branch-clone

2018-11-21 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. In https://reviews.llvm.org/D54757#1305114, @whisperity wrote: > Bar the previous comments, I really like this. The test suite is massive and > well-constructed. Do we know of any real-world findings, maybe even from LLVM? GCC 7 introduced -Wduplicated-branches,

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2018-11-27 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/utils/LexerUtils.h:43 + if (Start.isInvalid() || Start.isMacroID()) +return SourceLocation(); while (true) { {} could returned instead. Comment at: docs/ReleaseNotes.rst:180

[PATCH] D54945: This commit adds a chapter about clang-tidy integrations

2018-11-28 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/clang-tidy/index.rst:304 +CLion_ 2017.2 and later `integrates clang-tidy`_ as an extension to the built-in code analyzer. +Inspections and applicable quick-fixes are performed on the fly, and checks can be configured in the

[PATCH] D55044: [clang-tidy] check for Abseil make_unique

2018-11-29 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/ReleaseNotes.rst:70 +- New :doc:`abseil-make-unique + ` check. Please use alphabetical order for new checks. Comment at: docs/clang-tidy/checks/abseil-make-unique.rst:6 + +Replaces uniqu

[PATCH] D54757: [clang-tidy] new check: bugprone-branch-clone

2018-11-29 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: test/clang-tidy/bugprone-branch-clone.cpp:4 +void test_basic1(int in, int &out) { + if (in > 77) +// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone] dona

[PATCH] D54757: [clang-tidy] new check: bugprone-branch-clone

2018-11-30 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. Please close PR30233 after committing patch. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54757/new/ https://reviews.llvm.org/D54757 ___ cfe-commits mailing list cfe-com

[PATCH] D55245: [clang-tidy] Add the abseil-duration-subtraction check

2018-12-04 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/clang-tidy/checks/abseil-duration-subtraction.rst:7 +Checks for cases where subtraction should be performed in the +``absl::Duration`` domain. When subtracting two values, and the first one is +known to be a conversion from

[PATCH] D42682: [clang-tidy] Add io-functions-misused checker

2018-12-04 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/clang-tidy/checks/bugprone-io-functions.rst:4 +bugprone-io-functions += + Please adjust length. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.

[PATCH] D55346: [clang-tidy] check for using declaration scope and qualification

2018-12-05 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/abseil/AnonymousEnclosedAliasesCheck.cpp:31 + + +void AnonymousEnclosedAliasesCheck::check(const MatchFinder::MatchResult &Result) { Please remove unnecessary empty line. Comment at:

[PATCH] D55346: [clang-tidy] check for using declaration scope and qualification

2018-12-05 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/clang-tidy/checks/abseil-anonymous-enclosed-aliases.rst:20 + + } // foo Are there guidelines? Comment at: docs/clang-tidy/checks/abseil-qualified-aliases.rst:22 + +See https://abseil.io/ti

[PATCH] D55410: [clang-tidy] check for flagging using declarations in headers

2018-12-07 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/ReleaseNotes.rst:73 + + Flags using declarations in header files, and suggests that + these aliases be removed Please highlight using with ``. Comment at: docs/clang-tidy/checks/abseil-al

[PATCH] D55410: [clang-tidy] check for flagging using declarations in headers

2018-12-07 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/clang-tidy/checks/abseil-alias-free-headers.rst:13 +The style guide http://google.github.io/styleguide/cppguide.html#Aliases discusses this +issue in more detail Missing link to guidelines, Repository:

[PATCH] D55433: [clang-tidy] Adding a new modernize use nodiscard checker

2018-12-07 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/modernize/UseNodiscardCheck.cpp:21 +namespace modernize { +namespace { + Please use static instead anonymous namespace for functions. See LLVM code style guidelines. Comment at: clan

[PATCH] D55433: [clang-tidy] Adding a new modernize use nodiscard checker

2018-12-07 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/modernize/UseNodiscardCheck.cpp:40 +void UseNodiscardCheck::registerMatchers(MatchFinder *Finder) { + + // if we are using C++17 attributes we are going to need c++17 Unnecessary empty line.

[PATCH] D55433: [clang-tidy] Adding a new modernize use nodiscard checker

2018-12-07 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/ReleaseNotes.rst:173 + + This check adds ``[[nodiscard]]`` attributes (introduced in C++17) to member + functions to highlight at compile time where the return value of a function Please omit this check. Sa

[PATCH] D55508: [clang-tidy] insert release notes for new checkers alphabetically

2018-12-10 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. Thank you for this fix! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55508/new/ https://reviews.llvm.org/D55508 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/l

[PATCH] D55433: [clang-tidy] Adding a new modernize use nodiscard checker

2018-12-10 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/clang-tidy/checks/modernize-use-nodiscard.rst:37 + +Specify a macro to use instead of ``[[nodiscard]]``. +This is useful when maintaining source code that needs to compile with a pre-C++17 compiler. Specifi

[PATCH] D55433: [clang-tidy] Adding a new modernize use nodiscard checker

2018-12-10 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/clang-tidy/checks/modernize-use-nodiscard.rst:37 + +Specify a macro to use instead of ``[[nodiscard]]``. This is useful when +maintaining source code that needs to compile with a pre-C++17 compiler. Option

[PATCH] D55508: [clang-tidy] insert release notes for new checkers alphabetically

2018-12-10 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. By the word, will be good idea to have script which check alphabetical order and use it during build. Sometimes alphabetical order may be violated after merge with trunk. Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55508/new/ ht

[PATCH] D55433: [clang-tidy] Adding a new modernize use nodiscard checker

2018-12-10 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/clang-tidy/checks/modernize-use-nodiscard.rst:49 + + +.. code-block:: c++ Unnecessary empty line. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55433/new/ https://reviews.llvm.org/D55433 ___

[PATCH] D55410: [clang-tidy] check for flagging using declarations in headers

2018-12-10 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/clang-tidy/checks/abseil-alias-free-headers.rst:13 +The style guide http://google.github.io/styleguide/cppguide.html#Aliases discusses this +issue in more detail Naysh wrote: > Eugene.Zelenko wrote: > > Mis

[PATCH] D58731: [clang-tidy] added cppcoreguidelines-explicit-virtual-functions

2019-02-27 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/clang-tidy/checks/modernize-use-override.rst:5 == Will be good idea to remove duplicated empty line. Comment at: docs/clang-tidy/checks/modernize-use-override.rst:1

[PATCH] D58818: [clang-tidy] added cppcoreguidelines-use-raii-locks check

2019-03-02 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/cppcoreguidelines/UseRaiiLocksCheck.cpp:29 + +DeclRefExpr *findDeclRefExpr(const CXXMemberCallExpr *MemberCallExpr) { + auto *ObjectExpr = MemberCallExpr->getImplicitObjectArgument(); Please use static

[PATCH] D58977: [clang-tidy] Add the abseil-time-comparison check

2019-03-06 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/clang-tidy/checks/abseil-time-comparison.rst:6 + +Checks for comparisons which should be in the ``absl::Time`` domain instead +of the integer domains. Please synchronize with Release Notes.

[PATCH] D59103: [clang-tidy] New checker bugprone-incomplete-comparison-operator

2019-03-07 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/bugprone/IncompleteComparisonOperatorCheck.cpp:197 + + const auto Ops = utils::options::parseStringList(CheckedFunctions); + Finder->addMatcher( Please don't use auto where return type is not obvious.

[PATCH] D59540: [clang-tidy] [PR41119] readability-identifier-naming incorrectly fixes lambda capture

2019-03-19 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/readability/IdentifierNamingCheck.cpp:790 if (const auto *DeclRef = Result.Nodes.getNodeAs("declRef")) { -SourceRange Range = DeclRef->getNameInfo().getSourceRange(); -addUsage(NamingCheckFailures, DeclRef->g

[PATCH] D59605: [clangd] Introduce background-indexer

2019-03-20 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clangd/background-indexer/BackgroundIndexer.cpp:13 + +#include "/usr/local/google/home/kadircet/repos/llvm/clang-tools-extra/clangd/Context.h" +#include "/usr/local/google/home/kadircet/repos/llvm/clang-tools-e

[PATCH] D59599: [clangd] Fix a crash while printing Template Arguments

2019-03-20 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clangd/AST.cpp:86 else if (auto *Cls = llvm::dyn_cast(&ND)) { -if (auto STL = Cls->getTypeAsWritten() - ->getTypeLoc() - .getAs()) { - llvm::SmallVector ArgLocs; - ArgLo

[PATCH] D59605: [clangd] Introduce background-indexer

2019-03-20 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clangd/index/Background.cpp:29 #include "llvm/Support/SHA1.h" #include Unnecessary empty line. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D

[PATCH] D59639: [clangd] Print template arguments helper

2019-03-21 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clangd/AST.cpp:26 +llvm::Optional> +getTemplateSpecializationArgLocs(const NamedDecl &ND) { + if (auto *Func = llvm::dyn_cast(&ND)) { Functions should be static, not in anonymous namespace. See

[PATCH] D59639: [clangd] Print template arguments helper

2019-03-22 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clangd/AST.cpp:26 +llvm::Optional> +getTemplateSpecializationArgLocs(const NamedDecl &ND) { + if (auto *Func = llvm::dyn_cast(&ND)) { ilya-biryukov wrote: > Eugene.Zelenko wrote: > > Functions s

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-25 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/HeaderFileExtensionsUtils.h:23 -typedef llvm::SmallSet HeaderFileExtensionsSet; +typedef SmallSet HeaderFileExtensionsSet; Please use using. See modernize-use-using. ==

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-25 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/HeaderFileExtensionsUtils.h:17 +using llvm::SmallSet; + It'll be easier to use llvm::SmallSet in using statement. Comment at: clang-tools-extra/docs/ReleaseN

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers 🔍

2019-03-26 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clang-tidy/objc/SuperSelfCheck.cpp:61 + // Check if any of the superclasses of the class match. + for (const auto *SuperClass = Node.getClassInterface()->getSuperClass(); + SuperClass != nullptr; SuperCla

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-26 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/llvm-avoid-cast-in-conditional.rst:8 +statements which will assert on failure in Debug builds. The use of +cast<> implies that the operation cannot fail, and should not be used +as the con

[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers 🔍

2019-03-26 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:113 + + Finds invocations of `-self` on super instances in initializers of subclasses + of `NSObject` and recommends calling a superclass initializer instead. Please use d

[PATCH] D59870: [clang-tidy] Add MagnitudeBitsUpperLimit option to bugprone-too-small-loop-variable

2019-03-27 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/ReleaseNotes.rst:122 +- The :bugprone-too-small-loop-variable + ` now supports :doc prefix and ` is missing. Please also rebase patch from trunk. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST

[PATCH] D59887: [Syntax] Introduce TokenBuffer, start clangToolingSyntax library

2019-03-27 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang/lib/Tooling/Syntax/TokenBuffer.cpp:8 +//===--===// +#include "clang/Tooling/Syntax/TokenBuffer.h" +#include "clang/Basic/Diagnostic.h" Plea

[PATCH] D59887: [Syntax] Introduce TokenBuffer, start clangToolingSyntax library

2019-03-27 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang/lib/Tooling/Syntax/TokenBuffer.cpp:323 + PP.getLangOpts(), Tokens); + auto *CB = CBOwner.get(); + ilya-biryukov wrote: > Eugene.Zelenko wrote: > > Return type is

[PATCH] D57435: [clang-tidy] Add abseil-wrap-unique check

2019-03-27 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/abseil/WrapUniqueCheck.h:26 +private: + // std::string getArgs(const SourceManager *SM, const CallExpr *MemExpr); + Please remove obsolete commend and private keyword. Comment at: doc

[PATCH] D59932: [clang-tidy] **Prototype**: Add fix description to clang-tidy checks.

2019-03-28 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/ClangTidyCheck.h:109 + /// not supported. + virtual llvm::StringRef fixDescription() { return ""; } + return {} could be used instead. Comment at: clang-tidy/ClangTidyDiagnostic

[PATCH] D59932: [clang-tidy] **Prototype**: Add fix description to clang-tidy checks.

2019-03-28 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/ClangTidyCheck.h:107 + /// fixes for different cases. + /// - clang compiler diagnostics and clang static analyzer diagnostics are + /// not supported. I think Clang and Clang Static Analyz

[PATCH] D59932: [clang-tidy] **Prototype**: Add fix description to clang-tidy checks.

2019-03-28 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. In D59932#1446533 , @JonasToth wrote: > I think the idea is good and implementation, too. If we iterate all checks > anyway (probably?) we could think about adding a severity to the checks, too? > > I know that code-checker

[PATCH] D59963: Add a clang-tidy module for the Linux kernel.

2019-03-28 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. I think linuxkernel name will be less ambiguous. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59963/new/ https://reviews.llvm.org/D59963 ___ cfe-commits mailing list cf

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-28 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clang-tidy/llvm/AvoidCastInConditionalCheck.cpp:73 + Result.Nodes.getNodeAs("cast-assign")) { +auto StartLoc = MatchedDecl->getCallee()->getExprLoc(); +auto EndLoc = StartLoc.getLocWithOffset(Str

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-28 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. In D59802#1447108 , @hintonda wrote: > It's good idea to follow modernize-use-auto convention without introducing exceptions. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-04-01 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. In D59802#1450185 , @xbolva00 wrote: > Do we have any checker to recommend llvm functions over std ? > > e.g. llvm::sort, llvm::all_of, ... No. Actually LLVM coding conventions support is very limited. See https://clang.l

[PATCH] D60139: [clang-tidy] Add misc-placement-new-target-size check

2019-04-02 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/misc/PlacementNewTargetSizeCheck.cpp:10 +#include + +#include "PlacementNewTargetSizeCheck.h" Unnecessary empty line. Please run Clang-format after fixing. Comment at: clang-tidy/mis

[PATCH] D59802: [clang-tidy] Add new checker: llvm-prefer-isa-or-dyn-cast-in-conditionals

2019-04-02 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/llvm-prefer-isa-or-dyn-cast-in-conditionals.rst:6 + + Looks at conditionals and finds cases of ``cast<>``, which will + assert rather than return a null pointer, and ``dyn_cast<>`` where

[PATCH] D60139: [clang-tidy] Add misc-placement-new-target-size check

2019-04-03 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/clang-tidy/checks/misc-placement-new-target-size.rst:5 +== + + Eugene.Zelenko wrote: > Unnecessary empty line. Somehow empty line is still there. CHANGES SINCE LAST ACTION http

[PATCH] D60139: [clang-tidy] Add misc-placement-new-target-type-mismatch check

2019-04-04 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/ReleaseNotes.rst:136 + + Finds placement-new calls where the size of the pointee type of the placement + parameter is smaller than the size of the constructed type and the pointer is Please synchronize wi

[PATCH] D60139: [clang-tidy] Add bugprone-placement-new-target-type-mismatch check

2019-04-09 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/bugprone/PlacementNewTargetTypeMismatch.cpp:38 + const CastExpr *Cast = dyn_cast(PlacementExpr); + if (nullptr == Cast) { +return; JonasToth wrote: > braces, above the comment does not follow the

[PATCH] D60507: [clang-tidy] new check: bugprone-unhandled-self-assignment

2019-04-10 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/UnhandledSelfAssignmentCheck.cpp:20 +void UnhandledSelfAssignmentCheck::registerMatchers(MatchFinder *Finder) { + + // We don't care about deleted, default or implicit operator implementatio

[PATCH] D57435: [clang-tidy] Add abseil-wrap-unique check

2019-04-10 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/abseil/WrapUniqueCheck.cpp:85 + +std::string Left = (ConsDecl) ? "auto " + NameRef.str() + " = " : ""; +std::string NewText = I don't think that you need round brackets around ConsDecl. Same bel

[PATCH] D57435: [clang-tidy] Add abseil-wrap-unique check

2019-04-10 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/clang-tidy/checks/abseil-wrap-unique.rst:5 +== +Looks for instances of factory functions which uses a non-public constructor +that returns a ``std::unqiue_ptr`` then recommends using ``absl::wrap_unique(new

[PATCH] D60507: [clang-tidy] new check: bugprone-unhandled-self-assignment

2019-04-12 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/bugprone-unhandled-self-assignment.rst:6 + +"cert-oop54-cpp" redirects here as an alias for this check. + Please use back-tick to highlight cert-oop54-cpp. =

[PATCH] D60629: [clang-tidy] Change the namespace for llvm checkers from 'llvm' to 'llvm_checker'

2019-04-12 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. Please use check for consistency with rest of Clang-tidy. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60629/new/ https://reviews.llvm.org/D60629 ___ cfe-commits mailin

[PATCH] D55793: [clang-tidy] Add duplicated access specifier readability check (PR25403)

2019-04-16 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/readability-redundant-access-specifiers.rst:34 + If set to non-zero, the check will also give warning if the first access + specifier declaration is redundant (e.g. `private` inside `c

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-04-22 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:148 + + FIXME: add release notes. + Please add short description. Should be same as first statements in documentation. Repository: rG LLVM Github Monorepo CHANGES SIN

[PATCH] D61209: [clang-tidy] Fix readability-redundant-smartptr-get for MSVC STL

2019-04-26 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/test/clang-tidy/readability-redundant-smartptr-get-msvc.cpp:96 +} \ No newline at end of file Please add new line. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://r

[PATCH] D61209: [clang-tidy] Fix readability-redundant-smartptr-get for MSVC STL

2019-04-26 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/test/clang-tidy/readability-redundant-smartptr-get-msvc.cpp:37 +void Positive() { + + std::unique_ptr* up; Unnecessary empty line. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST AC

[PATCH] D61350: [clang-tidy] New check calling out uses of +new in Objective-C code

2019-04-30 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clang-tidy/google/AvoidNSObjectNewCheck.cpp:29 + +bool isMessageExpressionInsideMacro(const ObjCMessageExpr *Expr) { + SourceLocation ReceiverLocation = Expr->getReceiverRange().getBegin(); Plea

[PATCH] D61386: [clang-tidy] Add support writing a check as a Transformer rewrite rule.

2019-05-01 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/TransformerTidy.cpp:22 + // Verify the existence and validity of the AST node that roots this rule. + auto &NodesMap = Result.Nodes.getMap(); + auto Root = NodesMap.find(tooling::RewriteRule::

[PATCH] D61386: [clang-tidy] Add support writing a check as a Transformer rewrite rule.

2019-05-01 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/TransformerTidy.cpp:51 + DiagnosticBuilder Diag = diag(RootLoc, Message); + for (const tooling::Transformation &T : *Transformations) { +Diag << FixItHint::CreateReplacement(T.Range, T.Repl

[PATCH] D61350: [clang-tidy] New check calling out uses of +new in Objective-C code

2019-05-01 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clang-tidy/google/AvoidNSObjectNewCheck.cpp:16 +#include "llvm/Support/FormatVariadic.h" + +#include Unnecessary empty line. Comment at: clang-tools-extra/clang-tidy/google/Av

[PATCH] D61508: [clang-tidy] misc-header-guard : a simple version of llvm-header-guard

2019-05-03 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/misc/HeaderGuardCheck.cpp:21 + StringRef OldGuard) { + if (OldGuard.size()) { +return OldGuard; Please use early return. Comment a

[PATCH] D61749: [clang-tidy] initial version of readability-static-const-method

2019-05-09 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added subscribers: JonasToth, Eugene.Zelenko. Eugene.Zelenko added a comment. @JonasToth tried to implement const check, so probably const and static part should be split. It's hard to tell about state of existing implementation, but you could continue it or at least borrow ideas

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-15 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp:37 +static bool singleNamedNamespaceChild(NamespaceDecl const &ND) { + auto const Decls = ND.decls(); + if (childrenCount(Decls) != 1) Type is not spelled in

<    1   2   3   4   5   6   7   8   9   10   >