[clang] [WIP][Modules] Delay deserialization of preferred_name attribute at r… (PR #122726)

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 14 01:46:41 PST 2025


================
@@ -4424,6 +4454,51 @@ void ASTReader::loadPendingDeclChain(Decl *FirstLocal, uint64_t LocalOffset) {
   ASTDeclReader::attachLatestDecl(CanonDecl, MostRecent);
 }
 
+void ASTReader::loadPreferredNameAttribute(
+    const PendingPreferredNameAttribute &PreferredNameAttribute) {
+  Decl *D = PreferredNameAttribute.D;
+  ModuleFile *M = getOwningModuleFile(D);
+
+  unsigned LocalDeclIndex = D->getGlobalID().getLocalDeclIndex();
----------------
ilya-biryukov wrote:

I thought we might need to store the indices separately, but having the declaration around we actually have enough to look up the bitstream position.

Nice trick, kudos for coming up with this!


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


More information about the cfe-commits mailing list