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

2023-11-09 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > > > > > > 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). > > > > > > >

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

2023-11-09 Thread Iain Sandoe via cfe-commits
iains wrote: > > > > > > 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). > > > > > > > > > > > > >

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

2023-11-09 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > > > > 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 d

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

2023-11-09 Thread Iain Sandoe via cfe-commits
iains wrote: > > > > 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

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

2023-11-09 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > > 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

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

2023-11-09 Thread Iain Sandoe via cfe-commits
iains wrote: > > 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 in

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

2023-11-09 Thread Chuanqi Xu via cfe-commits
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 wra

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

2023-11-09 Thread Iain Sandoe via cfe-commits
iains 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 diffe

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

2023-11-09 Thread Iain Sandoe via cfe-commits
iains wrote: Let us try to determine fundamental constraints. To produce a BMI (David's ImplementationBMI) that can generate the object file, it must contain all the AST. this is equivalent to hypothetical ` clang++ -x c++-module foo.cpp --prepcompile -fmodule-file=X=X-implementation.pcm`

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

2023-11-09 Thread Chuanqi Xu via cfe-commits
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

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

2023-11-09 Thread Boris Kolpackov via cfe-commits
boris-kolpackov 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` options (which I was about to try in `build2`). Is there a reason a diffe

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

2023-11-09 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > There are 2 things in the patch. One is to generate the BMI and the object > > file in one phase (phase here means preprocess, precompile, compile, ...). > > This is the main point of the patch - to do this efficiently. Got it. The we can be more focused. > > > But afte

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

2023-11-08 Thread Iain Sandoe via cfe-commits
iains wrote: > There are 2 things in the patch. One is to generate the BMI and the object > file in one phase (phase here means preprocess, precompile, compile, ...). This is the main point of the patch - to do this efficiently. >Another is to allow us to generate BMI from a `.cpp` file. (Cu

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

2023-11-08 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: This is a little bit far from what I imaged. There are 2 things in the patch. One is to generate the BMI and the object file in one phase (phase here means preprocess, precompile, compile, ...). Another is to allow us to generate BMI from a `.cpp` file. (Currently we only do

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

2023-11-08 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 21861991e760e7e845dc1be5b804c950543d699a 6fa533ecaef0f75c87554fb646b0e5dca8ea7255 --

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

2023-11-08 Thread Iain Sandoe via cfe-commits
https://github.com/iains created https://github.com/llvm/llvm-project/pull/71773 Here is a **draft** of the patch series that allows for emitting both an object and a BMI from the same compiler invocation. Because of point 1) below it's fairly limited in the command lines supported, you can do