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

Vassil Vassilev via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 3 00:05:29 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);
----------------
vgvassilev wrote:

What if the TemplateDecl came from a different module file and this module file contains only specializations?

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


More information about the cfe-commits mailing list