[PATCH] D83076: Revert AST Matchers default to AsIs mode

2020-07-02 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 275248. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83076/new/ https://reviews.llvm.org/D83076 Files: clang-tools-extra/clang-query/Query.cpp clang-tools-extra/clang-que

[PATCH] D83076: Revert AST Matchers default to AsIs mode

2020-07-03 Thread Stephen Kelly via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG551092bc3dfb: Revert AST Matchers default to AsIs mode (authored by stephenkelly). Changed prior to commit: https://reviews.llvm.org/D83076?vs=275248&id=275458#toc Repository: rG LLVM Github Monorepo

[PATCH] D80961: Ignore template instantiations if not in AsIs mode

2020-06-21 Thread Stephen Kelly via Phabricator via cfe-commits
steveire added a comment. Here's another example where it is not appropriate to transform a template instantiation: http://clang-developers.42468.n3.nabble.com/Questions-discussions-about-cast-types-in-clang-td4068626.html "If we call foo, it can be a const_cast, but if we call foo, it has to

[PATCH] D82278: Fix traversal over CXXConstructExpr in Syntactic mode

2020-06-21 Thread Stephen Kelly via Phabricator via cfe-commits
steveire created this revision. steveire added reviewers: klimek, ymandel. Herald added a project: clang. Herald added a subscriber: cfe-commits. Skip over elidable nodes, and ensure that intermediate CXXFunctionalCastExpr nodes are also skipped if they are semantic. Repository: rG LLVM Github

[PATCH] D82279: Handle invalid types in the nullPointerConstant AST matcher

2020-06-21 Thread Stephen Kelly via Phabricator via cfe-commits
steveire added inline comments. Comment at: clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp:2618 + )"; + EXPECT_TRUE(matches(kTest, expr(nullPointerConstant(; } While this test in ASTMatchers might continue to make sense, shouldn't there be a tes

[PATCH] D82279: Handle invalid types in the nullPointerConstant AST matcher

2020-06-22 Thread Stephen Kelly via Phabricator via cfe-commits
steveire accepted this revision. steveire added inline comments. This revision is now accepted and ready to land. Comment at: clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp:2618 + )"; + EXPECT_TRUE(matches(kTest, expr(nullPointerConstant(; } aaro

[PATCH] D73037: Add a way to set traversal mode in clang-query

2020-05-12 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 263535. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73037/new/ https://reviews.llvm.org/D73037 Files: clang-tools-extra/clang-query/Query.cpp clang-tools-extra/clang-que

[PATCH] D73037: Add a way to set traversal mode in clang-query

2020-05-12 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 263536. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73037/new/ https://reviews.llvm.org/D73037 Files: clang-tools-extra/clang-query/Query.cpp clang-tools-extra/clang-que

[PATCH] D72531: Set traversal explicitly where needed in tests

2020-05-12 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 263540. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72531/new/ https://reviews.llvm.org/D72531 Files: clang/unittests/AST/ASTImporterTest.cpp clang/unittests/AST/SourceL

[PATCH] D72532: Make the ExprMutationAnalyzer explicit about how it traverses the AST

2020-05-12 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 263541. steveire added a comment. Herald added a subscriber: ASDenysPetrov. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72532/new/ https://reviews.llvm.org/D72532 Files: clang/lib/Analysis/ExprMuta

[PATCH] D72534: Change default traversal in AST Matchers to ignore invisible nodes

2020-05-12 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 263551. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72534/new/ https://reviews.llvm.org/D72534 Files: clang/docs/ReleaseNotes.rst clang/include/clang/AST/ParentMapContex

[PATCH] D72534: Change default traversal in AST Matchers to ignore invisible nodes

2020-05-12 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 263552. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72534/new/ https://reviews.llvm.org/D72534 Files: clang/docs/ReleaseNotes.rst clang/include/clang/AST/ParentMapContex

[PATCH] D72530: Set traversal explicitly where needed in clang-tidy

2020-05-17 Thread Stephen Kelly via Phabricator via cfe-commits
steveire added a comment. In D72530#2038561 , @aaron.ballman wrote: > The changes here look reasonable, but can some of this code be simplified to > use the default behavior and less complex matchers that don't have to > carefully ignore implicit nodes?

[PATCH] D72531: Set traversal explicitly where needed in tests

2020-05-17 Thread Stephen Kelly via Phabricator via cfe-commits
steveire marked an inline comment as done. steveire added inline comments. Comment at: clang/unittests/Tooling/StencilTest.cpp:63 ASTContext &Context = AstUnit->getASTContext(); - auto Matches = ast_matchers::match(wrapMatcher(Matcher), Context); + auto Matches = ast_matcher

[PATCH] D72531: Set traversal explicitly where needed in tests

2020-05-18 Thread Stephen Kelly via Phabricator via cfe-commits
steveire marked an inline comment as done. steveire added inline comments. Comment at: clang/unittests/Tooling/StencilTest.cpp:63 ASTContext &Context = AstUnit->getASTContext(); - auto Matches = ast_matchers::match(wrapMatcher(Matcher), Context); + auto Matches = ast_matcher

[PATCH] D71976: Match code following lambdas when ignoring invisible nodes

2019-12-29 Thread Stephen Kelly via Phabricator via cfe-commits
steveire created this revision. steveire added a reviewer: aaron.ballman. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D71976 Files: clang/lib/ASTMatchers/ASTMatchFinder.cpp clang/unittests/ASTMatchers/A

[PATCH] D71977: Implement additional traverse() overloads

2019-12-29 Thread Stephen Kelly via Phabricator via cfe-commits
steveire created this revision. steveire added a reviewer: aaron.ballman. Herald added a project: clang. Herald added a subscriber: cfe-commits. These overloads make it possible to wrap unless(), anyOf(), has() etc with the traverse matcher. Repository: rG LLVM Github Monorepo https://reviews

[PATCH] D71976: Match code following lambdas when ignoring invisible nodes

2019-12-31 Thread Stephen Kelly via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd89c4cb93807: Match code following lambdas when ignoring invisible nodes (authored by stephenkelly). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71976/new/

[PATCH] D71977: Implement additional traverse() overloads

2019-12-31 Thread Stephen Kelly via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG69bb99914f35: Implement additional traverse() overloads (authored by stephenkelly). Changed prior to commit: https://reviews.llvm.org/D71977?vs=235520&id=235719#toc Repository: rG LLVM Github Monorep

[PATCH] D72531: Set traversal explicitly where needed in tests

2020-01-10 Thread Stephen Kelly via Phabricator via cfe-commits
steveire created this revision. steveire added a reviewer: aaron.ballman. Herald added a reviewer: shafik. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D72531 Files: clang/unittests/AST/ASTImporterTest.cpp

[PATCH] D72532: Make the ExprMutationAnalyzer explicit about how it traverses the AST

2020-01-10 Thread Stephen Kelly via Phabricator via cfe-commits
steveire created this revision. steveire added a reviewer: aaron.ballman. Herald added subscribers: cfe-commits, dkrupp, donat.nagy, Szelethus, a.sidorin, baloghadamsoftware. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D72532 Files: clang/lib/

[PATCH] D72530: Set traversal explicitly where needed in clang-tidy

2020-01-10 Thread Stephen Kelly via Phabricator via cfe-commits
steveire created this revision. steveire added a reviewer: aaron.ballman. Herald added subscribers: cfe-commits, arphaman, kbarton, nemanjai. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D72530 Files: clang-tools-extra/clang-tidy/abseil/Duration

[PATCH] D72534: Change default traversal in AST Matchers to ignore invisible nodes

2020-01-10 Thread Stephen Kelly via Phabricator via cfe-commits
steveire created this revision. steveire added a reviewer: aaron.ballman. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D72534 Files: clang/include/clang/AST/ASTContext.h Index: clang/include/clang/AST/AS

[PATCH] D72233: Add a new AST matcher 'optionally'.

2020-01-10 Thread Stephen Kelly via Phabricator via cfe-commits
steveire added a comment. LGTM too. I described a more ad-hoc implementation previously: https://steveire.wordpress.com/2018/11/20/composing-ast-matchers-in-clang-tidy/ but I prefer this implementation. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72233/new/ https://reviews.llvm.org/

[PATCH] D72531: Set traversal explicitly where needed in tests

2020-01-10 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 237418. steveire added a comment. Fix case Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72531/new/ https://reviews.llvm.org/D72531 Files: clang/unittests/AST/ASTImporterTest.cpp clang/unittests/AST/Sourc

[PATCH] D72530: Set traversal explicitly where needed in clang-tidy

2020-01-10 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 237417. steveire added a comment. Fix case Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72530/new/ https://reviews.llvm.org/D72530 Files: clang-tools-extra/clang-tidy/abseil/DurationDivisionCheck.cpp cla

[PATCH] D93164: [AST] Add generator for source location introspection

2020-12-12 Thread Stephen Kelly via Phabricator via cfe-commits
steveire created this revision. steveire added reviewers: aaron.ballman, njames93. Herald added a subscriber: mgorny. steveire requested review of this revision. Herald added a reviewer: jdoerfert. Herald added subscribers: cfe-commits, sstefan1. Herald added a project: clang. Generate a json file

[PATCH] D93164: [AST] Add generator for source location introspection

2020-12-12 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 311398. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93164/new/ https://reviews.llvm.org/D93164 Files: clang/lib/Tooling/CMakeLists.txt clang/lib/Tooling/DumpTool/APIData

[PATCH] D93244: Remove the ast_type_traits namespace.

2020-12-14 Thread Stephen Kelly via Phabricator via cfe-commits
steveire accepted this revision. steveire added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93244/new/ https://reviews.llvm.org/D93244 _

[PATCH] D93324: Avoid isImplicit call on object which could be nullptr

2020-12-15 Thread Stephen Kelly via Phabricator via cfe-commits
steveire created this revision. steveire added a reviewer: aaron.ballman. steveire requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. A callExpr whose argument is dependent has a null getCalleeDecl(). Repository: rG LLVM Github Monorepo h

[PATCH] D93325: Add srcloc output to clang-query

2020-12-15 Thread Stephen Kelly via Phabricator via cfe-commits
steveire created this revision. steveire added a reviewer: aaron.ballman. steveire requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D93325 Files: clang-tools-extra/clang-quer

[PATCH] D93164: [AST] Add generator for source location introspection

2020-12-15 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 312023. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93164/new/ https://reviews.llvm.org/D93164 Files: clang/lib/Tooling/CMakeLists.txt clang/lib/Tooling/DumpTool/APIData

[PATCH] D93164: [AST] Add generator for source location introspection

2020-12-15 Thread Stephen Kelly via Phabricator via cfe-commits
steveire added a comment. > Do I understand correctly that the workflow is to use the new dumping tool to > generate the needed JSON file that then gets used as input to > generate_cxx_src_locs.py which creates NodeLocationIntrospection.cpp/.h that > then gets used by clang-query (eventually)?

[PATCH] D93164: [AST] Add generator for source location introspection

2020-12-15 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 312024. steveire marked 19 inline comments as done. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93164/new/ https://reviews.llvm.org/D93164 Files: clang/lib/Tooling/CMakeLi

[PATCH] D93164: [AST] Add generator for source location introspection

2020-12-15 Thread Stephen Kelly via Phabricator via cfe-commits
steveire marked 3 inline comments as done. steveire added inline comments. Comment at: clang/lib/Tooling/DumpTool/ASTSrcLocProcessor.cpp:40 + // TODO: Extend this with other clades + namedDecl(hasName("clang::Stmt")).bind("nodeClade")), + option

[PATCH] D93164: [AST] Add generator for source location introspection

2020-12-15 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 312026. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93164/new/ https://reviews.llvm.org/D93164 Files: clang/lib/Tooling/CMakeLists.txt clang/lib/Tooling/DumpTool/APIData

[PATCH] D93164: [AST] Add generator for source location introspection

2020-12-15 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 312027. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93164/new/ https://reviews.llvm.org/D93164 Files: clang/lib/Tooling/CMakeLists.txt clang/lib/Tooling/DumpTool/APIData

[PATCH] D93164: [AST] Add generator for source location introspection

2020-12-15 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 312033. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93164/new/ https://reviews.llvm.org/D93164 Files: clang/lib/Tooling/CMakeLists.txt clang/lib/Tooling/DumpTool/APIData

[PATCH] D93164: [AST] Add generator for source location introspection

2020-12-15 Thread Stephen Kelly via Phabricator via cfe-commits
steveire added a subscriber: thakis. steveire added a comment. @thakis FYI - I think the GN build would need to be adapted to this. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93164/new/ https://reviews.llvm.org/D93164 __

[PATCH] D93164: [AST] Add generator for source location introspection

2020-12-15 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 312039. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93164/new/ https://reviews.llvm.org/D93164 Files: clang/lib/Tooling/CMakeLists.txt clang/lib/Tooling/DumpTool/APIData

[PATCH] D93324: Avoid isImplicit call on object which could be nullptr

2020-12-15 Thread Stephen Kelly via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG702f822ca5bb: [ASTMatcher] Avoid isImplicit call on object which could be nullptr (authored by stephenkelly). Repository: rG LLVM Github Monorepo

[PATCH] D80623: WIP: Add an API to simplify setting TraversalKind in clang-tidy matchers

2020-12-15 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 312062. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80623/new/ https://reviews.llvm.org/D80623 Files: clang/include/clang/ASTMatchers/ASTMatchFinder.h clang/lib/ASTMatch

[PATCH] D91302: Handle template instantiations better in clang-tidy check

2020-12-15 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 312063. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91302/new/ https://reviews.llvm.org/D91302 Files: clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp

[PATCH] D91302: Handle template instantiations better in clang-tidy check

2020-12-15 Thread Stephen Kelly via Phabricator via cfe-commits
steveire added inline comments. Comment at: clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp:20 +namespace ast_matchers { +AST_POLYMORPHIC_MATCHER_P2(hasAnyArgumentWithParam, + AST_POLYMORPHIC_SUPPORTED_TYPES(CallExpr, --

[PATCH] D91302: Handle template instantiations better in clang-tidy check

2020-12-15 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 312071. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91302/new/ https://reviews.llvm.org/D91302 Files: clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp

[PATCH] D93596: [ASTMatchers] Traverse-ignore range-for implementation details

2020-12-20 Thread Stephen Kelly via Phabricator via cfe-commits
steveire created this revision. steveire added a reviewer: aaron.ballman. steveire requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D93596 Files: clang/lib/ASTMatchers/ASTMat

[PATCH] D93596: [ASTMatchers] Traverse-ignore range-for implementation details

2020-12-21 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 313205. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93596/new/ https://reviews.llvm.org/D93596 Files: clang/include/clang/AST/RecursiveASTVisitor.h clang/lib/ASTMatchers

[PATCH] D93596: [ASTMatchers] Traverse-ignore range-for implementation details

2020-12-22 Thread Stephen Kelly via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG3b879fc97305: [ASTMatchers] Traverse-ignore range-for implementation details (authored by stephenkelly). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93596/

[PATCH] D93688: [ASTMatchers] Ensure that we can match inside lambdas

2020-12-22 Thread Stephen Kelly via Phabricator via cfe-commits
steveire created this revision. steveire added a reviewer: aaron.ballman. steveire requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Because we don't know in ASTMatchFinder whether we're matching in AsIs or IgnoreUnlessSpelledInSource mode, w

[PATCH] D93688: [ASTMatchers] Ensure that we can match inside lambdas

2020-12-22 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 313296. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93688/new/ https://reviews.llvm.org/D93688 Files: clang/include/clang/ASTMatchers/ASTMatchersInternal.h clang/lib/AST

[PATCH] D91302: Handle template instantiations better in clang-tidy check

2020-12-22 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 313346. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91302/new/ https://reviews.llvm.org/D91302 Files: clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp

[PATCH] D91302: Handle template instantiations better in clang-tidy check

2020-12-22 Thread Stephen Kelly via Phabricator via cfe-commits
steveire marked 2 inline comments as done. steveire added inline comments. Comment at: clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp:26-28 + // The first argument of an overloaded member operator is the implicit object + // argument of the method which s

[PATCH] D91302: Handle template instantiations better in clang-tidy check

2020-12-22 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 313354. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91302/new/ https://reviews.llvm.org/D91302 Files: clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp

[PATCH] D80623: WIP: Add an API to simplify setting TraversalKind in clang-tidy matchers

2020-12-22 Thread Stephen Kelly via Phabricator via cfe-commits
steveire added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchFinder.h:118 +/// behavior of clang-tidy. +virtual llvm::Optional +getCheckTraversalKind() const; aaron.ballman wrote: > steveire wrote: > > sammccall wrote: > > > I d

[PATCH] D91302: Handle template instantiations better in clang-tidy check

2020-12-22 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 313360. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91302/new/ https://reviews.llvm.org/D91302 Files: clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp

[PATCH] D91302: Handle template instantiations better in clang-tidy check

2020-12-22 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 313361. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91302/new/ https://reviews.llvm.org/D91302 Files: clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp

[PATCH] D91303: Simplify implementation of container-size-empty

2020-12-22 Thread Stephen Kelly via Phabricator via cfe-commits
steveire added inline comments. Comment at: clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp:56 - hasEitherOperand(ignoringImpCasts( - anyOf(integerLiteral(equals(1)), -

[PATCH] D91303: Simplify implementation of container-size-empty

2020-12-22 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 313370. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91303/new/ https://reviews.llvm.org/D91303 Files: clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp

[PATCH] D91303: [clang-tidy] readability-container-size-empty: simplify implementation

2020-12-22 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 313381. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91303/new/ https://reviews.llvm.org/D91303 Files: clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp

[PATCH] D91302: Handle template instantiations better in clang-tidy check

2020-12-22 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 313385. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91302/new/ https://reviews.llvm.org/D91302 Files: clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp

[PATCH] D80623: WIP: Add an API to simplify setting TraversalKind in clang-tidy matchers

2020-12-22 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 313386. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80623/new/ https://reviews.llvm.org/D80623 Files: clang/include/clang/ASTMatchers/ASTMatchFinder.h clang/lib/ASTMatch

[PATCH] D80623: WIP: Add an API to simplify setting TraversalKind in clang-tidy matchers

2020-12-22 Thread Stephen Kelly via Phabricator via cfe-commits
steveire added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchFinder.h:118 +/// behavior of clang-tidy. +virtual llvm::Optional +getCheckTraversalKind() const; aaron.ballman wrote: > steveire wrote: > > aaron.ballman wrote: > > >

[PATCH] D91302: Handle template instantiations better in clang-tidy check

2020-12-22 Thread Stephen Kelly via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGa5311d731e1b: [clang-tidy] Handle template instantiations in conta

[PATCH] D91302: Handle template instantiations better in clang-tidy check

2020-12-22 Thread Stephen Kelly via Phabricator via cfe-commits
steveire added a comment. In D91302#2468665 , @thakis wrote: > Looks like this breaks tests on windows: > http://45.33.8.238/win/30322/step_8.txt > > Ptal, and revert for now if it takes a while to fix. (In particular, prefer > reverting over disabling t

[PATCH] D90763: Traverse-ignore explicit template instantiations

2020-11-04 Thread Stephen Kelly via Phabricator via cfe-commits
steveire created this revision. steveire added a reviewer: aaron.ballman. Herald added a project: clang. Herald added a subscriber: cfe-commits. steveire requested review of this revision. Continue to dump and match on explicit template specializations, but omit explicit instantiation declarations

[PATCH] D90767: Add new matchers for dependent names in templates

2020-11-04 Thread Stephen Kelly via Phabricator via cfe-commits
steveire created this revision. steveire added a reviewer: aaron.ballman. Herald added a project: clang. Herald added a subscriber: cfe-commits. steveire requested review of this revision. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D90767 Files: clang/docs/LibASTMatchersRef

[PATCH] D90767: Add new matchers for dependent names in templates

2020-11-04 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 302852. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90767/new/ https://reviews.llvm.org/D90767 Files: clang/docs/LibASTMatchersReference.html clang/include/clang/ASTMatc

[PATCH] D90763: Traverse-ignore explicit template instantiations

2020-11-05 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 303268. steveire added a comment. Uppate Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90763/new/ https://reviews.llvm.org/D90763 Files: clang/include/clang/AST/ASTNodeTraverser.h clang/include/clang/ASTM

[PATCH] D90763: Traverse-ignore explicit template instantiations

2020-11-05 Thread Stephen Kelly via Phabricator via cfe-commits
steveire marked 2 inline comments as done. steveire added inline comments. Comment at: clang/unittests/AST/ASTTraverserTest.cpp:1092 + +// Explicit instantiation of template functions do not appear in the AST +template float timesTwo(float); aaron.ballman wrote:

[PATCH] D90763: Traverse-ignore explicit template instantiations

2020-11-05 Thread Stephen Kelly via Phabricator via cfe-commits
steveire added inline comments. Comment at: clang/lib/ASTMatchers/ASTMatchFinder.cpp:506 +if (const auto *CTSD = Node.get()) { + auto SK = CTSD->getSpecializationKind(); + if (SK == TSK_ExplicitInstantiationDeclaration || aaron.ballman wrote: > Same

[PATCH] D90767: Add new matchers for dependent names in templates

2020-11-05 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 303271. steveire marked an inline comment as done. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90767/new/ https://reviews.llvm.org/D90767 Files: clang/docs/LibASTMatchersR

[PATCH] D90767: Add new matchers for dependent names in templates

2020-11-05 Thread Stephen Kelly via Phabricator via cfe-commits
steveire added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:2859 +AST_MATCHER_P(CXXDependentScopeMemberExpr, hasMemberName, std::string, N) { + return Node.getMember().getAsString() == N; +} aaron.ballman wrote: > This will allow us

[PATCH] D90763: Traverse-ignore explicit template instantiations

2020-11-06 Thread Stephen Kelly via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG7efe07a12b69: Traverse-ignore explicit template instantiations (authored by stephenkelly). Changed prior to commit: https://reviews.llvm.org/D9076

[PATCH] D90767: Add new matchers for dependent names in templates

2020-11-06 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 303462. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90767/new/ https://reviews.llvm.org/D90767 Files: clang/docs/LibASTMatchersReference.html clang/include/clang/ASTMatc

[PATCH] D90767: Add new matchers for dependent names in templates

2020-11-06 Thread Stephen Kelly via Phabricator via cfe-commits
steveire added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:2859 +AST_MATCHER_P(CXXDependentScopeMemberExpr, hasMemberName, std::string, N) { + return Node.getMember().getAsString() == N; +} aaron.ballman wrote: > steveire wrote: >

[PATCH] D90767: Add new matchers for dependent names in templates

2020-11-06 Thread Stephen Kelly via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG0d6e1251d79d: Add new matchers for dependent names in templates (authored by stephenkelly). Changed prior to commit: https://reviews.llvm.org/D907

[PATCH] D90982: Ignore implicit nodes in IgnoreUnlessSpelledInSource mode

2020-11-06 Thread Stephen Kelly via Phabricator via cfe-commits
steveire created this revision. steveire added a reviewer: aaron.ballman. Herald added a project: clang. Herald added a subscriber: cfe-commits. steveire requested review of this revision. Update the ASTNodeTraverser to dump only nodes spelled in source. There are only a few which need to be hand

[PATCH] D90983: Change algorithms to return iterators

2020-11-06 Thread Stephen Kelly via Phabricator via cfe-commits
steveire created this revision. steveire added a reviewer: aaron.ballman. Herald added a project: clang. Herald added a subscriber: cfe-commits. steveire requested review of this revision. Make it possible to inspect the matched node, possibly to ignore it. Repository: rG LLVM Github Monorepo

[PATCH] D90984: Update matchers to be traverse-aware

2020-11-06 Thread Stephen Kelly via Phabricator via cfe-commits
steveire created this revision. steveire added a reviewer: aaron.ballman. Herald added a project: clang. Herald added a subscriber: cfe-commits. steveire requested review of this revision. Don't match Stmt or Decl nodes not spelled in the source when using TK_IgnoreUnlessSpelledInSource. This pre

[PATCH] D90392: [clang-tidy] Omit std::make_unique/make_shared for default initialization.

2020-11-07 Thread Stephen Kelly via Phabricator via cfe-commits
steveire added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize-make-shared.cpp:51 // CHECK-FIXES: std::shared_ptr P1 = std::make_shared(); + std::shared_ptr P2 = std::shared_ptr(new int); I'm a bit confused. Why don't we w

[PATCH] D90982: Ignore implicit nodes in IgnoreUnlessSpelledInSource mode

2020-11-07 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 303679. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90982/new/ https://reviews.llvm.org/D90982 Files: clang/include/clang/AST/ASTNodeTraverser.h clang/include/clang/ASTM

[PATCH] D90982: Ignore implicit nodes in IgnoreUnlessSpelledInSource mode

2020-11-07 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 303682. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90982/new/ https://reviews.llvm.org/D90982 Files: clang/include/clang/AST/ASTNodeTraverser.h clang/include/clang/ASTM

[PATCH] D90392: [clang-tidy] Omit std::make_unique/make_shared for default initialization.

2020-11-08 Thread Stephen Kelly via Phabricator via cfe-commits
steveire added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize-make-shared.cpp:51 // CHECK-FIXES: std::shared_ptr P1 = std::make_shared(); + std::shared_ptr P2 = std::shared_ptr(new int); ckennelly wrote: > steveire wrote:

[PATCH] D90982: Ignore implicit nodes in IgnoreUnlessSpelledInSource mode

2020-11-08 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 303728. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90982/new/ https://reviews.llvm.org/D90982 Files: clang/include/clang/AST/ASTNodeTraverser.h clang/include/clang/ASTM

[PATCH] D90983: Change algorithms to return iterators

2020-11-09 Thread Stephen Kelly via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG8f354711ae92: Change algorithms to return iterators (authored by stephenkelly). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION h

[PATCH] D91144: Add utility for testing if we're matching nodes AsIs

2020-11-10 Thread Stephen Kelly via Phabricator via cfe-commits
steveire created this revision. steveire added a reviewer: aaron.ballman. Herald added a project: clang. Herald added a subscriber: cfe-commits. steveire requested review of this revision. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D91144 Files: clang/include/clang/ASTMatch

[PATCH] D90982: Ignore implicit nodes in IgnoreUnlessSpelledInSource mode

2020-11-10 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 304103. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90982/new/ https://reviews.llvm.org/D90982 Files: clang/docs/ReleaseNotes.rst clang/include/clang/AST/ASTNodeTraverse

[PATCH] D90984: Update matchers to be traverse-aware

2020-11-10 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 304104. steveire marked an inline comment as done. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90984/new/ https://reviews.llvm.org/D90984 Files: clang/include/clang/ASTMat

[PATCH] D90984: Update matchers to be traverse-aware

2020-11-10 Thread Stephen Kelly via Phabricator via cfe-commits
steveire added a comment. I added the release note to D90982 , which this change follows. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:3115 + + if (Finder->getASTContext().getParentMapContext().getTraversalKind() != + TK_

[PATCH] D91144: Add utility for testing if we're matching nodes AsIs

2020-11-10 Thread Stephen Kelly via Phabricator via cfe-commits
steveire added inline comments. Comment at: clang/lib/ASTMatchers/ASTMatchersInternal.cpp:195 +bool ASTMatchFinder::isTraversalAsIs() const { + return getASTContext().getParentMapContext().getTraversalKind() == TK_AsIs; +} aaron.ballman wrote: > I don't insist,

[PATCH] D91144: Add utility for testing if we're matching nodes AsIs

2020-11-10 Thread Stephen Kelly via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGe73296d3b92f: Add utility for testing if we're matching nodes AsIs (authored by stephenkelly). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D90984: Update matchers to be traverse-aware

2020-11-10 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 304298. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90984/new/ https://reviews.llvm.org/D90984 Files: clang/include/clang/ASTMatchers/ASTMatchers.h clang/include/clang/A

[PATCH] D90984: Update matchers to be traverse-aware

2020-11-10 Thread Stephen Kelly via Phabricator via cfe-commits
steveire added inline comments. Comment at: clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp:2368 NonTrivial m_nt; - HasCtorInits() : NoSpecialMethods(), m_i(42) {} }; aaron.ballman wrote: > Was this originally testing behavior with explicitly initia

[PATCH] D91302: Handle template instantiations better in clang-tidy check

2020-11-11 Thread Stephen Kelly via Phabricator via cfe-commits
steveire created this revision. steveire added a reviewer: alexfh. Herald added a project: clang. Herald added a subscriber: cfe-commits. steveire requested review of this revision. readability-container-size-empty currently modifies source code based on AST nodes in template instantiations, which

[PATCH] D91303: Simplify implementation of container-size-empty

2020-11-11 Thread Stephen Kelly via Phabricator via cfe-commits
steveire created this revision. steveire added a reviewer: alexfh. Herald added a project: clang. Herald added a subscriber: cfe-commits. steveire requested review of this revision. Use IgnoreUnlessSpelledInSource to make the matcher code smaller and more visibly-related to the code. Repository:

[PATCH] D90984: Update matchers to be traverse-aware

2020-11-16 Thread Stephen Kelly via Phabricator via cfe-commits
steveire added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:3115 + + if (!Finder->isTraversalAsIs() && (*MatchIt)->isImplicit()) +return false; aaron.ballman wrote: > If the traversal is not `AsIs`, that doesn't mean it's > `Ig

[PATCH] D90982: Ignore implicit nodes in IgnoreUnlessSpelledInSource mode

2020-11-17 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 305767. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90982/new/ https://reviews.llvm.org/D90982 Files: clang/docs/ReleaseNotes.rst clang/include/clang/AST/ASTNodeTraverse

[PATCH] D90984: Update matchers to be traverse-aware

2020-11-17 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 305768. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90984/new/ https://reviews.llvm.org/D90984 Files: clang/include/clang/ASTMatchers/ASTMatchers.h clang/include/clang/A

[PATCH] D80499: Remove obsolete ignore*() matcher uses

2020-11-17 Thread Stephen Kelly via Phabricator via cfe-commits
steveire added a comment. In D80499#2362028 , @steveire wrote: >> ! In D80499#2353187 , @alexfh wrote: >> You should be ready for back and forth with this change, if users hit >> widespread issues not caught by te

[PATCH] D90984: Update matchers to be traverse-aware

2020-11-17 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 305777. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90984/new/ https://reviews.llvm.org/D90984 Files: clang/include/clang/ASTMatchers/ASTMatchers.h clang/include/clang/A

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