[PATCH] D128103: Adds AST Matcher for ObjCStringLiteral

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 28 07:44:44 PDT 2022


aaron.ballman added a reviewer: aaron.ballman.
aaron.ballman added a comment.

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.



================
Comment at: clang/docs/LibASTMatchersReference.html:2038
 
+<tr><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('stringLiteral0')"><a name="stringLiteral0Anchor">objcStringLiteral</a></td><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1ObjCStringLiteral.html">ObjCStringLiteral</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="stringLiteral0"><pre>Matches objective-C string literals.
----------------
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.


================
Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:1518-1519
 
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, ObjCStringLiteral>
+    objcStringLiteral;
+
----------------
You should add your documentation comments above this declaration.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128103/new/

https://reviews.llvm.org/D128103



More information about the cfe-commits mailing list