================ @@ -539,11 +539,12 @@ class ASTReader /// Mapping from main decl ID to the related decls IDs. /// - /// These related decls have to be loaded right after the main decl. - /// It is required to have canonical declaration for related decls from the - /// same module as the enclosing main decl. Without this, due to lazy - /// deserialization, canonical declarations for the main decl and related can - /// be selected from different modules. + /// The key is the main decl ID, and the value is a vector of related decls + /// that must be loaded immediately after the main decl. This is necessary + /// to ensure that the definition for related decls comes from the same module + /// as the enclosing main decl. Without this, due to lazy deserialization, + /// the definition for the main decl and related decls may come from different + /// modules. ---------------- hokein wrote:
Thanks for confirming. I think it would be worth documenting this (it took me some time to fully understand what `RelatedDeclsMap` is and how it's used). Clear documentation could help others in the future. https://github.com/llvm/llvm-project/pull/123648 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits