[clang] [C++20] [Modules] Implementing Eliding Unreachable Decls of GMF in ASTWriter (PR #76930)

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 29 02:25:06 PDT 2024


ChuanqiXu9 wrote:

I took another review on this patch and it shows the patch itself is not so correct.

The idea of the patch is to skip GMF at first and start to write the module from the module purview directly. Then everything unused in GMF is not used. This seems fine. However, in the module purview, if we used something from a namespace of the GMF, we would everything in the namespace back. This is terrible. So in this patch, when we visit decl context, we skipped adding unreached declarations. 

However, this is the problem. Since an unreached declaration during the process of writing become be reachable in the end of the writing. However, we've skipped it.

To solve this, either we need to write the declaration context lazily or perform a walk ahead of time. But clearly, we can't continue with the current patch. I'll bring a new one after I figured it out.

https://github.com/llvm/llvm-project/pull/76930


More information about the cfe-commits mailing list