================
@@ -2107,8 +2107,8 @@ void ASTDeclMerger::MergeDefinitionData(
     auto *Def = DD.Definition;
     DD = std::move(MergeDD);
     DD.Definition = Def;
-    while ((Def = Def->getPreviousDecl()))
-      cast<CXXRecordDecl>(Def)->DefinitionData = &DD;
+    for (auto *D : Def->redecls())
+      cast<CXXRecordDecl>(D)->DefinitionData = &DD;
----------------
ChuanqiXu9 wrote:

BTW, if we can have noload_redecls()? redecls() may trigger loading of all 
redeclarations for the RD. 

This sounds very bad. But it may not be so bad as there are already many such 
code right now...  so I don't block this. And I'd like to promote my post here: 
https://discourse.llvm.org/t/request-for-discussion-clang-a-bidirectional-decl-query-system/88945

https://github.com/llvm/llvm-project/pull/170090
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to