================
@@ -2234,8 +2234,15 @@ void ASTDeclWriter::VisitRedeclarable(Redeclarable<T>
*D) {
// redecl chain.
unsigned I = Record.size();
Record.push_back(0);
- if (Writer.Chain)
- AddFirstDeclFromEachModule(DAsT, /*IncludeLocal*/false);
+ if (Writer.Chain) {
+ // Namespace can have many redeclaration in many TU.
+ // We try to avoid touching every redeclaration to try to
+ // reduce the dependencies as much as possible.
+ if (!isa<NamespaceDecl>(DAsT))
+ AddFirstDeclFromEachModule(DAsT, /*IncludeLocal*/ false);
+ else
+ Record.AddDeclRef(nullptr);
----------------
shafik wrote:
```suggestion
Record.AddDeclRef(/*Decl=*/nullptr);
```
https://github.com/llvm/llvm-project/pull/179178
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits