[clang] [Serialization] Load Specializations Lazily (1/2) (PR #76774)

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 4 19:53:07 PST 2024


================
@@ -2431,10 +2434,14 @@ void ASTDeclReader::VisitClassTemplateDecl(ClassTemplateDecl *D) {
   mergeRedeclarableTemplate(D, Redecl);
 
   if (ThisDeclID == Redecl.getFirstID()) {
-    // This ClassTemplateDecl owns a CommonPtr; read it to keep track of all of
-    // the specializations.
+    // This ClassTemplateDecl owns a CommonPtr; read it to keep track of all
+    // of the specializations.
     SmallVector<serialization::DeclID, 32> SpecIDs;
     readDeclIDList(SpecIDs);
+
+    if (Record.readInt())
+      ReadDeclsSpecs(*Loc.F, D, Loc.F->DeclsCursor);
----------------
ChuanqiXu9 wrote:

Then it won't fall here. It is the job of the latter patch (https://github.com/ChuanqiXu9/llvm-project/commit/7f027f0b6551a8e421034e96bd0a4c953c473df6)

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


More information about the cfe-commits mailing list