[clang] [APINotes] Add Where.Object selectors for C++ methods (PR #216148)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 7 04:52:16 PDT 2026


================
@@ -1185,29 +1224,24 @@ class YAMLConverter {
 
     llvm::StringSet<> KnownMethodSelectors;
     for (const auto &CXXMethod : T.Methods) {
-      auto WhereParameters = getWhereParameters(CXXMethod);
-      if (!WhereParameters.first)
+      auto WhereSelector = getWhereSelector(CXXMethod, /*AllowObject=*/true);
+      if (!WhereSelector)
         continue;
 
-      if (WhereParameters.second) {
-        if (!KnownMethodSelectors
-                 .insert(getFunctionSelectorKey(CXXMethod.Name,
-                                                *WhereParameters.second))
-                 .second) {
+      if (WhereSelector->Parameters || WhereSelector->Object) {
+        std::string DuplicateKey =
----------------
Xazax-hun wrote:

Alternatively, I am also wondering, if we already have `operator==` for the selectors we only might need hashes added for them and maybe we could use a hash set on the selectors for deduplication directly instead of creating separate string keys? 

https://github.com/llvm/llvm-project/pull/216148


More information about the cfe-commits mailing list