[clang] [serialization] no transitive decl change (PR #92083)
Chuanqi Xu via cfe-commits
cfe-commits at lists.llvm.org
Sun May 26 23:30:54 PDT 2024
================
@@ -7802,20 +7800,31 @@ Decl *ASTReader::GetDecl(GlobalDeclID ID) {
LocalDeclID ASTReader::mapGlobalIDToModuleFileGlobalID(ModuleFile &M,
GlobalDeclID GlobalID) {
- DeclID ID = GlobalID.get();
- if (ID < NUM_PREDEF_DECL_IDS)
+ if (GlobalID.get() < NUM_PREDEF_DECL_IDS)
+ return LocalDeclID(GlobalID.get());
+
+ if (!M.ModuleOffsetMap.empty())
+ ReadModuleOffsetMap(M);
+
+ ModuleFile *Owner = getOwningModuleFile(GlobalID);
+ DeclID ID = GlobalID.getLocalDeclIndex();
+
+ if (Owner == &M) {
+ ID += NUM_PREDEF_DECL_IDS;
return LocalDeclID(ID);
+ }
- GlobalDeclMapType::const_iterator I = GlobalDeclMap.find(GlobalID);
- assert(I != GlobalDeclMap.end() && "Corrupted global declaration map");
- ModuleFile *Owner = I->second;
+ uint64_t OrignalModuleFileIndex = 0;
+ for (unsigned I = 0; I < M.DependentModules.size(); I++)
----------------
ChuanqiXu9 wrote:
Done in https://github.com/llvm/llvm-project/commit/b590ba73a76609bace9949ea8195d2ee8213cb3f
https://github.com/llvm/llvm-project/pull/92083
More information about the cfe-commits
mailing list