ChuanqiXu9 wrote:

The original design is, C++20 module imports are part of the Preamble. The 
preamble is a concept in lexer level.

So before C++20 modules, preamble consists of header includes and some other 
preprocessor directives. After C++20 modules, preamble consists of header 
includes  and module imports and some other preprocessor directives. 
 
And also, in clangd, there was an optimization to create PCH for header 
includes. And it may be problematic due to clang's implementation reasons. So 
we added SkipPreambleBuild.

> I think it's better not to build/check modules at preamble build stage if 
> preamble optimization is disabled.

So I think the term "preamble optimization" may be misleading after we 
introduce modules support. Previously "preamble optimization"  is the same 
thing with PCH optimization. But after we introduce modules, "preamble 
optimization" is just an optimization for part of the preamble. Maybe it is 
better to rename  "preamble optimization" to "preamble PCH optimization".

(And also, the term "preamble build" is not precise too.)

In short, I don't think we need to relate modules build with original preamble 
PCH optimization. They are different things.

https://github.com/llvm/llvm-project/pull/199460
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to