Summary:
Add the `objcImplementationDecl` matcher. See related: D30854
Tested with:
```
./tools/clang/unittests/ASTMatchers/ASTMatchersTests
```
Reviewers: aaron.ballman, compnerd, alexshap
Reviewed By: aaron.ballman
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D37643
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312889
91177308-0d34-0410-b5e6-
96231b3b80d8
</pre></td></tr>
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('objcImplementationDecl0')"><a name="objcImplementationDecl0Anchor">objcImplementationDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ObjCImplementationDecl.html">ObjCImplementationDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="objcImplementationDecl0"><pre>Matches Objective-C implementation declarations.
+
+Example matches Foo
+ @implementation Foo
+ @end
+</pre></td></tr>
+
+
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('objcInterfaceDecl0')"><a name="objcInterfaceDecl0Anchor">objcInterfaceDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ObjCInterfaceDecl.html">ObjCInterfaceDecl</a>>...</td></tr>
<tr><td colspan="4" class="doc" id="objcInterfaceDecl0"><pre>Matches Objective-C interface declarations.
Decl,
ObjCInterfaceDecl> objcInterfaceDecl;
+/// \brief Matches Objective-C implementation declarations.
+///
+/// Example matches Foo
+/// \code
+/// @implementation Foo
+/// @end
+/// \endcode
+const internal::VariadicDynCastAllOfMatcher<
+ Decl,
+ ObjCImplementationDecl> objcImplementationDecl;
+
/// \brief Matches Objective-C protocol declarations.
///
/// Example matches FooDelegate
REGISTER_MATCHER(numSelectorArgs);
REGISTER_MATCHER(ofClass);
REGISTER_MATCHER(objcCategoryDecl);
+ REGISTER_MATCHER(objcImplementationDecl);
REGISTER_MATCHER(objcInterfaceDecl);
REGISTER_MATCHER(objcIvarDecl);
REGISTER_MATCHER(objcMessageExpr);
EXPECT_TRUE(matchesObjC(
ObjCString,
objcProtocolDecl(hasName("Proto"))));
+ EXPECT_TRUE(matchesObjC(
+ ObjCString,
+ objcImplementationDecl(hasName("Thing"))));
EXPECT_TRUE(matchesObjC(
ObjCString,
objcCategoryDecl(hasName("ABC"))));