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

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 9 00:15:42 PST 2023


ChuanqiXu9 wrote:

> > clang++  -std=c++20 foo.cpp -c -fmodule-file=X=some/dir/X.pcm
> 
> Hm, according to https://clang.llvm.org/docs/StandardCPlusPlusModules.html this can already be achieved with the `-fmodule-output` option (and which I was about to try in `build2`). Is there a reason a different option is used for what seems to be the same functionality. Or am I missing something here?
> 
> > This is the main point of the patch - to do this efficiently.
> 
> Again, just want to clarify: as I understand it, this patch solves the scaling issue Ben reported (#60996) but without the thin/fat BMI complications, correct?

The difference is about the efficiency and the interfaces doesn't change a lot. Previously, in the one phase compilation mode, what clang did actually is:

```
x.cppm -> x.pcm -> x.o
```

That said we compile `x.o` from `x.pcm`. There is a reading BMI process. The goal of the patch is to remove the reading process.

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


More information about the cfe-commits mailing list