Recommit [Modules] Remove unnecessary check when generating name lookup table in...
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>
Thu, 23 Mar 2023 03:21:35 +0000 (11:21 +0800)
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>
Thu, 23 Mar 2023 03:21:35 +0000 (11:21 +0800)
commit25557aa38a0dab76f5b7a4518942f69d879693c0
tree5b828c646e3d567505007342b1f77581dfa348bb
parent89a1af749166627704cdf9d676455d32616c2c06
Recommit [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.

See the discussion in
https://reviews.llvm.org/rG1e0709167f5edd330889f51bb203c458bdb5e359
to see the information for recommitting.
clang/include/clang/Serialization/ASTWriter.h
clang/lib/Serialization/ASTWriter.cpp
clang/test/Modules/pr61065.cppm [new file with mode: 0644]