[PATCH] D120949: [clang][AST matchers] adding attributedStmt AST matcher

2022-03-25 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon updated this revision to Diff 418338. ajohnson-uoregon added a comment. I overloaded hasAttr and had to fix a couple CUDA tests to explicitly use the decl overload (the other tests for hasAttr did this already, so I think it was just a mistake in those tests). I also had to rem

[PATCH] D120949: [clang][AST matchers] adding attributedStmt AST matcher

2022-03-25 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon updated this revision to Diff 418341. ajohnson-uoregon added a comment. updating commit message of last commit to be more accurate Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120949/new/ https://reviews.llvm.org/D120949 Files:

[PATCH] D120956: [clang][AST matchers] new AST matcher argumentsGivenCountIs(n) that checks the actual number of arguments given in a function call

2022-03-25 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon updated this revision to Diff 418346. ajohnson-uoregon added a comment. Fixing name of matcher and formatting, still need tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120956/new/ https://reviews.llvm.org/D120956 Files: cl

[PATCH] D120949: [clang][AST matchers] adding attributedStmt AST matcher

2022-03-30 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon updated this revision to Diff 419248. ajohnson-uoregon added a comment. Okay, I put the assert back in and made a thing similar to HasSizeMatcher that works and all the tests pass. What do you mean by a release note, in the commit message, in the docs...? Repository: rG LLVM

[PATCH] D120952: [clang][AST matchers] adding submatchers under cudaKernelCallExpr to match kernel launch config

2022-03-30 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon updated this revision to Diff 419252. ajohnson-uoregon added a comment. Removing specific argument matchers and leaving just hasKernelConfig() Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120952/new/ https://reviews.llvm.org/D1209

[PATCH] D120949: [clang][AST matchers] adding attributedStmt AST matcher

2022-03-08 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon updated this revision to Diff 413962. ajohnson-uoregon added a comment. Figuring out git-clang-format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120949/new/ https://reviews.llvm.org/D120949 Files: clang/docs/LibASTMatchersRef

[PATCH] D120949: [clang][AST matchers] adding attributedStmt AST matcher

2022-03-14 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:2733 +/// \endcode +AST_MATCHER_P(AttributedStmt, isAttr, attr::Kind, AttrKind) { + return llvm::any_of(Node.getAttrs(), aaron.ballman wrote: > sammccall wrote: > >

[PATCH] D120949: [clang][AST matchers] adding attributedStmt AST matcher

2022-03-14 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon added a comment. (.. I just figured out where the 'submit' button is. My comment on 2713-2714 is from like, 5 days ago. Oops. 🙃 ) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120949/new/ https://reviews.llvm.org/D120949

[PATCH] D120952: [clang][AST matchers] adding submatchers under cudaKernelCallExpr to match kernel launch config

2022-03-14 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon updated this revision to Diff 415289. ajohnson-uoregon added a comment. fixing clang-format things and adding docs; also making docs a bit more clear Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120952/new/ https://reviews.llvm.or

[PATCH] D120952: [clang][AST matchers] adding submatchers under cudaKernelCallExpr to match kernel launch config

2022-03-14 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon added a comment. I still need to write tests but: I do have a use case for these over here: https://github.com/ajohnson-uoregon/llvm-project/blob/feature-ajohnson/clang-tools-extra/clang-rewrite/ConstructMatchers.cpp#L472 tl;dr, we'd like to match the kernel launch arguments (i

[PATCH] D120952: [clang][AST matchers] adding submatchers under cudaKernelCallExpr to match kernel launch config

2022-03-15 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon added a comment. For the specific argument matchers (`cudaBlockDim()`, `cudaStream()`, etc), I agree, I'm not sure if there's any other use cases in tree. I wasn't aware you could write local definitions like that, I could definitely do that within my project for those. I woul

[PATCH] D120956: [clang][AST matchers] new AST matcher argumentsGivenCountIs(n) that checks the actual number of arguments given in a function call

2022-03-15 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon added a comment. This is the same use case as my other patches :) https://github.com/ajohnson-uoregon/llvm-project/blob/feature-ajohnson/clang-tools-extra/clang-rewrite/ConstructMatchers.cpp#L545 If there's a function with default arguments, and our user doesn't specify some of

[PATCH] D120956: [clang][AST matchers] new AST matcher argumentsGivenCountIs(n) that checks the actual number of arguments given in a function call

2022-03-15 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:4452 +/// \endcode +AST_POLYMORPHIC_MATCHER_P(argumentsGivenCountIs, + AST_POLYMORPHIC_SUPPORTED_TYPES( aaron.ballman wrote: > I have a pref

[PATCH] D120959: [clang][AST matchers] new hasExpectedReturnType submatcher for ReturnStmts

2022-03-15 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon added a comment. This is our use case: https://github.com/ajohnson-uoregon/llvm-project/blob/feature-ajohnson/clang-tools-extra/clang-rewrite/MatcherGenCallback.h#L365 I'm not sure if anyone else would want to use this, but it feels like it could be generally useful. Now that

[PATCH] D107503: [clang][Rewriter] patch to fix bug with ReplaceText erasing too many characters when text has been inserted before the replace location. See https://llvm.discourse.group/t/possible-bu

2021-08-04 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon created this revision. ajohnson-uoregon added reviewers: jdoerfert, rsmith, klimek. ajohnson-uoregon requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. ...-rewriterope/3970 [clang][Rewriter] split test for replace after inser

[PATCH] D107503: [clang][Rewriter] patch to fix bug with ReplaceText erasing too many characters when text has been inserted before the replace location.

2021-08-04 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon updated this revision to Diff 364282. ajohnson-uoregon retitled this revision from "[clang][Rewriter] patch to fix bug with ReplaceText erasing too many characters when text has been inserted before the replace location. " to "[clang][Rewriter] patch to fix bug with ReplaceText

[PATCH] D107503: [clang][Rewriter] patch to fix bug with ReplaceText erasing too many characters when text has been inserted before the replace location.

2021-08-04 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon updated this revision to Diff 364283. ajohnson-uoregon added a comment. making patch happy??? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107503/new/ https://reviews.llvm.org/D107503 Files: clang/include/clang/Rewrite/Core/Rew

[PATCH] D120949: [clang][AST matchers] adding hasSubStmt matcher under attributedStmt so we can actually match the stmt inside the attribute is attached to

2022-03-03 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon created this revision. Herald added a project: All. ajohnson-uoregon requested review of this revision. Herald added projects: clang, clang-tools-extra. Herald added a subscriber: cfe-commits. fixing to use new [[clang::matcher_block]] attr and clean up some old code; currently i

[PATCH] D120949: [clang][AST matchers] adding hasSubStmt matcher under attributedStmt so we can actually match the stmt inside the attribute is attached to

2022-03-03 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon updated this revision to Diff 412871. ajohnson-uoregon added a comment. Herald added a reviewer: aaron.ballman. Fixing to actually have the right commits Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120949/new/ https://reviews.llv

[PATCH] D120949: [clang][AST matchers] adding attributedStmt AST matcher

2022-03-03 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon updated this revision to Diff 412873. ajohnson-uoregon added a comment. Still doesn't have right files/commits Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120949/new/ https://reviews.llvm.org/D120949 Files: clang/include/clang

[PATCH] D120949: [clang][AST matchers] adding attributedStmt AST matcher

2022-03-03 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon updated this revision to Diff 412875. ajohnson-uoregon added a comment. Still trying to get right commits, apologies XD Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120949/new/ https://reviews.llvm.org/D120949 Files: clang-tool

[PATCH] D120949: [clang][AST matchers] adding attributedStmt AST matcher

2022-03-03 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon updated this revision to Diff 412877. ajohnson-uoregon added a comment. updated resolution rules to try to get right commits Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120949/new/ https://reviews.llvm.org/D120949 Files: clang

[PATCH] D120949: [clang][AST matchers] adding attributedStmt AST matcher

2022-03-03 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon updated this revision to Diff 412878. ajohnson-uoregon added a comment. arcanist why Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120949/new/ https://reviews.llvm.org/D120949 Files: clang/include/clang/ASTMatchers/ASTMatchers.h

[PATCH] D120949: [clang][AST matchers] adding attributedStmt AST matcher

2022-03-03 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon updated this revision to Diff 412879. ajohnson-uoregon added a comment. Herald added a reviewer: aaron.ballman. maybe this will work Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120949/new/ https://reviews.llvm.org/D120949 Files:

[PATCH] D120949: [clang][AST matchers] adding attributedStmt AST matcher

2022-03-03 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon updated this revision to Diff 412882. ajohnson-uoregon added a comment. had to split a commit because past me messed up Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120949/new/ https://reviews.llvm.org/D120949 Files: clang-tool

[PATCH] D120949: [clang][AST matchers] adding attributedStmt AST matcher

2022-03-03 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon updated this revision to Diff 412883. ajohnson-uoregon added a comment. getting the commit range right, finally Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120949/new/ https://reviews.llvm.org/D120949 Files: clang/include/clan

[PATCH] D120949: [clang][AST matchers] adding attributedStmt AST matcher

2022-03-03 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon added a comment. Okay this is actually the right commits now, sorry about the spam, Aaron. 🙃 Didn't realize I'd put unrelated things in the first commit. The names for isAttr and hasSubStmt are up for debate, I just picked things that were close enough and weren't already in us

[PATCH] D120952: [clang][AST matchers] adding submatchers under cudaKernelCallExpr to match kernel launch config

2022-03-03 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon created this revision. ajohnson-uoregon added reviewers: klimek, jdoerfert. Herald added a subscriber: yaxunl. Herald added a project: All. ajohnson-uoregon requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. adding more AST ma

[PATCH] D120954: adding a check that the number of arguments given in the matcher is the same as the number of arguments in the matched code

2022-03-03 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon created this revision. Herald added a project: All. ajohnson-uoregon requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D120954 Files: clang-tools-

[PATCH] D120956: [clang][AST matchers] new AST matcher argumentsGivenCountIs(n) that checks the actual number of arguments given in a function call

2022-03-03 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon created this revision. ajohnson-uoregon added reviewers: klimek, jdoerfert. Herald added a project: All. ajohnson-uoregon requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. new AST matcher that checks the actual number of argu

[PATCH] D120959: [clang][AST matchers] new hasExpectedReturnType submatcher for ReturnStmts

2022-03-03 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon created this revision. ajohnson-uoregon added reviewers: klimek, jdoerfert. Herald added a project: All. ajohnson-uoregon requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. new AST matcher that matches the expected return type

[PATCH] D120954: adding a check that the number of arguments given in the matcher is the same as the number of arguments in the matched code

2022-03-03 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon abandoned this revision. ajohnson-uoregon added a comment. created by accident Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120954/new/ https://reviews.llvm.org/D120954 ___ cfe-commits

[PATCH] D120949: [clang][AST matchers] adding attributedStmt AST matcher

2022-03-03 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon updated this revision to Diff 412901. ajohnson-uoregon added a comment. making clang-format happy Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120949/new/ https://reviews.llvm.org/D120949 Files: clang/include/clang/ASTMatchers/

[PATCH] D120949: [clang][AST matchers] adding attributedStmt AST matcher

2022-03-07 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon updated this revision to Diff 413691. ajohnson-uoregon marked 5 inline comments as done. ajohnson-uoregon added a comment. update with fixes from Aaron, tests, and docs Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120949/new/ http

[PATCH] D120949: [clang][AST matchers] adding attributedStmt AST matcher

2022-03-07 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon updated this revision to Diff 413693. ajohnson-uoregon added a comment. Actually has the right doc updates now Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120949/new/ https://reviews.llvm.org/D120949 Files: clang/docs/LibASTMa

[PATCH] D120949: [clang][AST matchers] adding attributedStmt AST matcher

2022-03-07 Thread Alister Johnson via Phabricator via cfe-commits
ajohnson-uoregon updated this revision to Diff 413696. ajohnson-uoregon added a comment. Somehow got other edits into ASTMatcher.h, dunno how, it's fixed now Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120949/new/ https://reviews.llvm.org/D120949