[Serialization] Don't try to complete the redeclaration chain in
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>
Fri, 12 May 2023 02:20:13 +0000 (10:20 +0800)
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>
Fri, 12 May 2023 06:28:58 +0000 (14:28 +0800)
commitcf47e9fe86aa65b74b0476a5ad4d036dd7463bfb
treeb7a955f1988e3b568fa533a6d6d6307ef9f38a1b
parent5becf548abe84478e691a2511f4c7517fce6a371
[Serialization] Don't try to complete the redeclaration chain in
ASTReader after we start writing

This is intended to mitigate
https://github.com/llvm/llvm-project/issues/61447.

Before the patch, it takes 5s to compile test.cppm in the above
reproducer. After the patch it takes 3s to compile it. Although this
patch didn't solve the problem completely, it should mitigate the
problem for sure. Noted that the behavior of the patch is consistent
with the comment of the originally empty function
ASTReader::finalizeForWriting. So the change should be consistent with
the original design.
clang/include/clang/Serialization/ASTReader.h
clang/lib/Serialization/ASTReader.cpp
clang/test/Modules/polluted-operator.cppm