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

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 2 10:57:02 PST 2018

rsmith added a comment.

I think you should track lazy partial specializations separately from lazy full specializations -- we need to load all the partial specializations when doing partial specialization selection, and don't want to load all full specializations at the same time.

Comment at: lib/Serialization/ASTReaderDecl.cpp:92
       for (unsigned I = 0, Size = Record.readInt(); I != Size; ++I)
-        IDs.push_back(ReadDeclID());
+        IDs.push_back(LazySpecializationInfo(ReadDeclID(), Record.readInt()));
Move these subexpressions to separate statements; the two "read" calls are not sequenced here.

Comment at: lib/Serialization/ASTReaderDecl.cpp:3972
       // It will be added to the template's lazy specialization set.
-      PendingLazySpecializationIDs.push_back(ReadDeclID());
+      LazySpecializationInfo LazySpecInfo(ReadDeclID(), Record.readInt());
+      PendingLazySpecializationIDs.push_back(LazySpecInfo);
Likewise here.



More information about the cfe-commits mailing list