[PATCH] D17446: ASTMatchers: add new statement/decl matchers

Richard via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 22 10:07:04 PST 2016


LegalizeAdulthood added a subscriber: LegalizeAdulthood.

================
Comment at: docs/LibASTMatchersReference.html:512
@@ +511,3 @@
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('addrLabelExpr0')"><a name="addrLabelExpr0Anchor">addrLabelExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1AddrLabelExpr.html">AddrLabelExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="addrLabelExpr0"><pre>Matches address of label statements (GNU extension).
+
----------------
Can we put `gnu` in the name of matchers that only match GNU extensions?

================
Comment at: docs/LibASTMatchersReference.html:544
@@ +543,3 @@
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('atomicExpr0')"><a name="atomicExpr0Anchor">atomicExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1AtomicExpr.html">AtomicExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="atomicExpr0"><pre>Matches atomic builtins.
+</pre></td></tr>
----------------
Please provide an example here.

================
Comment at: docs/LibASTMatchersReference.html:549
@@ +548,3 @@
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('binaryConditionalOperator0')"><a name="binaryConditionalOperator0Anchor">binaryConditionalOperator</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1BinaryConditionalOperator.html">BinaryConditionalOperator</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="binaryConditionalOperator0"><pre>Matches binary conditional operator expressions (GNU extension).
+
----------------
See above re: gnu specific extensions.  When I read the name of this matcher, I expected it to be matching `==`, `!=`, `<=`, etc.

================
Comment at: docs/LibASTMatchersReference.html:1120
@@ +1119,3 @@
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('opaqueValueExpr0')"><a name="opaqueValueExpr0Anchor">opaqueValueExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1OpaqueValueExpr.html">OpaqueValueExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="opaqueValueExpr0"><pre>Matches opaque value expressions.
+
----------------
The docs say that OpaqueValueExpr doesn't correspond to concrete syntax, so why would we have a matcher for it?

================
Comment at: docs/LibASTMatchersReference.html:1140
@@ +1139,3 @@
+Given
+  template<typename T> class X { void f() { X x(*this); } };
+parenListExpr()
----------------
Can we have a simpler example?  For instance, I can't see that `ParenListExpr` has anything to do with templates.

================
Comment at: docs/LibASTMatchersReference.html:1149
@@ +1148,3 @@
+
+Example: Matches __func__)
+  printf("%s", __func__);
----------------
Does it actually match the closing paren?

================
Comment at: docs/LibASTMatchersReference.html:1175
@@ +1174,3 @@
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('stmtExpr0')"><a name="stmtExpr0Anchor">stmtExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1StmtExpr.html">StmtExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="stmtExpr0"><pre>Matches GNU statement expression.
+
----------------
Ditto re: gnu extension

================
Comment at: docs/LibASTMatchersReference.html:1752
@@ +1751,3 @@
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>></td><td class="name" onclick="toggle('requiresZeroInitialization0')"><a name="requiresZeroInitialization0Anchor">requiresZeroInitialization</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="requiresZeroInitialization0"><pre>Matches a constructor call expression which requires
+zero initialization.
----------------
Please provide an example.


http://reviews.llvm.org/D17446





More information about the cfe-commits mailing list