[PATCH] D109632: [clang] de-duplicate methods from AST files

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 16 14:44:41 PDT 2021


dexonsmith added inline comments.


================
Comment at: clang/include/clang/Sema/Sema.h:1434-1436
+    bool addMethod(ObjCMethodDecl *Method) {
+      return AddedMethods.insert(Method).second;
+    }
----------------
Hmm, I was imagining that the set would be more encapsulated than this, not just stored in the same place.

I'm wondering if the following could be done in a prep commit:

- Change Sema::addMethodToGlobalList to a private member function of GlobalMethodPool.
- Make GlobalMethodPool::insert private
- Add `GlobalMethodPool::addMethod(ObjCMethodDecl*,bool,bool)`, which does the second half of Sema::AddMethodToGlobalPool (the parts that don't need Sema's other fields), and change the latter to call the former.

WDYT?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109632



More information about the cfe-commits mailing list