Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Matcher tests are written as unittests in unittests/ASTMatchers, I don't think you need to make an entire new check for that hmmm.
Looks great, thanks!
clang/docs/LibASTMatchersReference.html | ||
---|---|---|
2041 | I think it's more appropriate for this documentation to mention the entire literal so that the reader didn't assume that @ is a different AST node that needs to be captured separately. |
We typically don't add AST matchers until we have a need for them to be used in-tree (ASTMatchers.h is already really expensive to parse; adding matchers for everything possible with AST nodes would be prohibitively expensive). However, this is a case that really seems like it doesn't need to wait for an in-tree use because of how foundational the matcher is, so I think it's fine to add as-is.
clang/docs/LibASTMatchersReference.html | ||
---|---|---|
2038 | It looks like this documentation was added manually -- it should actually live in the ASTMatchers.h header file, and then you run clang/docs/tools/dump_ast_matchers.py to generate this HTML file automatically. | |
clang/include/clang/ASTMatchers/ASTMatchers.h | ||
1518–1519 | You should add your documentation comments above this declaration. |
Yes the use case is coming up in D126097; it's not used yet because hasDescendant(StringLiteral) is used to skip it but this matchert would be a more precise solution (yes there's an actual StringLiteral inside ObjCStringLiteral).
The only things left to do are: regenerate the documentation by running clang/docs/tools/dump_ast_matchers.py and add a release note for the new matcher, but otherwise this looks good to me.
Ah, great to hear this will be used quickly in tree too!
LGTM! Do you need me to commit on your behalf? If so, what name and email address would you like me to use for patch attribution?
Thank you @aaron.ballman. I believe I have the permissions to commit, so I can land the patch.
It looks like this documentation was added manually -- it should actually live in the ASTMatchers.h header file, and then you run clang/docs/tools/dump_ast_matchers.py to generate this HTML file automatically.