================
@@ -39,8 +43,42 @@ bool isOperatorNewDelete(OverloadedOperatorKind OpKind) {
using DeclCallback =
llvm::function_ref<void(SourceLocation, NamedDecl &, RefType)>;
+class ObjCSelectorDeclMapBuilder
+ : public RecursiveASTVisitor<ObjCSelectorDeclMapBuilder> {
+public:
+ ObjCSelectorMap takeMap() { return std::move(Map); }
+
+ bool TraverseDecl(clang::Decl *D) {
+ if (!D)
+ return true;
+ if (auto *Container = llvm::dyn_cast<clang::ObjCContainerDecl>(D)) {
+ for (clang::ObjCMethodDecl *M : Container->methods()) {
----------------
nico wrote:
For `@property int foo`, won't this here push_back both the synthesized `-foo`
getter and the property itself?
(If this turns out to be true, maybe add a test that's sensitive to this.)
Maybe override VisitObjCMethodDecl or VisitObjCPropertyDecl instead of manually
traversing?
https://github.com/llvm/llvm-project/pull/212564
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits