Recommit [C++20] [Modules] Don't load declaration eagerly for named modules
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>
Thu, 6 Apr 2023 03:01:58 +0000 (11:01 +0800)
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>
Thu, 6 Apr 2023 03:01:58 +0000 (11:01 +0800)
commit5bbadec2d1e0d5d0d25295759d49f6cd420d0968
tree870b3b44d67700d0362cc750aa6a99171e6fe053
parentb24b179b1ae8f83870ecec47e377deabe0debab4
Recommit [C++20] [Modules] Don't load declaration eagerly for named modules

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

The root cause of the issue is that we will deserilize some declarations
eagerly when reading the BMI. However, many declarations in the BMI are
not necessary for the importer. So it wastes a lot of time.

The new commit handles the MSVC's extension #pragma comment and #pragma
detect_mismatch to follow MSVC's behavior. See pr61783 for details.
clang/lib/Serialization/ASTWriterDecl.cpp
clang/test/Modules/no-eager-load.cppm [new file with mode: 0644]
clang/test/Modules/pr61783.cppm [new file with mode: 0644]