================
@@ -1438,6 +1461,15 @@ ReferencesResult findReferences(ParsedAST &AST, Position 
Pos, uint32_t Limit,
             getOverriddenMethods(CMD, OverriddenMethods);
           }
         }
+        // Special case: Objective-C methods can override a parent class or
+        // protocol, we should be sure to report references to those.
+        if (const auto *OMD = llvm::dyn_cast<ObjCMethodDecl>(ND)) {
+          OverriddenBy.Subjects.insert(getSymbolID(OMD));
+          llvm::SmallVector<const ObjCMethodDecl *, 4> Overrides;
+          OMD->getOverriddenMethods(Overrides);
+          for (const auto *Override : Overrides)
+            OverriddenMethods.insert(getSymbolID(Override));
----------------
kadircet wrote:

for C++ we recursively traverse up the whole virtual-method hierarchy. any 
reason for not doing the same here?

https://github.com/llvm/llvm-project/pull/127109
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to