[PATCH] D60543: [clang] Add matcher for subclasses of Objective-C interfaces 🔍

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 11 09:38:19 PDT 2019


aaron.ballman added inline comments.


================
Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:1479
+/// \endcode
+AST_MATCHER_P(ObjCInterfaceDecl, isSubclassOfInterface,
+              internal::Matcher<ObjCInterfaceDecl>,
----------------
stephanemoore wrote:
> I am still uncertain about the naming.
> 
> `isSubclassOf` seemed too generic as that could apply to C++ classes.
> `objcIsSubclassOf` seemed unconventional as a matcher name.
> `isSubclassOfObjCInterface` and `isSubclassOfObjCClass` seemed awkwardly lengthy.
> Creating a new namespace `clang::ast_matchers::objc` seemed unprecedented.
> 
> I am happy to change the name if you think another name would be more appropriate.
Does ObjC use the term "derived" by any chance? We already have `isDerivedFrom`, so I'm wondering if we can use that to also match on an `ObjCInterfaceDecl`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60543





More information about the cfe-commits mailing list