[Modules] Remove unnecessary check when generating name lookup table in ASTWriter
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>
Thu, 9 Mar 2023 09:25:59 +0000 (17:25 +0800)
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>
Thu, 9 Mar 2023 09:29:36 +0000 (17:29 +0800)
commitdb987b9589be1eb604fcb74c85b410469e31485f
tree01b5331b3633a6b12b55a680feebaa681b0edfbe
parent6b545db83c5a4e2c79e0b289e840be2c5fbbf327
[Modules] Remove unnecessary check when generating name lookup table in ASTWriter

Close https://github.com/llvm/llvm-project/issues/61065.

We will avoid writing the names from external AST naturally. But
currently its check is often false positive since we may have already
marked the declarations as external but
DeclContext::hasNeedToReconcileExternalVisibleStorage would be false
after reconciling.

Tested with libcxx's modular build.

This patch can improve 8% compilation time in an internal workloads.
clang/include/clang/Serialization/ASTWriter.h
clang/lib/Serialization/ASTWriter.cpp
clang/test/Modules/pr61065.cppm [new file with mode: 0644]