[clang] Llvm modules on demand bmi (PR #71773)

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 9 18:01:55 PST 2023


ChuanqiXu9 wrote:

> The proposition of the patches here is (in the most common general case) to remove the step of generating the ImplementationBMI and to pipeline the filtering to the AST consumer that generates the Interface BMI. 

Agreed. This is what I want too.

> Whether we re-use wrapper code or make some new code is an implementation detail.
> It does not actually prevent you from taking the two-phase approach ( currently , --precompile will be unchanged in action).

It doesn't prevent the two-phase compilation model indeed. But it introduces a new way about how we produce BMIs. The new way skipped the part of jobs we did in drivers for `.cppm`. Then this is the divergence that I am concerning too.

---
 
In my mind, the proper solution is to introduce a new frontend action that combines GenerateModuleInterfaceAction and CodeGenAction. Then in the driver part, we generate the new action in the precompile phase for some combination of the input then we can skip the `Compile` phase.


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


More information about the cfe-commits mailing list