[PATCH] D29951: Load lazily the template specialization in multi-module setups.

Richard Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 23 12:07:22 PDT 2017


rsmith added inline comments.


================
Comment at: include/clang/Serialization/ASTReader.h:551
 
+  llvm::SmallVector<serialization::DeclID, 8> PendingLazySpecializationIDs;
+
----------------
I'm not sure we can safely use global state for this: loading update records can trigger the import of a declaration and *its* update records, which would mean we'd attach the pending lazy specializations to the wrong declaration. Can you keep this list locally in `ASTReader::loadDeclUpdateRecords` instead, and pass it into `UpdateDecl`?


================
Comment at: include/clang/Serialization/ASTReader.h:1293-1295
+    // FIXME: A hack to access the protected getCommonPtr. This is because
+    // AddLazySpecializations should be called in the ASTReader which is not a
+    // friend of Class,Function,VarTemplateDecl.
----------------
Make this a static member of `ASTDeclReader` to avoid this hack.


https://reviews.llvm.org/D29951





More information about the cfe-commits mailing list