Index: cfe/trunk/docs/LibASTMatchersReference.html =================================================================== --- cfe/trunk/docs/LibASTMatchersReference.html +++ cfe/trunk/docs/LibASTMatchersReference.html @@ -346,6 +346,15 @@ +
Matches Objective-C implementation declarations. + +Example matches Foo + @implementation Foo + @end +
Matches Objective-C interface declarations. Index: cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h =================================================================== --- cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h +++ cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h @@ -1145,6 +1145,17 @@ 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 Index: cfe/trunk/lib/ASTMatchers/Dynamic/Registry.cpp =================================================================== --- cfe/trunk/lib/ASTMatchers/Dynamic/Registry.cpp +++ cfe/trunk/lib/ASTMatchers/Dynamic/Registry.cpp @@ -374,6 +374,7 @@ REGISTER_MATCHER(numSelectorArgs); REGISTER_MATCHER(ofClass); REGISTER_MATCHER(objcCategoryDecl); + REGISTER_MATCHER(objcImplementationDecl); REGISTER_MATCHER(objcInterfaceDecl); REGISTER_MATCHER(objcIvarDecl); REGISTER_MATCHER(objcMessageExpr); Index: cfe/trunk/unittests/ASTMatchers/ASTMatchersNodeTest.cpp =================================================================== --- cfe/trunk/unittests/ASTMatchers/ASTMatchersNodeTest.cpp +++ cfe/trunk/unittests/ASTMatchers/ASTMatchersNodeTest.cpp @@ -1612,6 +1612,9 @@ objcProtocolDecl(hasName("Proto")))); EXPECT_TRUE(matchesObjC( ObjCString, + objcImplementationDecl(hasName("Thing")))); + EXPECT_TRUE(matchesObjC( + ObjCString, objcCategoryDecl(hasName("ABC")))); EXPECT_TRUE(matchesObjC( ObjCString,