[PATCH] D62977: [clang-tidy]: Google: new check 'google-upgrade-googletest-case'

2019-06-27 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni marked 4 inline comments as done. astrelni added a comment. In D62977#1560879 , @lebedev.ri wrote: > Looks reasonable. I did not review the check itself though. > Are `test/clang-tidy/google-upgrade-googletest-case-nosuite.cpp` and > `test/clang

[PATCH] D62977: [clang-tidy]: Google: new check 'google-upgrade-googletest-case'

2019-06-27 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni updated this revision to Diff 206889. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62977/new/ https://reviews.llvm.org/D62977 Files: clang-tools-extra/clang-tidy/google/CMakeLists.txt clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp clang-tools-extra/clang-tidy/go

[PATCH] D62977: [clang-tidy]: Google: new check 'google-upgrade-googletest-case'

2019-06-27 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni added a comment. In D62977#1559649 , @lebedev.ri wrote: > In D62977#1559637 , @astrelni wrote: > > > In D62977#1559628 , @lebedev.ri > > wrote: > > > > > It //sound

[PATCH] D62977: [clang-tidy]: Google: new check 'google-upgrade-googletest-case'

2019-06-27 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni updated this revision to Diff 206855. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62977/new/ https://reviews.llvm.org/D62977 Files: clang-tools-extra/clang-tidy/google/CMakeLists.txt clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp clang-tools-extra/clang-tidy/go

[PATCH] D62977: [clang-tidy]: Google: new check 'google-upgrade-googletest-case'

2019-06-26 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni added a comment. In D62977#1559628 , @lebedev.ri wrote: > It //sounds// correct, but i don't see accompanying test changes, so i can't > be sure. The tests as they are cover the positive case in that they would not show warning or fixes if we

[PATCH] D62977: [clang-tidy]: Google: new check 'google-upgrade-googletest-case'

2019-06-26 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni added a comment. In D62977#1559344 , @lebedev.ri wrote: > In D62977#1559334 , @astrelni wrote: > > > In D62977#1556346 , @lebedev.ri > > wrote: > > > > > In D62977#

[PATCH] D62977: [clang-tidy]: Google: new check 'google-upgrade-googletest-case'

2019-06-26 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni updated this revision to Diff 206720. astrelni marked 4 inline comments as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62977/new/ https://reviews.llvm.org/D62977 Files: clang-tools-extra/clang-tidy/google/CMakeLists.txt clang-tools-extra/clang-tidy/google/GoogleTidyM

[PATCH] D62977: [clang-tidy]: Google: new check 'google-upgrade-googletest-case'

2019-06-12 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni updated this revision to Diff 204318. astrelni added a comment. Fix diff issues again CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62977/new/ https://reviews.llvm.org/D62977 Files: clang-tools-extra/clang-tidy/google/CMakeLists.txt clang-tools-extra/clang-tidy/google/Goog

[PATCH] D62977: [clang-tidy]: Google: new check 'google-upgrade-googletest-case'

2019-06-12 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni updated this revision to Diff 204317. astrelni added a comment. Fix mistake not uploading full diff CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62977/new/ https://reviews.llvm.org/D62977 Files: clang-tools-extra/clang-tidy/google/CMakeLists.txt clang-tools-extra/clang-ti

[PATCH] D62977: [clang-tidy]: Google: new check 'google-upgrade-googletest-case'

2019-06-12 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni marked an inline comment as done. astrelni added a comment. In D62977#1533384 , @Eugene.Zelenko wrote: > I think will be good idea to replace //upgrade// with //modernize// to be > consistent with similar checks in other module. I will work on

[PATCH] D62977: [clang-tidy]: Google: new check 'google-upgrade-googletest-case'

2019-06-12 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni updated this revision to Diff 204313. astrelni marked 2 inline comments as done. astrelni added a comment. Fix space. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62977/new/ https://reviews.llvm.org/D62977 Files: clang-tools-extra/docs/clang-tidy/checks/google-upgrade-googl

[PATCH] D62977: [clang-tidy]: Google: new check 'google-upgrade-googletest-case'

2019-06-12 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni updated this revision to Diff 204312. astrelni added a comment. Style updates. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62977/new/ https://reviews.llvm.org/D62977 Files: clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp clang-tools-extra/clang-tidy/go

[PATCH] D62977: [clang-tidy]: Google: new check 'google-upgrade-googletest-case'

2019-06-06 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni created this revision. astrelni added reviewers: alexfh, hokein, aaron.ballman, JonasToth, EricWF. astrelni added a project: clang-tools-extra. Herald added subscribers: llvm-commits, cfe-commits, xazax.hun, mgorny. Herald added projects: clang, LLVM. Introduce a new check to upgrade user

[PATCH] D53830: [clang-tidy]: Abseil: new check 'abseil-upgrade-duration-conversions'

2018-11-21 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni marked 5 inline comments as done. astrelni added a comment. Sorry for the long delay. I've reworked the template instantiation stuff a little bit yet again. Going to still come back and comment with results of profiling but I think now this shouldn't be much slower than if the template

[PATCH] D53830: [clang-tidy]: Abseil: new check 'abseil-upgrade-duration-conversions'

2018-11-21 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni updated this revision to Diff 174931. https://reviews.llvm.org/D53830 Files: clang-tidy/abseil/AbseilTidyModule.cpp clang-tidy/abseil/CMakeLists.txt clang-tidy/abseil/UpgradeDurationConversionsCheck.cpp clang-tidy/abseil/UpgradeDurationConversionsCheck.h docs/ReleaseNotes.rst

[PATCH] D53830: [clang-tidy]: Abseil: new check 'abseil-upgrade-duration-conversions'

2018-11-15 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni updated this revision to Diff 174226. astrelni added a comment. Fix incorrect uploaded diff. https://reviews.llvm.org/D53830 Files: clang-tidy/abseil/AbseilTidyModule.cpp clang-tidy/abseil/CMakeLists.txt clang-tidy/abseil/UpgradeDurationConversionsCheck.cpp clang-tidy/abseil/Up

[PATCH] D53830: [clang-tidy]: Abseil: new check 'abseil-upgrade-duration-conversions'

2018-11-15 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni updated this revision to Diff 174218. astrelni marked an inline comment as done. astrelni added a comment. Fix to use `hasAnyName` everywhere https://reviews.llvm.org/D53830 Files: clang-tidy/abseil/AbseilTidyModule.cpp clang-tidy/abseil/CMakeLists.txt clang-tidy/abseil/UpgradeDu

[PATCH] D53830: [clang-tidy]: Abseil: new check 'abseil-upgrade-duration-conversions'

2018-11-02 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni marked an inline comment as done. astrelni added inline comments. Comment at: clang-tidy/abseil/UpgradeDurationConversionsCheck.cpp:33-36 + anyOf(hasAncestor( +functionTemplateDecl(HasMatchingDependentDescendant)), +

[PATCH] D53830: [clang-tidy]: Abseil: new check 'abseil-upgrade-duration-conversions'

2018-11-02 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni updated this revision to Diff 172402. astrelni added a comment. Herald added a subscriber: mgrang. Updated filtering of template instantiations to not use potentially costly hasDescendent matcher. https://reviews.llvm.org/D53830 Files: clang-tidy/abseil/AbseilTidyModule.cpp clang-

[PATCH] D53830: [clang-tidy]: Abseil: new check 'abseil-upgrade-duration-conversions'

2018-10-31 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni added inline comments. Comment at: clang-tidy/abseil/UpgradeDurationConversionsCheck.cpp:151-152 + const auto *ArgExpr = Result.Nodes.getNodeAs("arg"); + llvm::StringRef Message = "perform explicit cast on expression getting " +"implicitly c

[PATCH] D53830: [clang-tidy]: Abseil: new check 'abseil-upgrade-duration-conversions'

2018-10-31 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni added inline comments. Comment at: docs/clang-tidy/checks/abseil-upgrade-duration-conversions.rst:22 +prevent unintended behavior. Passing an argument of class type will result in +compile error, even if the type is implicitly convertible to an arithmetic type. + --

[PATCH] D53830: [clang-tidy]: Abseil: new check 'abseil-upgrade-duration-conversions'

2018-10-31 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni updated this revision to Diff 172005. astrelni marked 3 inline comments as done. astrelni added a comment. Reply to comments: - Change diagnostic message - Update documentation https://reviews.llvm.org/D53830 Files: clang-tidy/abseil/AbseilTidyModule.cpp clang-tidy/abseil/CMakeLis

[PATCH] D53830: [clang-tidy]: Abseil: new check 'abseil-upgrade-duration-conversions'

2018-10-31 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni added inline comments. Comment at: test/clang-tidy/abseil-upgrade-duration-conversions.cpp:142 + +template void templateForOpsSpecialization(T) {} +template <> JonasToth wrote: > astrelni wrote: > > JonasToth wrote: > > > what about non-type template pa

[PATCH] D53830: [clang-tidy]: Abseil: new check 'abseil-upgrade-duration-conversions'

2018-10-31 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni updated this revision to Diff 172000. astrelni marked 2 inline comments as done. astrelni added a comment. Reply to review comments: - minor code reorder - improve test coverage https://reviews.llvm.org/D53830 Files: clang-tidy/abseil/AbseilTidyModule.cpp clang-tidy/abseil/CMakeLi

[PATCH] D53830: [clang-tidy]: Abseil: new check 'abseil-upgrade-duration-conversions'

2018-10-31 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni marked 3 inline comments as done. astrelni added inline comments. Comment at: clang-tidy/abseil/UpgradeDurationConversionsCheck.cpp:158 + *Result.Context) + .empty()) { + diag(ArgExpr->getBeginLoc(), Message); JonasToth wro

[PATCH] D53830: [clang-tidy]: Abseil: new check 'abseil-upgrade-duration-conversions'

2018-10-31 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni updated this revision to Diff 171973. astrelni added a comment. Combine template instantiation matching into the other matcher registration. https://reviews.llvm.org/D53830 Files: clang-tidy/abseil/AbseilTidyModule.cpp clang-tidy/abseil/CMakeLists.txt clang-tidy/abseil/UpgradeDur

[PATCH] D53830: [clang-tidy]: Abseil: new check 'abseil-upgrade-duration-conversions'

2018-10-31 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni marked an inline comment as done. astrelni added inline comments. Comment at: clang-tidy/abseil/UpgradeDurationConversionsCheck.cpp:118 +AST_MATCHER_P(Expr, hasSourceRange, SourceRange, Range) { + return Node.getSourceRange() == Range; +} JonasToth wrot

[PATCH] D53830: [clang-tidy]: Abseil: new check 'abseil-upgrade-duration-conversions'

2018-10-31 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni updated this revision to Diff 171925. astrelni marked 9 inline comments as done. astrelni added a comment. Thanks for the feedback so far. Reply to review comments. - Improve comments. - Fix matcher to check for invalid source range. - Improve test coverage for templates and macros. h

[PATCH] D53830: [clang-tidy]: Abseil: new check 'abseil-upgrade-duration-conversions'

2018-10-29 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni updated this revision to Diff 171566. astrelni added a comment. Reply to comments: add check for language being c++, explicitly name type in declaration, alphabetize release notes. https://reviews.llvm.org/D53830 Files: clang-tidy/abseil/AbseilTidyModule.cpp clang-tidy/abseil/CMak

[PATCH] D53830: [clang-tidy]: Abseil: new check 'upgrade-duration-conversions'

2018-10-29 Thread Alex Strelnikov via Phabricator via cfe-commits
astrelni created this revision. astrelni added reviewers: ahedberg, hokein. astrelni added a project: clang-tools-extra. Herald added subscribers: jfb, xazax.hun, mgorny. Introduce a new check to upgrade user code based on upcoming API breaking changes to absl::Duration. The check finds calls to