[PATCH] D41416: [modules] [pch] Do not deserialize all lazy template specializations when looking for one.

Chuanqi Xu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 10 19:27:21 PDT 2023


ChuanqiXu added inline comments.


================
Comment at: clang/include/clang/AST/DeclTemplate.h:786-788
+    uint32_t DeclID = ~0U;
+    unsigned ODRHash = ~0U;
+    bool IsPartial = false;
----------------
Maybe this can save some space.


================
Comment at: clang/lib/AST/DeclTemplate.cpp:366
+                                                      Args,
+                                                      TemplateParameterList *TPL) const {
+  CommonBase *CommonBasePtr = getMostRecentDecl()->getCommonPtr();
----------------
TPL here looks not used.


================
Comment at: clang/lib/Serialization/ASTWriterDecl.cpp:288
+      }
+      for (auto &SpecInfo : LazySpecializations) {
+        Record.push_back(SpecInfo.DeclID);
----------------
v.g.vassilev wrote:
> We should not store the lazy specialization information as an array of items because that makes the search slow. Instead we should use the `OnDiskHashTable` approach which we use already to store the identifier data.
Do you want to implement it in this patch? Or this is a note for future optimizations?


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

https://reviews.llvm.org/D41416



More information about the cfe-commits mailing list